PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old October 3rd, 2002, 01:50 AM
baiyanh baiyanh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 23 baiyanh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Please help

Hello, Matt

I tried your form code from online. I copied it to my local server. But for some reason when I click "Click Me". It will give me "Hmm...you must have come to this script without clicking the button." message
The right answer should be "Great! You clicked the button!" after I click the button.
Do you know why possibly that happened? Thanks alot.

Here is your code:
<HTML>
<HEAD>
<TITLE>A simple form</TITLE>
</HEAD>
<BODY>
<FORM method="POST" action="form.php">
<INPUT type="submit" name="mybutton" value="Click me!">
</FORM>
</BODY>
</HTML>

<HTML>
<HEAD>
<TITLE>Doing something with the form</TITLE>
</HEAD>
<BODY>
<?
if(isset($_POST['mybutton'])) {
echo "Great! You clicked the button!n";
} else {
echo "Hmm...you must have come to this script without clicking the button.n";
}
?>
</BODY>
</HTML>

Reply With Quote
  #2  
Old October 3rd, 2002, 03:56 AM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Please help

there is nothing wrong with that code. In fact i tested it out just to make sure i wasnt missing anything, works fine. Are you sure thats exactly what you copied?

Reply With Quote
  #3  
Old October 3rd, 2002, 08:04 AM
v_jansen v_jansen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Netherlands
Posts: 25 v_jansen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please help

What version of PHP do you use.
If lower then 4.1.0 you should use $HTTP_POST_VARS['mybutton'] instead of $_POST['mybutton']

Reply With Quote
  #4  
Old October 3rd, 2002, 10:40 AM
Matt Matt is offline
Moderator
Codewalkers Specialist (4000 - 4499 posts)
 
Join Date: Apr 2007
Location: Florida
Posts: 4,158 Matt User rank is Private First Class (20 - 50 Reputation Level)Matt User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 4 h 10 m 20 sec
Reputation Power: 6
RE: Please help

Good call v_jansen, that is the only thing I can think of also. Pre v4.1.0 didn't have the $_POST superglobal...


Reply With Quote
  #5  
Old October 3rd, 2002, 03:07 PM
baiyanh baiyanh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 23 baiyanh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please help

actually I am not sure which version of PHP. All I do was upload the php files to Red Hat Linux server which owned by my school. Should I ask my school about it? But what should I ask them?
please don't mind my silly questions.

Thanks all

Reply With Quote
  #6  
Old October 3rd, 2002, 03:17 PM
baiyanh baiyanh is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 23 baiyanh User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Please help

Hi everybody, I just asked my school's adm. I used version it is under PHP 4.0. I fixed my problem.

Thank you guys very much and I think this place is great!!

Reply With Quote
  #7  
Old October 3rd, 2002, 11:12 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Please help

In the furure to get all your information create a page call it phpinfo.php and add the following line

Code:
<? phpinfo(); ?>


Then view your page in a browser


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Please help


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 1 hosted by Hostway