error help - Dynamic Image
Posted on
16th Feb 2014 07:03 pm by
admin
I've been working on making my site less cluttered in the directories and more secure lately. In an attempt to prevent bandwidth theft from other people using images, I decided to switch all my site images to a dynamic image file. I've written a small test code to iron out as many bugs as I can BEFORE I impliment it fully.
Code:
Code: <?php
if ($_SESSION['i'] != "yes"}
{
$im = "theft";
}
else
{
$im = $_GET['i'];
}
switch($im)
{
case 'theft":
$image = imageCreateFromJPG('/theft.jpg');
break;
case 'logo':
$image = imageCreateFromJPG('/logo.jpg');
break;
}
imageJPG($image);
imageDestroy($image);
?>
When using it in the test copy of my site's index page (calling for the logo image) it works fine.
When I try opening the page (with the GET['i'] set to logo, theft, and not set at all), I get the following error:
QuoteParse error: syntax error, unexpected T_IF in /home/ck9/public_html/media/images/site.php on line 3
I tried setting the current If...else as a long comment and re-writting it another way, but that didn't fix the issue. I tried looking up the error in the PHP manual, but the information presented wasn't helpful to me.
Thanks in advance for any help you guys can provide (and the help here has always been great
No comments posted yet
Your Answer:
Login to answer
58
42
Other forums
Ariba 9r - SAP MM Integration
Hi experts,
The standard Ariba adapter for 9r creates a relationship between Cost Centers
How to limit the calls to an API
Hello, in my simple script I call an api which effectively involves me getting an xml file.
H
Mouseover to edit (Ajax)
hi friends, can anyone help with the code behind to get this application working, please in VB (new
need help modifying script
Hi guys,
I'm fairly new to php and am having a bit of trouble modifying a script.
This
New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understan
firefox wouldnt stream mp3 files completely from my php page
hi everyone,
I have a php file trying to read and stream mp3 files. It works fine in IE but my pr
Undefined Variable: PHP_SELF, pls help
Hi,
Im a newbie on PHP / MySQL programming and Im running a script to search one field on my
Credit card verification
I have a client who wants to process credit card transactions from his web site rather than the goin
What's best way to get a user's Word doc converted to simple html and images?
Hi all,
I was just wondering if anybody has any experience of this.
Basically, I'm buildin
try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called