Page 1 of 1

how do i solve this?? URGENT!

Posted: Fri Mar 12, 2004 9:53 am
by navarre
hi people!
here's the thing: i'm very ignorant regarding PHP and webdesign, but there was something in my webpage that i needed to change and i took a chance.

it went wrong.

now everytime i try to access the page all i get is this:

Parse error: parse error in /home/hiploja/public_html/loja/contact_us.php on line 18

and i didn't even touch line 18! (i think...)

could you please tell me what that is? i'll post the entire code if necessary... pleeeeease help me! :oops:

Posted: Fri Mar 12, 2004 9:55 am
by patrikG
you'd have to post some code. Otherwise it's like walking into the doctor's with a fried half-chicken and say: "Is there anything you can do to rescue the chicken?"

Re: how do i solve this?? URGENT!

Posted: Fri Mar 12, 2004 9:55 am
by TheBentinel.com
navarre wrote:hi people!
here's the thing: i'm very ignorant regarding PHP and webdesign, but there was something in my webpage that i needed to change and i took a chance.

it went wrong.

now everytime i try to access the page all i get is this:

Parse error: parse error in /home/hiploja/public_html/loja/contact_us.php on line 18

and i didn't even touch line 18! (i think...)

could you please tell me what that is? i'll post the entire code if necessary... pleeeeease help me! :oops:
Definitely post the code. "Parse error" is like "syntax error", it could be anything. (But they're usually pretty easy to nail down, too! So no worries!)

Posted: Fri Mar 12, 2004 9:59 am
by navarre
ok people, here goes.

this is the section where i deleted a few lines. the entire page of code is way too long so i'll just post this bit:


<tr>
<td class="main">
<strong>Loja:</strong><br>
Hipgnosis Informática<br>
Av. Marquês de Pombal nº8A, Loja A<br>
2410-152 Leiria<br><br>
<a href="/loja/images/mapa.jpg" target='_blank'>(clique aqui para ver um mapa com a localização)</a>
<br><br>
<strong>Telefone/Fax:</strong><br>
244 825824<br><br>
<strong>Email:</strong> <br>
Geral - <a href="mailto:info@hiploja.com">info@hiploja.com</a><br>
Webdesign - <a href="mailto:webdesign@hiploja.com">webdesign@hiploja.com</a><br><br>
<strong>Horários da Loja:</strong> <br>
Dias Úteis:<br>
&nbsp;&nbsp;&nbsp;Tarde - 13h00 às 19h30<br><br>
A loja encerra aos feriados e fim de semana. <br><br><br>
<strong>Pode também preencher o seguinte formulário:</strong><br><br>


i'm sorry if it's too much, but i hope you can spot whatever i did wrong...

Posted: Fri Mar 12, 2004 10:05 am
by TheBentinel.com
navarre wrote:the entire page of code is way too long
The "line 18" stuff is talking about the 18th line of PHP script. So we need to see the stuff between your <?php and ?> tags. Even if all you changed was the HTML, it's the PHP that's blowing up.

Grab that code and post it back and we'll see what's up.

Like I said, it really isn't likely to be too bad. Sometimes you just need another set of eyes to check it out.

Posted: Fri Mar 12, 2004 10:14 am
by navarre
well there are several of those tags throughout the page of code, so assuming that line 18 is counting from the very top of the page than here the whole code between the first of those tags that incorporates line 18:


<?php
/*
$Id: contact_us.php,v 1.39 2003/02/14 05:51:15 hpdl Exp $

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright (c) 2003 osCommerce

Released under the GNU General Public License
*/

require('includes/application_top.php');

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

$error = false;
if (isset($HTTP_GET_VARS['action']) &amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp; ($HTTP_GET_VARS['action'] == 'send')) {
if (tep_validate_email(trim($HTTP_POST_VARS['email']))) {
tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $HTTP_POST_VARS['enquiry'], $HTTP_POST_VARS['name'], $HTTP_POST_VARS['email']);
tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
} else {
$error = true;
}
}

$breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));
?>


i hope this is what you meant... if you want i'll post or send you the entire page through email.

Posted: Fri Mar 12, 2004 10:16 am
by Wayne

Code: Select all

if (isset($HTTP_GET_VARS&#1111;'action']) &amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp; ($HTTP_GET_VARS&#1111;'action'] == 'send')) &#123;
replace with

Code: Select all

if (isset($HTTP_GET_VARS&#1111;'action']) && ($HTTP_GET_VARS&#1111;'action'] == 'send')) &#123;

Posted: Fri Mar 12, 2004 10:19 am
by TheBentinel.com
navarre wrote: if (isset($HTTP_GET_VARS['action']) &amp;amp;amp;amp;amp;amp;&amp;amp;amp;amp;amp;amp; ($HTTP_GET_VARS['action'] == 'send')) {
All that "amp" stuff looks suspicious. I think it should all be replaced with &&, like:

Code: Select all

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send')) {
Whatever editor you used to change the HTML probably munged that up. And sadly, && is a pretty common operator. (It means "AND") You'll want to dig through your code and fix all the stuff like this.

Honestly though, a better option would be to go back to the version before the change, assuming you still have a copy lying around. Then when you do editing next time, use a text editor like Notepad instead of Frontpage or whatever you were using.

Posted: Fri Mar 12, 2004 10:29 am
by navarre
guys it worked!!! :D

i did like you guys said and deleted all that amp stuff a little below also and now the page displays correctly! :D

thank you very very much!

in case you'd like to see what the fuss was about here's the link to the above mentioned page:

http://www.hiploja.com//loja/contact_us.php