943,740 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 662
  • PHP RSS
Dec 2nd, 2008
0

Image Button Problem??

Expand Post »
PHP Syntax (Toggle Plain Text)
  1. <?php
  2. if(isset($_POST["send"]))
  3. {
  4. $name = $_POST["name"];
  5.  
  6. $email = $_POST["email"];
  7.  
  8. $msg = $_POST["msg"];
  9. echo(" Hello!<br />");
  10.  
  11. if(empty($name))
  12. {
  13. echo(" - There was no name!<br />");
  14. }
  15.  
  16.  
  17. if(empty($msg))
  18. {
  19. echo(" - There was no message!<br />");
  20. }
  21. // IF THEIR ARE NOT EMPTY
  22. if(!empty($name) && !empty($email) && !empty($msg))
  23. {
  24. //code for email
  25.  
  26. }
  27. }
  28. ?>
  29.  
  30. <form id="form" action="" enctype="multipart/form-data" method="post">
  31. <div class="column1">
  32. <div class="row">
  33. <input type="text" class="input" value="Name:" name="name"/>
  34. </div>
  35. <div class="row">
  36. <input type="text" class="input" value="E-mail:" name="email" />
  37. </div>
  38. <div class="row">
  39. <input type="text" class="input" value="Phone:" name="phone"/>
  40. </div>
  41.  
  42. </div>
  43. <div class="column1">
  44. <div class="">
  45. <textarea cols="30" rows="2" name="msg">Message:</textarea><br />
  46. <div class="div">
  47. <input type="image" src="images/cler1.jpg" name="send" />&nbsp; <input type="image" src="images/cler2.jpg" />
  48. </div>
  49. </div>
  50. </div>
  51. <div class="clear"></div>
  52. </form>

When i click on image to send not getting a simple echo message
how to do that??
Similar Threads
Reputation Points: 3
Solved Threads: 15
Posting Whiz
Aamit is offline Offline
341 posts
since Apr 2008
Dec 2nd, 2008
0

Re: Image Button Problem??

When you are submitting the form are you deliberately not filling out a form to check if the error comes through, or are you filling the form out all the way and have an echo message in your mail script that isn't showing up?

Something you could try is making another div box in your page. Then insert a php script kinda like this in the box:

php Syntax (Toggle Plain Text)
  1. <?
  2. if(isset($yourEcho))
  3. {
  4. echo $yourEcho;
  5. }
  6. ?>

and change the if statements in your main code to this:

php Syntax (Toggle Plain Text)
  1. if(empty($variable))
  2. {
  3. $yourEcho = "No variable set";
  4. }
Last edited by peter_budo; Dec 2nd, 2008 at 8:18 pm. Reason: Keep It Organized - For easy readability, always wrap programming code within posts in [code] (code blocks) and [icode] (inline code) tags.
Reputation Points: 13
Solved Threads: 11
Junior Poster
xylude is offline Offline
122 posts
since May 2008
Dec 2nd, 2008
0

Re: Image Button Problem??

I am pretty sure you can have only one image to submit.
Here is a workaround:
http://blogs.translucentcode.org/mic...uttons-and-ie/
Reputation Points: 23
Solved Threads: 12
Junior Poster in Training
Daedal is offline Offline
73 posts
since Apr 2008
Dec 2nd, 2008
0

Re: Image Button Problem??

Do a var_dump($_POST);
See what you get.
Moderator
Reputation Points: 457
Solved Threads: 101
Nearly a Posting Virtuoso
digital-ether is offline Offline
1,250 posts
since Sep 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: ftp_ssl_connect problom
Next Thread in PHP Forum Timeline: How to add google adsence module n drupal CMS?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC