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:
  #1  
Old December 8th, 2003, 07:41 AM
ludvig2000 ludvig2000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 ludvig2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
$_POST['submit'] problem

Hi.. I'm pretty new to this..

I am trying to make a login script, where I check if the login form has been submitted by using if ($_POST['submit'])...
For some reason, it always turns out with $_POST['submit'] not being set... If I try to check for the username text field being set, like this: $_POST['username'], it works fine...

Any ideas why??

Reply With Quote
  #2  
Old December 8th, 2003, 07:52 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to dhouston
Are you actually naming your submit field? I know that I often neglect to set it. And, well, why not just check for $_POST['username'] or $_POST.

Reply With Quote
  #3  
Old December 8th, 2003, 09:17 AM
ludvig2000 ludvig2000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 ludvig2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes.. I have set the submitnutton name to "submit".. I have also checked for any spelling mistakes a thousand times...

I could use $_POST['username'].. It just bothers me that it doesn't work, when I don't know why...

Besides, I also use the same method in my register script...

I use if $_POST['submit'] where I check for any blank input fields and other errors, and display the error messages..
and else to display the reg.form...

If I use for example $_POST['username'], and the user forgets to fill in that field before hitting the submit button, then the reg.form will be displyed without displaying the error messages...

Reply With Quote
  #4  
Old December 8th, 2003, 12:19 PM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 17
Send a message via ICQ to dhouston
Just use $_POST, then. I think that array should exist on post, though the values in the individual fields may be blank. Also, have you considered giving your submit button a different name? I doubt that's the problem, but it might be worth a shot. Is your submit button a button or an image? If it's an image, you'll need to use submit.x or submit.y to test for the button.

Reply With Quote
  #5  
Old December 8th, 2003, 01:10 PM
ludvig2000 ludvig2000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 ludvig2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Yes.. The submit button is an image.. How do I use submit.x or .y??

something like this?

if ($_POST['submit.x'])

Thanx

Reply With Quote
  #6  
Old December 8th, 2003, 01:23 PM
ludvig2000 ludvig2000 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Posts: 4 ludvig2000 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried using just $_POST like you said, and it worked perfectly..

Thanx a lot..

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > $_POST['submit'] problem


Developer Shed Advertisers and Affiliates


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 | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.

© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap