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
58
42
Other php-forum
show the direct link into href
I want to display link on the page. i am fetching the data(URL) from database,actually before that i
Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo
Filling gaps in dates
So i'm doing a query for sales data and my return array looks like this
('date' => '20
Code doesn't print what i wanted it too. Please help!
Hi there,
I wrote this code to mae it so that in the form before it that the user said their
PHP Thumbnail Creation
Ok so i use this function to create thumbnails:
Code: [Select]function createthumb($name,$fil
Do While statement
hi guys,
This may sound trivial but im new to php and as part of an assignmenti have to const
problem with refreshing
in my site, i have an index page, it has a main div. this main div's content is changing according t
building a function with multiple outputs
I want to build a function that has multiple outputs.
I know but am not to sure how I should
update post issues
I am trying to create an update to a post function, while the update does occur, the page routing an
Table trouble
i have been reading the forum for a few weeks and decided to join. i like the format and the advice