Jump to content

variable inside header question


will35010

Recommended Posts

The org variable holds the value of the folder name. The problem is that the header is sending out ".$org." and not the actual value of $org.

 

Example output url: http://127.0.0.1/application/".$org."/display/trackingboard.php

 

I want this url if the value is test: http://127.0.0.1/application/test/display/trackingboard.php

 

Thanks!

 

$org = "test";
header('Location: ../application/".$org."/display/trackingboard.php');

Link to comment
https://forums.phpfreaks.com/topic/215807-variable-inside-header-question/
Share on other sites

header('Location: ../application/".$org."/display/trackingboard.php');

should read:

header('Location: ../application/'.$org.'/display/trackingboard.php');

 

Bah, Ginger beat me to it ;)

 

As a note though, you can easily tell when you run into this when you use a syntax highlighter.

The problem is that you've opened your string with single quotes and closed it with doubles. Try:

 

header('Location: ../application/'.$org.'/display/trackingboard.php');

 

Thanks! That was it. It's always the little things that get you...lol.

header('Location: ../application/".$org."/display/trackingboard.php');

should read:

header('Location: ../application/'.$org.'/display/trackingboard.php');

 

Bah, Ginger beat me to it ;)

 

As a note though, you can easily tell when you run into this when you use a syntax highlighter.

 

Thanks!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.