Image Button Problem??

Reply

Join Date: Apr 2008
Posts: 293
Reputation: Aamit has a little shameless behaviour in the past 
Solved Threads: 11
Aamit Aamit is offline Offline
Posting Whiz in Training

Image Button Problem??

 
0
  #1
Dec 2nd, 2008
  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??
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 27
Reputation: xylude is an unknown quantity at this point 
Solved Threads: 0
xylude xylude is offline Offline
Light Poster

Re: Image Button Problem??

 
0
  #2
Dec 2nd, 2008
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:

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

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

  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.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 45
Reputation: Daedal is an unknown quantity at this point 
Solved Threads: 11
Daedal's Avatar
Daedal Daedal is offline Offline
Light Poster

Re: Image Button Problem??

 
0
  #3
Dec 2nd, 2008
I am pretty sure you can have only one image to submit.
Here is a workaround:
http://blogs.translucentcode.org/mic...uttons-and-ie/
Reply With Quote Quick reply to this message  
Join Date: Sep 2005
Posts: 1,075
Reputation: digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice digital-ether is just really nice 
Solved Threads: 66
Moderator
digital-ether's Avatar
digital-ether digital-ether is offline Offline
Veteran Poster

Re: Image Button Problem??

 
0
  #4
Dec 2nd, 2008
Do a var_dump($_POST);
See what you get.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC