Jump to content

Archived

This topic is now archived and is closed to further replies.

igi_smalls

Help With Website

Recommended Posts

I am creating a website and I need the users to type in a special code, but each user will have a different code. I would like to know how can I make it, in php, that when the users type in the code, it takes them to their unique website. each user will have a different code and a different website that they will be pointed to when their code is entered.

How can this be done ? Please help. Needed Quikly!!

[b]Mod Edit(shoz): Topic edited. Don't describe your problem as urgent etc. [a href=\"http://www.phpfreaks.com/forums/index.php?act=boardrules\" target=\"_blank\"]Board Guidelines[/a][/b]

Share this post


Link to post
Share on other sites
Create a MySQL table called CodeToSite with two columns, code, and site.

When you give someone a code, insert a row that links it to a site.

When they come to your site, look up the code in the table to find the site you should send them to.

Share this post


Link to post
Share on other sites
I'm sure your table will be more complex, but that's the general idea. You have to be sure that your code is unique across all users -- there are many ways to do this, but usually some combination of random and user info works well. Of course, you can always check your "new" code against the existing ones, and make sure it's not there; alternatively, put a UNIQUE index on this column and check for errors.

Share this post


Link to post
Share on other sites
Hmm.. interesting, i dont know what you guys are talking about lol I am what you would call an XNoob (Extreme Newbie). Is there anyway else to do this and if the code is short, can someone write it for me PLEASE?

This is basically it :

[ TEXT BOX ] [ go ]

Inside the text box the user would type in their code, how do I make it so that each code sends the user to a different site? is there any way to do this in plain old html but without the codes being seen in the source code ??

Share this post


Link to post
Share on other sites
You can do that part in vanilla HTML, but you're not going to be able to "hide" anything in HTML/JS, so a DB is your best option. It's a good excercise in basic PHP/MySQL, so you should definitely give it a shot.

Share this post


Link to post
Share on other sites

×

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.