bobsmith20 Posted June 26, 2009 Share Posted June 26, 2009 Hi all, I think this is a fairly simple question I'm trying to make a referral based reward system for my PHP game. The idea is that on the signup page there are fields for the coords of the player, for example 1:1:1 What I want to do is allow users to give people a referral URL (e.g /signup.php?refx=1&refy=1&refz=1) This would fill in the fields with the values given in the URL. I've got a feeling I've seen how to do it somewhere before, but now I need it I can't find it! So any help would be appreciated (All I need to know is how to put the values in the URL into the fields - I've sorted out the reward to the coords in the fields) Link to comment https://forums.phpfreaks.com/topic/163746-solved-php-url-to-field/ Share on other sites More sharing options...
Tonic-_- Posted June 26, 2009 Share Posted June 26, 2009 You want to get the X Y and Z coordinates from the URL given for ref and put them into fields on the registration form? Well if you mean by what I think you could try this X Coords: <input type="text" name="x" value="<? $_GET['refx']; ?>" /> Y Coords: <input type="text" name="y" value="<? $_GET['refy']; ?>" /> Z Coords: <input type="text" name="z" value="<? $_GET['refz']; ?>" /> Idk if that'll fully work (little rusty) But it should do the job so long as they visit the signup url correctly. Link to comment https://forums.phpfreaks.com/topic/163746-solved-php-url-to-field/#findComment-864003 Share on other sites More sharing options...
Tonic-_- Posted June 26, 2009 Share Posted June 26, 2009 Actually my bad it'll go like this (tested it out of curiosity) X Coords: <input type="text" name="x" value="<? echo($_GET['refx']); ?>" /><br /> Y Coords: <input type="text" name="y" value="<? echo($_GET['refy']); ?>" /><br /> Z Coords: <input type="text" name="z" value="<? echo($_GET['refz']); ?>" /> If they visit the URL and it has refz, refy, refx filled in the URL it will print the values into the text fields Link to comment https://forums.phpfreaks.com/topic/163746-solved-php-url-to-field/#findComment-864006 Share on other sites More sharing options...
bobsmith20 Posted June 26, 2009 Author Share Posted June 26, 2009 Yep that works, thanks a lot! Link to comment https://forums.phpfreaks.com/topic/163746-solved-php-url-to-field/#findComment-864007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.