Reply
Redirection if &_POST is not the same value
Old 10-14-2009, 05:36 PM Redirection if &_POST is not the same value
Average Talker

Posts: 22
Trades: 0
hi,
I need to know how too make a redirection to another page is the &_POST['secure']; does not have the value 459385643928542.
I need this for my registration form.

EDIT: i think its &_POST im not sure

Last edited by NextToNothing; 10-14-2009 at 05:39 PM..
NextToNothing is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 10-14-2009, 05:39 PM Re: Redirection if &_post is not the same value
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Duh...
PHP Code:
if(isset($_POST['secure'] && $_POST['secure']=='459385643928542'){
  
header('location:/anotherPage.php');
  exit();

__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-14-2009, 05:40 PM Re: Redirection if &_POST is not the same value
Average Talker

Posts: 22
Trades: 0
Wow! that was quick!
and im new too PHP thats why i asked
NextToNothing is offline
Reply With Quote
View Public Profile
 
Old 10-14-2009, 06:46 PM Re: Redirection if &_POST is not the same value
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
No problem, we all started at a moment.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-14-2009, 07:48 PM Re: Redirection if &_POST is not the same value
lizciz's Avatar
Ultra Talker

Posts: 330
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Uhm, do you want to redirect if 'secure' equals 459385643928542, or if 'secure' does not equal 459385643928542?

With tripy's code you will redirect if 'secure' equals 459385643928542. If it should be the other way around, change the if() statement to

PHP Code:
if(!isset($_POST['secure'] || $_POST['secure'] != '459385643928542'){ 
__________________
596f75206d65616e20796f752063616e2061637475616c6c79 207265616420746869733f
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 10-14-2009, 08:06 PM Re: Redirection if &_POST is not the same value
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Sheesh...
I should consider sleeping more than 4 hours per night..

Thanks, Matthias.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-14-2009, 08:46 PM Re: Redirection if &_POST is not the same value
lizciz's Avatar
Ultra Talker

Posts: 330
Name: Mattias Nordahl
Location: Sweden
Trades: 0
Quote:
Originally Posted by tripy View Post
Sheesh...
I should consider sleeping more than 4 hours per night..

Thanks, Matthias.
4 hours per night!? If I slept 4 hours a day for some time, say a week, I wouldn't be able to get up at all. I need my 7-8 hours
__________________
596f75206d65616e20796f752063616e2061637475616c6c79 207265616420746869733f
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 10-14-2009, 09:12 PM Re: Redirection if &_POST is not the same value
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Mattias, wait until you have kids, and you'll see!
5 hours straight will be a lot.

Well, obviously, it's 2am, and I should not be there anymore.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-17-2009, 05:37 AM Re: Redirection if &_POST is not the same value
Average Talker

Posts: 22
Trades: 0
i get an error on the header line :S
Code:
Parse error: parse error, expecting `','' or `')''
NextToNothing is offline
Reply With Quote
View Public Profile
 
Old 10-17-2009, 06:29 AM Re: Redirection if &_POST is not the same value
lizciz's Avatar
Ultra Talker

Posts: 330
Name: Mattias Nordahl
Location: Sweden
Trades: 0
There's missing a ) by the isset() function.
PHP Code:
if(!isset($_POST['secure']) || $_POST['secure'] != '459385643928542'){
//                        ) here 
__________________
596f75206d65616e20796f752063616e2061637475616c6c79 207265616420746869733f

Last edited by lizciz; 10-17-2009 at 06:31 AM..
lizciz is online now
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Reply     « Reply to Redirection if &_POST is not the same value
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.13955 seconds with 13 queries