SunQuest
 
           General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old March 19th, 2003, 05:17 PM
RichardZ RichardZ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2002
Posts: 7 RichardZ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 57 sec
Reputation Power: 0
Image submit button ??

Hi,

I changed the submit button created using <INPUT TYPE="SUBMIT> to an image submit button <INPUT TYPE="IMAGE" SRC="login1.gif">. here is my code:

<?

if(isset($imgbut)){
echo "You click image button: $inputtext <br>"; //***
}
elseif (isset($butsubmit)){
echo "You click submit button: $inputtext <br>"; //+++
}
else{
echo "No click :$inputtext<br>"; //@@@
}
?>
<html>
<head>
<title></title>
</head>
<body bgcolor="#FFFFFF">

Submit Button Image<br>
<form action="imagebutton.php" method="post">
<input type="text" name="inputtext">
<input type="submit" name= "butsubmit" value="click me">
<input type="image" name="imgbut" src="login1.gif" value="Submitimage" >
</form>
</body>
</html>

When I click the image button( name= imgbut), it did not execute line //*** instead execute line/@@@, Why? How can I execute line/***? There is no problem if I click submit button(name=butsubmit). How can I get $imgbut variable after form action in php?

Many thanks for help

Richard

Reply With Quote
  #2  
Old March 20th, 2003, 12:11 PM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
Where are you assigning the values to $imgbut, $butsubmit, and $inputtext ? You need to set the name of the button to something, and do
Code:
if(isset($_POST['imgbut])){
or something similar.. you have to be assigning a value to the variable before you can test to see if it is set or not.. the submit button you created doesn't have a name, from what I can see.. try giving it a name and checking if that is set

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > Image submit button ??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway