Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: php code problem  (Read 3086 times)

0 Members and 1 Guest are viewing this topic.

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
php code problem
« on: June 16, 2007, 11:11:54 pm »

I'm trying to do a custom google map thing where users can enter some details in a form, this is then uploaded to a Mysql database. This is for a little google map thing I'm doing to show more details about the coppermine photo they have upload which can then link from the map to the photo.

I had the code working well but suddenly it seemed to go wrong and now I have been staring at it for ages and my eyes are going wonky.

it returns the error

Parse error: parse error, unexpected ';' in /data/members/paid/w/i/windsurf.me.uk/htdocs/www/usermap.php on line 42

here is the code

Code: [Select]
<?php
$link 
mysql_connect("localhost""********""********") or die("Could not connect: " mysql_error());
mysql_selectdb("windsurf_me_uk_4",$link) or die ("Can\'t use dbmapserver : " mysql_error());

$result mysql_query("SELECT * FROM locations",$link);
if (!
$result)
{
echo 
"no results ";
}
while(
$row mysql_fetch_array($result))
{
echo 
"var point = new GLatLng(" $row['field_10'] . "," $row['field_9'] . ");\n";
echo 
"var marker = createMarker(point, '" addslashes($row['field_2'] . "<br />" $row['field_3'] . "<br />" $row['field_4'] . "<br />" $row['field_4'] . "<br />" $row['field_6'] . "<br />" $row['field_7'] . "<br />" $row['field_8'] . " <br /><a href=\"" $row['field_11'] . "\">" $row['field_11'] . "</a><br/>" $row['field_12'] . "<br />');\n";
echo 
"map.addOverlay(marker);\n";
echo 
"\n";
}

mysql_close($link);
?>

line 42 is the echo "var marker line.

Can any of you see what is going on here?

[Edited by Sami]:
Mysql Username/password Removed as requested
« Last Edit: June 17, 2007, 12:05:28 am by Sami »
Logged
It is a mistake to think you can solve any major problems just with potatoes.

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: php code problem
« Reply #1 on: June 16, 2007, 11:13:41 pm »

Could someone edit out the mysql password in my previous post too?
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: php code problem
« Reply #2 on: June 16, 2007, 11:33:29 pm »

there is a missing ) here :
Code: [Select]
addslashes($row['field_2']
:)
Logged
‍I don't answer to PM with support question
Please post your issue to related board

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: php code problem
« Reply #3 on: June 17, 2007, 12:00:35 am »

Cheers Sami (on both counts)

I've just got to suss out cpmfetch now and rewrite the form (using the excellent phpformgen http://phpformgen.sourceforge.net, saves all that nasty coding of forms and it's free) and I should be good to go with the finish thing. I'll post it on this site when it's finished.
Logged
It is a mistake to think you can solve any major problems just with potatoes.

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: php code problem
« Reply #4 on: June 17, 2007, 12:07:17 am »

good luck phill :)
Logged
‍I don't answer to PM with support question
Please post your issue to related board
Pages: [1]   Go Up
 

Page created in 0.019 seconds with 20 queries.