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
PHP, Arrays & A Lot Of Confusion
I've been doing basic PHP work on sites for a few years now, but I've never been tempted to learn how the ARRAY function worked, nor in what instances to use it. Now I've stumbled upon the jCarousel
Scheduler problems related to execution of a single BLT by many schedules
Hello all,
Upload file and add HTML
Hey everyone,I have a client has meeting agendas and minutes that should be posted online. I could teach someone how to FTP it onto the site, but I thought PHP would allow for a cooler solution. Here
Downloading file (Headers)
I'm trying to make users download a file, but they must wait 60 seconds before it begins.But, I'm stuck - the file isn't downloading, and no error is being shown (I've enabled E_ALL error
Mysql error message
help me find out what this error message means:"Duplicate entry '0' for key 'PRIMARY'"the sql for it is Code: INSERT INTO accounts (firstname, lastname, username, password, joined, email,
login to other site by sending post variables
hey,here is my problem: my school gave me a mail account for school-stuff use. they mail us importent information like changes to the timetable. now this stupid mail account oanly has a web interface.
ALV sum various columns problem
Hi all,
PHP Function Page Advice
Hi All, I am quite new to PHP and Javascript but have written an Online Shop (Mainly for Fun and education) It uses MySQL for the Shop Item Data and a 'Username.txt' file for each users cart.
change text color with a jQuery code
Hihow can I change the text in a asp:TextBox to a different color when I start typing using jQuery?I have this htmlview plaincopy to clipboardprint?<ol> <li> <asp:TextBox
how to get values from $_Post with onchange="form.submit();"?
Hi, I have a form that submit to itself with a file upload field and two other hidden field values.If I put a submit button on the page, all is working fine.I don't like the submit button as its