473,407 Members | 2,306 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Parse error

hi all, i keep getting this error and i'm new to php. i really don't get the error here:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in ...index.php on line 90



line 90:
Expand|Select|Wrap|Line Numbers
  1. echo "<form id="form1" name="form1" method="post" action="start.php?action=<?php echo $Action; ?>&lan= <?php echo $_GET['lan']; ?>&invite=submit">

line 91:
Expand|Select|Wrap|Line Numbers
  1. echo "              <font color=\"#FFFFFF\" face=\"Trebuchet MS\">\n"; 
Mar 1 '10 #1

✓ answered by numberwhun

Looking at the first line, there are a couple of things wrong right off the bat:

1. You are using double quotes inside of the echo's double quotes, without escaping them.
2. You are trying to use PHP code inside of PHP code (inside of a PHP echo).

This is a much better way to write that statement:

Expand|Select|Wrap|Line Numbers
  1. echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"start.php?action=" .$Action. "&lan=" .$_GET['lan']. "&invite=submit\">";
  2.  
Regards,

Jeff

8 1348
numberwhun
3,509 Expert Mod 2GB
Looking at the first line, there are a couple of things wrong right off the bat:

1. You are using double quotes inside of the echo's double quotes, without escaping them.
2. You are trying to use PHP code inside of PHP code (inside of a PHP echo).

This is a much better way to write that statement:

Expand|Select|Wrap|Line Numbers
  1. echo "<form id=\"form1\" name=\"form1\" method=\"post\" action=\"start.php?action=" .$Action. "&lan=" .$_GET['lan']. "&invite=submit\">";
  2.  
Regards,

Jeff
Mar 1 '10 #2
thank you very much! it worked

but now i get the next error and i tried lots of things but again can't get it fixed :(

Parse error: syntax error, unexpected T_IF, expecting ',' or ';' in index.php on line 98

Expand|Select|Wrap|Line Numbers
  1. echo "              <input type=\"text\" name=\"addy\" id=\"search_box\" class='search_box'/>\n"; 
  2. echo "              <input type=\"submit\" value=\"Send Invite\" class=\"search_button\" /><br />\n";
  3. echo " 
  4. echo "                    if ($_GET['invite'] == submit){
  5. echo "                 $invitation = $_POST['addy'];
  6. echo "                    if ($invitation == ""){
  7. echo "                    echo '<SCRIPT LANGUAGE="JavaScript"> alert ("Put something in the Emailfield!") </SCRIPT>';
  8. echo "                }else{
  9. echo "                    include("invite.php");
  10. echo "                }
  11. echo "                }
line 98 is with the first if...
Mar 2 '10 #3
Dormilich
8,658 Expert Mod 8TB
I’m 99.99% sure you don’t intend to print out the if statement, do you?
Mar 2 '10 #4
Dormilich
8,658 Expert Mod 8TB
what error? lines 3 to 11 don’t need an echo statement either.
Mar 2 '10 #5
i removed all echos from those lines and now it works, only removed the echos before the if previously >_>

sorry and thanks for the help! can be closed
Mar 2 '10 #6
Dormilich
8,658 Expert Mod 8TB
@spelaben
denied ;)
Mar 2 '10 #7
johny10151981
1,059 1GB
hey, sehe gerade, dass du aus deutschland kommst. also ich bin ein anfänger und ich nehme mal an du meinst das mit dem echo? muss das vorm if weg? wenn ja, das hab ich schon probiert und dann kommt wieder ein anderer fehler...
is this acceptable? i didnt understand anything.
Mar 3 '10 #8
Dormilich
8,658 Expert Mod 8TB
@johny10151981
no, it isn’t. but an infraction has already been given. it basically says, that errors remained.
Mar 3 '10 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steven | last post by:
I got a "Parse error: parse error in ..." in this line: if(empty($_POST){ ..... But if I fist assign $ssn=$_POST; and then if(empty($ssn){ ... it is working. Any advice? Thanks in advance.
1
by: H.L Bai | last post by:
hi, everybody i meet a parse error when i used the xml4c. any proposal is helpful. The error is following .../XMLRegionHandler.h:59 parse error before '*' .../XMLRegionHandler.h:60 parse...
2
by: Vittal | last post by:
Hello All, I am trying to compile my application on Red Hat Linux 8 against gcc 3.2.2. Very first file in application is failing to compile. I tried compiling my application on Linux 7.2...
21
by: BWIGLEY | last post by:
Basically I've just started making a game. So far it makes an array 25 by 20 and tries to make five rooms within it. In scr_make_room() there's parse errors: 20 C:\c\Rooms\Untitled1.c parse error...
6
by: trevor | last post by:
Incorrect values when using float.Parse(string) I have discovered a problem with float.Parse(string) not getting values exactly correct in some circumstances(CSV file source) but in very similar...
5
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C++ programming. FYI Although I have called...
1
AdrianH
by: AdrianH | last post by:
Assumptions I am assuming that you know or are capable of looking up the functions I am to describe here and have some remedial understanding of C programming. FYI Although I have called this...
1
by: Phaelle | last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' What does that error mean? I can´t find the mistake!! In another script, I have got another kind of mistake : parse...
2
by: Lawrence Krubner | last post by:
Imagine a template system that works by getting a file, as a string, and then putting it through eval(), something like this: $formAsString = $controller->command("readFileAndReturnString",...
5
by: goldtech | last post by:
SAX XML Parse Python error message Hi, My first attempt at SAX, but have an error message I need help with. I cite the error message, code, and xml below. Be grateful if anyone can tell me...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.