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,
Sharing PHP Sessions Across Domains
I am in the process of writing a script to share a php session across various domains I have.The problem I have, is getting php to access the php session. It gives me a persmission error. It seems the
Multipe Dynamic Controls & AutoPostback Issue
I currently have a need to create many dynamic controls (Example Textboxes) that need to do a PostBack upon the data in the control changing (Autopostback = true). The following sample code
How to extract/download content from HTTPS page?
Hello to all the Members of this forum, Im Shoiab, A novice programmer in php.. for my first job I have been recently assigned a project, in which I have got to extract/download the contents of the
compile php5 with DOM
Hi,I can't manage to compile php 5.3.0 from source on Windows to include DOM,in spite of the documentation saying that DOM is built into PHP5.I'm compiling php 5.3.0 using the following minimalistic
Line break?
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here it goes. I've created a page with multiple forms that when submitted get emailed to a certain
how to load a Sys file with system load and call images?
normally you need register the module as a service with CreateService, and start the service
Create comparison matrix?
I want to create a comparison script for forum software and was wondering is there any tutorial or basic script anyone can give me?
Navigation include for all site directories
Hi,I need a navigation include that can deal with directories at different levels on a site. All I can seem to find are the basic includes for files all in the same directory. This doesn't work for me
Query output more than expected
$query=mysql_query("SELECT * FROM players, communities, divisions WHERE dob BETWEEN '{$start_date}' AND '{$end_date}' and communities.id=players.community order by communities.community,
Google voice
I currently have a form in html, but I want it in php so the information is not in the source code.It all works and when you put in the name and number it will call. When you push the call button it