Jump to content

Recommended Posts

Hi

This should be pretty simple but I can't figure it out. 

 

I want to create and simple forward to different URL based on the user entry.

 

For example..

If they enter ABC in the box they go to www.11.com

if they enter ZXC in the box they go to www.22.com

if they enter CCC they go to www.33.com

If they enter anything else they get an error message.

 

Thanks for any help!!

 

 

Link to comment
https://forums.phpfreaks.com/topic/310440-simple-redirect-based-on-entry/
Share on other sites

So what have you tried?  It's much easier to help you when we see what the code currently looks like.  It could be something simple like a switch based upon the incoming value and a switch construct to execute the appropriate header() call but we can't tell unless see a bit more since your explanation wasn't completely clear, ie "create and simple forward".

17 hours ago, John44281 said:

If they enter ABC in the box they go to www.11.com

if they enter ZXC in the box they go to www.22.com

if they enter CCC they go to www.33.com

How about something altogether simpler and more user-friendly: 

<a href='www.11.com'>ABC</a>
<a href='www.22.com'>ZXC</a>
<a href='www.33.com'>CCC</a>

No need for "error messages" at all.

Only give the Users options for things that they're allowed to do. 

 

"What's the best way to prevent someone from shooting themselves in the foot?  Don't give them a gun in the first place!"

Regards, 
   Phill  W.

  • Like 1
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.