igi_smalls Posted February 9, 2006 Share Posted February 9, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/3362-help-with-website/ Share on other sites More sharing options...
wickning1 Posted February 9, 2006 Share Posted February 9, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/3362-help-with-website/#findComment-11501 Share on other sites More sharing options...
fenway Posted February 9, 2006 Share Posted February 9, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/3362-help-with-website/#findComment-11504 Share on other sites More sharing options...
igi_smalls Posted February 9, 2006 Author Share Posted February 9, 2006 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 ?? Quote Link to comment https://forums.phpfreaks.com/topic/3362-help-with-website/#findComment-11519 Share on other sites More sharing options...
fenway Posted February 10, 2006 Share Posted February 10, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/3362-help-with-website/#findComment-11531 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.