Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Redirecting to different pages from same button

php redirect

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 jasonalien

jasonalien

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 194 posts

Posted 01 February 2013 - 04:54 AM

Hi, on my webpage, there is an "ask question button".  I want my webpage to do this :

Case 1:

If the user is coming to the website for the first time and hits the button, he should go to "signup page", and he should go to "ask question" page after signing up.

Case 2:

And again if the user is coming to the website for the first time and clicks signup link, he should go to "signup page" and then he will go to "main page" after singing up.

 

I'm able to do Case 2, I'll appreciate if someone tells me how I can do Case 1.

Thanks.



It sent 3 times due to connnection problem, I didn't send it 3 times on purpose. I'm sorry



#2 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts

Posted 01 February 2013 - 05:08 AM

the button can work as the link, so there's no difference. either, you have a form with a submit button leading to the sign up form, or you have a normal button/image with a link or a onClick event.

 

after signing up, you just decide what page the user shall land on...


I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.


#3 jasonalien

jasonalien

    CC Addict

  • Advanced Member
  • PipPipPipPipPip
  • 194 posts

Posted 01 February 2013 - 05:18 AM

Thank you for the answer. But I don't know how to decide if the user came to signup page by clicking the signup link or clicking ask the question button.



#4 Orjan

Orjan

    CC Mentor

  • Moderator
  • 2918 posts

Posted 01 February 2013 - 05:46 AM

if you use a form and a submit button, you can set the form to method POST, and in the link, you use GET, so there you can separate them, by checking for a value in $_GET or $_POST


I'm a System developer at XLENT Consultant Group mainly working with SugarCRM.
Please DO NOT send mail or PM to me with programming questions, post them in the appropriate forum instead, where I and others can answer you.





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download