FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


adding parameters url





gueda
Hi, first I checked this site http://www.php.net/docs.php. I have some knowing in php, but I am not expert (I am trying to learn it by myself)

Let me explain what I need:

The site will have login (all parameters in SQL). I enter in the site and made the log in, for example, with the login "loginname".

1 - the site is (for example): anothersite.com/<login>/something

2 - when the person was logged will have some things with informations, like points and another things was hosted in another site, so that person need to see your things.

3 - so, the url, at begin is: "anothersite.com/<login>/something", when I log in, the url need to be: "anothersite.com/loginname/anything"

I don't know the name of that function in php. Is str_replace or urlencode? I never used some thing ilke this before, so I need to know the name to search for examples or tutorials.

thanks and sorry for the english and the bad explanation Shocked
jmraker
I guessing you're asking how to put a string in some text.

You can use. (where the $_POST['loginname'] contains the login name)
$url = 'anothersite.com/' . $_POST['loginname'] . '/something';
or
$url = "anothersite.com/{$_POST['loginname']}/something";

Use the first one as the 2nd one uses double quotes which are slightly slower because it has to look for variable names to replace. The {} are optional if the variable isn't an array
gueda
jmraker wrote:
I guessing you're asking how to put a string in some text.

You can use. (where the $_POST['loginname'] contains the login name)
$url = 'anothersite.com/' . $_POST['loginname'] . '/something';
or
$url = "anothersite.com/{$_POST['loginname']}/something";

Use the first one as the 2nd one uses double quotes which are slightly slower because it has to look for variable names to replace. The {} are optional if the variable isn't an array


ouch, thank very much jmraker. I don't knew I could use that away to put in url too. Surprised
I will try improve my site now Smile

EDIT: hey, everyone work here! Thank you very much
Related topics
adding url to google
How do you keep your machine cool?
Windows Tips&tricks!
Hacked by someone sql Injection
Invalid XHTML - Please help.
www.vocabulary.890m.com
Share This
Do you belong to a manipulative / destructive group?
URL Parameters PHP
Tutorial: Image Rollovers w/ Javascript
writing COM components in Perl
UBB Code / Smiley Parsing
Is this code safe, or not?
Database Privilege
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.