![]() |
|
|
| Subject:
PHP Script Problem
Category: Computers > Internet Asked by: newsguy-ga List Price: $20.00 |
Posted:
02 Jan 2004 08:10 PST
Expires: 01 Feb 2004 08:10 PST Question ID: 292370 |
I'm having problems with a simple PHP script located at http://www.setstudio.com/iframe/iframe.php?url=http://www.setstudio.com/images/sets/wbre_1.jpg. The script is supposed to take the URL that appears after the ?url= part of the main URL and display the file (in this case an image) in the iframe. However, since I moved to a new server, it does not do this correctly. I have two versions of this script and neither works on my Unix server. If you can help, I will provide you with the source code, list of PHP requirements and FTP access. | |
| |
|
|
| Subject:
Re: PHP Script Problem
Answered By: joseleon-ga on 04 Jan 2004 06:47 PST Rated: ![]() |
Hello, newsguy: Your script works ok, the problem is in the PHP version you are using, it's too old, you are using 4.0.6 while the global array $_GET was introduced in version 4.1.0, please, check out this page for more info: HTTP GET variables: $_GET http://es.php.net/manual/en/reserved.variables.php#reserved.variables.get To make work your script you just need to change this line: $iframe_src = $_GET["url"]; To this one: $iframe_src = $HTTP_GET_VARS["url"]; And it should work, in any case, don't hesitate to request for any clarification, I'm here to help you until this script works. Regards. |
newsguy-ga
rated this answer:
Excellent help. Thank you! |
|
| Subject:
Re: PHP Script Problem
From: liloa-ga on 03 Jan 2004 18:17 PST |
newguy:
You should the following corrections to have you script run properly:
1) update the if statement in the opening PHP section with the folowing:
if(trim($iframe_src) == "") {
$iframe_src = "\"http://www.setstudio.com/iframe/blank.htm\"";
}
2) replace the second php section with the following:
<iframe name="I1" width="525" height="464" marginwidth="1"
marginheight="1" scrolling="yes" src=<?php echo "$iframe_src"; ?>>
Your browser does not support inline frames or is currently configured
not to display inline frames.</iframe>
Let me know how that works for you ...
Best,
Nick |
| Subject:
Re: PHP Script Problem
From: newsguy-ga on 04 Jan 2004 05:32 PST |
liloa-ga:
Nope I get: Parse error: parse error in
/usr/local/www/vhosts/setstudio.com/htdocs/iframe/iframe.php on line
10
Note that my server is only running PHP Version 4.0.6
Below is the revised code for your review (maybe I did something wrong:)
<?php
$iframe_src = $_GET["url"];
if(trim($iframe_src) == "") {
$iframe_src = "\"http://www.setstudio.com/iframe/blank.htm\"";
}
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>SetStudio SetViewer</title>
</head>
<body bgcolor="#666666" link="#006600" vlink="#006600" alink="#00CC00">
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="100%"
id="AutoNumber1" height="100%">
<tr>
<td width="100%">
<div align="center">
<center>
<table border="0" cellpadding="0" cellspacing="0"
style="border-collapse: collapse" bordercolor="#111111" width="750"
id="AutoNumber2">
<tr>
<td width="750" colspan="2"><script language="javascript">
var AdLoaded = false;
var bsid = '19112';
var bsads = '6';
var bsloc = 'Top';
var bswx = 468;
var bshx = 60;
var bsw = '_top';
var bsb = '666666';
var bsf = 'FFFFFF';
var bsalt = 'on';
bspop = 1;
</script>
<script language="javascript" src="http://www6.bannerspace.com/js/getad.js">
</script>
<script language="javascript">
if (AdLoaded) {ShowAd();}
</script>
<noscript>
<IFRAME name="bsadframe" ID="bsadframe" WIDTH=468 HEIGHT=78
SCROLLING="no" FRAMEBORDER="0" FRAMESPACING="0" MARGINHEIGHT="0"
MARGINWIDTH="0" BORDER="0" HSPACE="0" VSPACE="0" ALIGN="center"
SRC="http://www6.bannerspace.com/asp/getban_html.asp?MID=19112&alt=on&f=FFFFFF&b=666666&w=_top&loc=Top&s=468x60&pop=1">
<a href="http://www6.bannerspace.com/asp/gosite.asp?MID=19112&loc=Top"
target=_top><img src="http://www6.bannerspace.com/asp/getban.asp?MID=19112&s=468x60&loc=Top"
width=468 height=60 border=0></a>
</IFRAME></noscript></td>
</tr>
<tr>
<td width="750" colspan="2">
<p align="center">
<img border="0"
src="http://www.setstudio.com/images/blank.gif" width="10"
height="10"><br>
<font color="#FFFFFF">
<img border="0"
src="http://www.setstudio.com/images/global/set_viewer_top.gif"
width="276" height="32"><br>
</font><font face="Verdana" size="1">
<a href="javascript:history.back()"><font color="#FFFFFF">Go
back</font></a><font color="#FFFFFF">
| </font><a
href="http://www.setstudio.com/setsby/station"><font
color="#FFFFFF">Sets by
Station</font></a><font color="#FFFFFF"> | </font>
<a href="http://www.setstudio.com/setsby/market"><font
color="#FFFFFF">Sets by Market</font></a><font color="#FFFFFF">
| </font><a
href="http://www.setstudio.com/setsby/designer"><font
color="#FFFFFF">Sets by
Designer</font></a></font><br>
<img border="0"
src="http://www.setstudio.com/images/blank.gif" width="1"
height="10"></td>
</tr>
<tr>
<td width="73" valign="top">
<p align="left">
<script type="text/javascript"><!--
google_ad_client = "pub-1783161409882964";
google_ad_width = 120;
google_ad_height = 600;
google_ad_format = "120x600_as";
google_color_border = "00CF00";
google_color_bg = "FFFFFF";
google_color_link = "006600";
google_color_url = "999999";
google_color_text = "000000";
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</td>
<td width="677" valign="top">
<p align="center">
<iframe name="I1" width="525" height="464" marginwidth="1"
marginheight="1" scrolling="yes" src=<?php echo "$iframe_src"; ?>>
Your browser does not support inline frames or is currently configured
not to display inline frames.</iframe>
<br>
<br>
<font face="Verdana" size="1" color="#FFFFFF">Site Copyright
2003 Clearhill. All rights reserved.<br>
SetStudio and related marks are trademarks of Clearhill. <br>
SetViewer and related marks are service marks of Clearhill.<br>
Some content copyrighted by third parties. No infringement intended.
<a href="http://www.setstudio.com/misc/disclaimer"><font
color="#FFFFFF">Copyright disclaimer</font></a>.</font><p
align="center">
<font face="Verdana" size="1" color="#FFFFFF"><!-- Start
Bravenet.com Service Code -->
<script language="JavaScript" type="text/javascript"
src="http://pub33.bravenet.com/counter/code.php?id=374294&usernum=2823903246&cpv=2"></script>
<!-- End Bravenet.com Service Code --></font></td>
</tr>
<tr>
<td width="750" valign="top" colspan="2">
<p align="center"><font face="Verdana" color="#666666" size="1">
television news, news sets, set design</font></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</body>
</html> |
| Subject:
Re: PHP Script Problem
From: liloa-ga on 04 Jan 2004 15:56 PST |
newsguy: you're missing the ?> the goes before the <html> tag. this is the reason your receiving an error. Nick |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |