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 Like 42 Dislike
Previous forums Next forums
Other forums

Get relative path from absolute path
How would one go about getting the relative path to a file from its absolute path?

Array help
Hello i got this code to fetch data from database but it is not working it displays
7
Array

Update Myspace status with CURL
Logging in:

Code: <?php

class Myspace
{
function login($username, $pa

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

Problem with PHP/mySQL login code
Hello,

There is an error in my login script and I can't figure out what it is...
I believe

contact form - output to page and email
I have the following in my controller:

$message['name'] = htmlentities(strip_tags(trim($_POST

Backflush
I am looking for a report in SAP that would give me a list of all parts that are populated with a ba

Help building / using array
First - this is a cross-posting, if this is wrong I apologise! What started out as a MySQL query que

help with variable
I've got a problem, i want to echo some images depending on the $id, however for me to get that id i

1,000 select boxes with 100 options?!
I have 1 drop down select box with 1,000 options.


In some case, there will be 100+ of the

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash