coder9 Posted July 18, 2008 Share Posted July 18, 2008 Hello, I have this variable below. $view= jp; now i want this variable to insert it inside this path below. $jp_dir= 'http://' . $_SERVER['HTTP_HOST'] . '?view=.{$view}.'; unfortunately my trial is wrong. anyone knows how to insert the $view the right way? thanks Quote Link to comment Share on other sites More sharing options...
Xurion Posted July 18, 2008 Share Posted July 18, 2008 The correct version of your code would be: $view= 'jp'; $jp_dir= 'http://'.$_SERVER['HTTP_HOST'].'?view='.$view; If you're on localhost, this would set the $jp_dir variable to http://localhost?view=jp You probably want the following code instead: $view= 'jp'; $jp_dir= 'http://'.$_SERVER['HTTP_HOST'].'/?view='.$view; This puts in the needed forward slash. Quote Link to comment 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.