SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi everyone!

    Code:
    <?php
    
    	/*how do i check if the form is submitted 
    	by the image input with the name "send"?
    	i tried: */
    
    	if($send){
    		echo "$test";
    	}
    
    	//but didnt work
    ?>
    <html>
    <head>
    <title>submit</title>
    </head>
    <body>
    <form method="post" action="submit.php">
    <input type="text" name="test"><br>
    <input type="image" src="cool.gif" name="send">
    </form>
    </body>
    </html>
    can somebody help solve that problem of mine?

    Thanks
    Sang N.

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if ($send_x > 0) {
    echo "$test";
    }


    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  3. #3
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi Freddy,

    what is $send_x representing?

    Thanks

  4. #4
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well the _x represents the x coordinate fo the image where the user clicked, when you use an input of type image the value that gets passed is the x and y coordinates fo where the user clicked and it gets passed as the input name_x and _y so by checking if the value opf the x coordinate is greater than 0 you can check if the button was clicked.
    Please don't PM me with questions.
    Use the forums, that is what they are here for.

  5. #5
    SitePoint Enthusiast
    Join Date
    Jul 2000
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool thanks


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
  •