|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
PHP Parse error pleae hrep!!!
i get this problem
Parse error: parse error, unexpected T_STRING in C:\XITAMI\webpages\action2.php on line 5 here's the script <?php $conn = mysql_connect("localhost","root"); mysql_select_db("mydb"); $query = insert into people (users) values ($_POST['fullname']); if (mysql_query($query)) echo " "; else echo 'Failed'; } ?> <?php $name2 = $_POST['name']; if($_POST['name']=='Roman') echo "Hi Roman"; if($_POST['name']=='Larisa') echo "Hi Larisa"; if($_POST['name']=='Mark') echo "Hi Mark"; if($_POST['name']!='Mark'and $_POST['name']!='Roman' and$_POST['name']!='Larisa') echo "hi $name2 you are not reconized"; ?> please help |
|
#2
|
|||
|
|||
|
Line 5 needs to be a string ie -
$query = "insert into people (users) values ($_POST['fullname'])"; Hope this helps, -KM- |
|
#3
|
|||
|
|||
|
no now i get this message
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in C:\XITAMI\webpages\action2.php on line 5 |
|
#4
|
|||
|
|||
|
I fixed it
<?php $name2= $_POST['fullname']; if($_POST['fullname']=='Roman') echo "Hi Roman"; if($_POST['fullname']=='Larisa') echo "Hi Larisa"; if($_POST['fullname']=='Mark') echo "Hi Mark"; if($_POST['fullname']!='Mark'and $_POST['fullname']!='Roman' and $_POST['fullname']!='Larisa') echo "hi $name2 you are not reconized"; If(isset($_POST['submit'])) $conn=mysql_connect("localhost","root"); mysql_select_db("mydb"); $query=mysql_query("insert into people (users) values ('$name2')"); ?> |
|
#5
|
||||
|
||||
|
Tiksiboy, if you just wrap PHP tags around your code, the indenting and coloring will be handled for you automatically. Just for future reference. The tags should be the letters PHP wrapped in square brackets. As in HTML, the second tag should be /PHP in square brackets.
__________________
Please don't PM me asking for solutions outside the scope of a thread. Keeping all responses in a thread stands to help others who come along later, which is after all what this forum's all about. |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > PHP Parse error pleae hrep!!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|