PDA

View Full Version : Adding PHP Code



bbullock
07-27-2009, 07:58 PM
How do I get the following PHP code to show when I publish?


<?php
$SID="364d8dc3-af06-4bb5-acce-b1ac9641df93";
$IPAddress = urlencode($_SERVER['REMOTE_ADDR']);
$UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);
$Host=urlencode($_SERVER['HTTP_HOST']);
$PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']);
$URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID;
$URL=$URL.'&Host='.$Host;
$URL = $URL.'&PageURL='.$PageURL;
$URL = $URL.'&IPAddress='.$IPAddress;
$URL = $URL.'&UserAgent='.$UserAgent;
include($URL);
?>

I've tried the following

* Inserting the PHP code into a html box
* file extension is set to php
* increasing the size of the html box

Karen Mac
07-27-2009, 09:04 PM
right click on the page and chose page properties and change it to php instead of html

Karen

travlinman
07-27-2009, 10:54 PM
out of curiosity what is the script for?

Watdaflip
07-28-2009, 04:20 AM
out of curiosity what is the script for?

By the looks of it some type of 3rd party stats software.

navaldesign
07-28-2009, 06:35 AM
But I doubt you can include a URL in a VH account. The URL wrappers are disabled in most cases for security reasons.

bbullock
07-30-2009, 02:02 AM
The php code is for an affiliate product feed thru GoldenCan

bbullock
07-30-2009, 02:04 AM
I have tried changing the page properties to php under General/file extension

Watdaflip
07-31-2009, 05:27 AM
I have tried changing the page properties to php under General/file extension

And what is happening when you publish the page and load it in your browser? Is it giving an error of some sort?

bbullock
08-13-2009, 03:17 AM
the page is blank

Watdaflip
08-13-2009, 03:19 AM
Try this code and let me know what happens

<?php
error_reporting(E_ALL);
$SID="364d8dc3-af06-4bb5-acce-b1ac9641df93";
$IPAddress = urlencode($_SERVER['REMOTE_ADDR']);
$UserAgent = urlencode($_SERVER['HTTP_USER_AGENT']);
$Host=urlencode($_SERVER['HTTP_HOST']);
$PageURL=urlencode($_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING']);
$URL="http://si.goldencan.com/GetData.aspx?ver=2.0&SID=".$SID;
$URL=$URL.'&Host='.$Host;
$URL = $URL.'&PageURL='.$PageURL;
$URL = $URL.'&IPAddress='.$IPAddress;
$URL = $URL.'&UserAgent='.$UserAgent;
include($URL);
?>

bbullock
08-13-2009, 03:27 AM
go to http://www.thecoupondad.com/internetcouponsphp.php

Watdaflip
08-13-2009, 03:38 AM
Hmm, all of the page html is not being transfered, it stops at an opening <div> tag, I assume where the php code was inserted.

Try just uploading a php file with only the code in it. That is not just adding it to a BV file and publishing, just use notepad or something, copy and paste the code into it, save as a .php, and upload that file.

Karen Mac
08-13-2009, 03:54 AM
But I doubt you can include a URL in a VH account. The URL wrappers are disabled in most cases for security reasons.


Please re read NAVALS post.. most likely this is disabled and will not happen on voda servers.

Karen

Watdaflip
08-13-2009, 04:57 AM
It should still be displaying some sort of error or notice saying that it is disabled. Just trying to find out the symptoms in order to diagnose the problem.