no idea what to do...
Posted on
16th Feb 2014 07:03 pm by
admin
I'm fed up. I had issues with code that I have working on a different site that didn't work on my current site. I found a way to fix that but now I'm running into the same error on another page that I can't think of a way around:
'Parse error: syntax error, unexpected T_VARIABLE, expecting ']' in /my/path/to/file on line 75'
Here's the original code: (ine 75 is the line with the link in it.)
Code: <?php
$adquery = "SELECT * FROM ad_space WHERE id=1";
$adresult = mysql_query($adquery);
$adrow = mysql_fetch_assoc($adresult);
for($i=1;$i<6;$i++){
if($row['link'.$i] == '') {
$row['link'.$i] = '#';
}
echo "<a href="$row[link$i]" target="_blank"><img src="$row[image$i]" alt="$i" /></a>";
}
?>
I changed it to this hoping it would work but it didnt, values are blank.
Code: <?php
$adquery = "SELECT * FROM ad_space WHERE id=1";
$adresult = mysql_query($adquery);
$adrow = mysql_fetch_assoc($adresult);
for($i=1;$i<6;$i++){
$var = "link".$i;
$var2 = "image".$i;
if($row['link'.$i] == '') {
$row['link'.$i] = '#';
}
echo "<a href="$row[$var]" target="_blank"><img src="$row[$var2]" alt="$i" /></a>";
}
?>
As always, any help is appreciated.
Thanks,
No comments posted yet
Your Answer:
Login to answer
329
40
Other forums
question about header() security
is is safe to just use the header() function to redirect someone if they are, say, not logged in? or
Need help urgant
why down my code ony return one item instead of all the items selected.
$arr = array($date,$
How to secure my login data to my database?
Hi there,
It may be a stupid question but I don't know how to secure my login data to my data
Data type mismatch
Hi,
I am migrating data from algol to c.I mapped real datatype in algol to double datatype in
Help with captcha script needed
Hello,
I am working on a script where reCAPTCHA or a similar form of CAPTCHA will be used, f
To change the name of label on SAP screen XK02.
Hi All,
Can one suggest me how to change the label of an input field of a sap standard s
CURL question
i am wondering if it's possible to use multi curl with login something like
login once to web
rename the file
File.txt
Code: ***DOCUMENT***
..DN:
000044255
..CB:
..SN:
..PY:
2009
..E
PHP Captcha Error help - replace the "die" command
Hi All,
I am after a bit of help with a Captcha spam protection box.
The site gave me
Procedural to OOP
John Kleijn said that to avoid writing "crappy code", we should learn OOP and common OO pr