Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing or Echo URL Variable

Status
Not open for further replies.

3dColor

Programmer
Jan 10, 2006
240
US
Hi, I am new to PHP.

I created a web site template in PHP for people to use:

Within the template I am pulling in rental listing info from my site (pickrent.com) and displaying it on a template on their server using an IFrame.

This is working just fine for example here:

However it is not working here:
(hopefully this link is still live.)

The error I am getting is:
"Error on Page: param: ad=%3C?%20print%20($_GET["

So for some reason the code I am using to pull in the "ad" parameter from the URL:
<? print ($_GET["ad"]); ?>
is not working on the mylifeplace.com site like it is on the other one.

The iframe of the ad is coming from this page:
which as you can see is done in Coldfusion.

Perhaps could there be differences between the two servers where the 'print' function does not work all the time? Should I be using echo instead?
 
This:

"Error on Page: param: ad=%3C?%20print%20($_GET["

Looks like a coldfusion error not PHP.
It looks like you are trying to execute PHP code in a coldfusion page, and coldfuision is not liking it.

Unless your server is set to parse files that end in CFM through the PHP interpreter, coldfusion will always balk at it.

You might also want to try the full PHP opening tag ([red]<?PHP[/red]) in case the short tags are messing with the coldfusion deal.





----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
For a full PHP opening - would it look like this:

<?php echo $_GET["ad"]; ?>

or

<?php print ($_GET["ad"]); ?>
 
<?php echo $_GET["ad"]; ?>

or

<?php print ($_GET["ad"]); ?>

Yes. Both should work.




----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top