Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2004
    Posts
    29

    Unanswered: php include file

    Hello, how i can include file in php against a button pushing.e.g
    [code]
    echho "<input type=button onclick=advance.php value=\"advance

    search\*>";
    it dosn't work

  2. #2
    Join Date
    Oct 2003
    Location
    Slovakia
    Posts
    482

    Re: php include file

    Originally posted by poppy_123
    Hello, how i can include file in php against a button pushing.e.g
    [code]
    echho "<input type=button onclick=advance.php value=\"advance

    search\*>";
    it dosn't work
    At first try to learn HTML...

  3. #3
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Thumbs up Re: php include file

    You cannot call a page like this. basically this onClick function is used to invoke a javascript or vbscript.
    And you question is not completely creal please telll us clearly what is your acctual purpose.
    If you want to display a page on the button click the you should call a javascript to do so. If you want this in the same page then use a div/layers for this purpose or even you can reload the page and display the new contents that you want to display in the advance search.
    If this dosnot solve you problem plz write back to us.

    Regards
    Rajesh

    Originally posted by poppy_123
    Hello, how i can include file in php against a button pushing.e.g
    [code]
    echho "<input type=button onclick=advance.php value=\"advance

    search\*>";
    it dosn't work

  4. #4
    Join Date
    Feb 2004
    Posts
    29
    If you want this in the same page then use a div/layers for this purpose or even you can reload the page and display the new contents that you want to display in the advance search.
    yes this i want, please give me examle.
    thanks

  5. #5
    Join Date
    Feb 2004
    Posts
    29
    I want to reload the same page, with different contents added

  6. #6
    Join Date
    Jan 2004
    Location
    India
    Posts
    168

    Thumbs up

    Try something like this
    <script language='javascript'>
    function advsearch()
    {
    document.form.action='pagename.php';
    document.form.submit();
    }

    function submitform()
    {
    document.from.action='search.php';
    document.from.submit();
    }
    </script>
    <form name='form' action='' method='post' onSubmit='return submitform();'>
    <!---From code and when you click on a button like below-->

    <input type='button' onClick='advsearch();' name='Advsearch' value='Advance Search'>

    <!-- You have a php script here like this with new features to search-->
    <?php
    if($Advsearch=='Advance Search')
    {
    ?>
    <input type='text' name='content' >
    <!--Like this any fields then clode the loop-->'

    <?php
    }
    // this will only show if you have clicked the advance button. b'coz the php will check of the value of the button (variable $Advsearch)
    ?>
    <!-- You have a php script Ends-->
    <input type='submit' name='submit' value='Search'>
    <!----You form code ends -->
    </form>

    I hope that you might have got the idea.
    If not get back to us

    Regards
    Rajesh


    Originally posted by poppy_123
    I want to reload the same page, with different contents added

  7. #7
    Join Date
    Feb 2004
    Posts
    29
    thanks rajesh, i check it

  8. #8
    Join Date
    Feb 2003
    Location
    Denver, CO
    Posts
    34
    You could also just use a variable in the QueryString:

    <html>
    <body>
    <input type="button" value="Next" onClick="javascript:window.location.href='test.php ?next=yes'">
    <?php
    if($HTTP_GET_VARS["next"]=="yes") {
    echo "<br><br>You pushed the next button.";
    }
    ?>
    </body>
    </html>
    -Wigz

    ------------------------------------------------
    docendo discimus.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •