jacobred Posted July 10, 2009 Share Posted July 10, 2009 Hello there , I am an Admin of a vBulletin board, and I never seem to get any support on the official site So, What I want is a command.PHP sort of script. We are a Habbo based forum, and what I want is a custom profile field (I know how to do that) which once the user enters a bit of text, it put it into a specific area of a URL Ill show you The url to start with, should hopefully be something like http://www.habbo.co.uk/habbo-imaging/avatarimage?user=[**THE BiT WHERE WE WANT THE TEXT TO BE PLACED**]&action=wav&direction=3000003&head_direction=2999995&gesture=sml&size=s So, the user puts sburns1992 into that field and it would make that url look like this http://www.habbo.co.uk/habbo-imaging/avatarimage?user=sburns1992&action=wav&direction=3000003&head_direction=2999995&gesture=sml&size=s Any idea how to do that? Cheers Jake Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/ Share on other sites More sharing options...
elis Posted July 10, 2009 Share Posted July 10, 2009 <form action="yourpage.php" method="get"> User: <input type="text" name="user" /><br /> <input type="submit" value="Submit" /> </form> If I understood what you were after, correctly. Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-872932 Share on other sites More sharing options...
jacobred Posted July 10, 2009 Author Share Posted July 10, 2009 Right We have a Custom Profile Field set up on our forum for a Habbo name Now, upon registration the user is required to enter this, and once they do we hope we can make it show up on the users postbit I just need the PHP script for this operation, I want the outcome to be this... Once the new registered put his/her name, I want it to go like this say, Phpfreaks.com was the starting point, I want whatever is put in the profile field to appear like this phpfreaks.com/whateverisputhere Is that easier, Its not a form but for Custom Profiule Foelds Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-872934 Share on other sites More sharing options...
jacobred Posted July 10, 2009 Author Share Posted July 10, 2009 Bump much? Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873115 Share on other sites More sharing options...
jsschmitt Posted July 10, 2009 Share Posted July 10, 2009 If I go by your initial post... you just have to echo out the field in the database. ie. echo '<img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?user='.$_DB-FIELD-OF-IMAGE.'&action=wav&direction=3000003&head_direction=2999995&gesture=sml&size=s"/>'; Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873123 Share on other sites More sharing options...
jacobred Posted July 10, 2009 Author Share Posted July 10, 2009 If I go by your initial post... you just have to echo out the field in the database. ie. echo '<img src="http://www.habbo.co.uk/habbo-imaging/avatarimage?user='.$_DB-FIELD-OF-IMAGE.'&action=wav&direction=3000003&head_direction=2999995&gesture=sml&size=s"/>'; Right, We seem to be getting somewhere!! Now, How do I implement that into a vBulletin Custom Field..? I have tried putting it into the Regular Expression box, What does the '.$_DB-FIELD-OF-IMAGE.' mean? Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873203 Share on other sites More sharing options...
seventheyejosh Posted July 10, 2009 Share Posted July 10, 2009 it just means whatever field has the image info in ur DB like: $res=mysql_query("SELECT image_path FROM `table` WHERE `id`='1'"); $row=mysql_fetch_array($res); $image=$row[0]; $url="/index.php?image=$image"; Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873204 Share on other sites More sharing options...
jacobred Posted July 10, 2009 Author Share Posted July 10, 2009 it just means whatever field has the image info in ur DB like: $res=mysql_query("SELECT image_path FROM `table` WHERE `id`='1'"); $row=mysql_fetch_array($res); $image=$row[0]; $url="/index.php?image=$image"; Ok, but what we are trying to use is sourced externally :l What we basically want, is this! User registers Theres a field that says Name: user puts Jon So, now it generates a link http://www.phpfreaks.com/jon Jon being automatically added in to the end of the URL, But we want it like this http://www.habbo.co.uk/habbo-imaging/avatarimage?user=jon&action=wav&direction=3000003&head_direction=2999995&gesture=sml&size=s Does that make any sense? Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873209 Share on other sites More sharing options...
seventheyejosh Posted July 10, 2009 Share Posted July 10, 2009 where does the link go? does the link occur on the next page? or on that page? if it is on the next page, u can just create the link after you insert them into the DB $name=$_POST['name']; mysql_query("INSERT INTO users ('name') VALUES (`$name`)"); //then ur link $link="/index.php?name=$name&blah=blahetc"; else, if you are doing some sort of instant link without page submit, you can use javascript Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873213 Share on other sites More sharing options...
jacobred Posted July 10, 2009 Author Share Posted July 10, 2009 where does the link go? does the link occur on the next page? or on that page? if it is on the next page, u can just create the link after you insert them into the DB $name=$_POST['name']; mysql_query("INSERT INTO users ('name') VALUES (`$name`)"); //then ur link $link="/index.php?name=$name&blah=blahetc"; else, if you are doing some sort of instant link without page submit, you can use javascript This is a vBULLETIN custom profile field! I dont think I can accomplish here ;( Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873216 Share on other sites More sharing options...
seventheyejosh Posted July 10, 2009 Share Posted July 10, 2009 I dont understand where the user is 'putting' this information!? it looks like you just have the users' username in there.. why not just get the damn thing from the DB. What is it you're trying to accomplish? Do you want like custom profile url's like FB? or just a direct link to the profile!? I need a little more info than, the user can 'put' this in that. Quote Link to comment https://forums.phpfreaks.com/topic/165509-php-to-add-into-url/#findComment-873224 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.