SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry how can i get value of form through last <form> tag on next page

    please help please i am stuck with this problem in project please
    while($row=mysql_fetch_array($result)){
    if($row[0]==1){
    echo "<br/><div>";
    echo $row[1]."<form action='on_call.php' method='POST'>
    <input type='hidden' name='".$row[1]."' value='".$row[1]."'/>
    <input type='submit' value='Call Me'/></form>";
    echo "</div>";
    }
    }

    what should i write on (on_call.php)page that it get its value
    i know on next page we use the $_POST['here what should i write'] i don't know

  2. #2
    Keeper of the SFL StarLion's Avatar
    Join Date
    Feb 2006
    Location
    Atlanta, GA, USA
    Posts
    3,748
    Mentioned
    72 Post(s)
    Tagged
    0 Thread(s)
    you'd have to know the value of the name attribute; OR, you could walk iteratively through the $_POST array (foreach $_POST AS $key => $value)

    Why are you using the value as the name, though? Why not

    <input type='hidden' name='CallNumber' value='".$row[1]."' />
    Never grow up. The instant you do, you lose all ability to imagine great things, for fear of reality crashing in.

  3. #3
    SitePoint Member
    Join Date
    Jan 2013
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it works
    thanks
    a lot

    and i also did this with query string



    /*$query="SELECT value,name FROM availbilty WHERE value='1'";// through query string i did this
    $result=mysql_query($query);
    while($row=mysql_fetch_array($result)){
    if($row[0]==1){
    echo "<br/><div id='lodiv'>";
    echo "<h3 style='padding-left:10px;padding-top:5px;'>".$row['name'];
    echo "<a style='float:right;padding-right:10px;padding-top:0px;'href='on_call.php? name=$row[name]'>call me</a></h3>";
    echo "</div>";
    }
    }*/

    on other page i just use this
    $_get['name'];


Bookmarks

Posting Permissions

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