PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
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  
Old July 28th, 2004, 10:06 PM
Tiksiboy Tiksiboy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 Tiksiboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old July 29th, 2004, 02:45 AM
kode_monkey kode_monkey is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 367 kode_monkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 21 sec
Reputation Power: 6
Line 5 needs to be a string ie -

$query = "insert into people (users) values ($_POST['fullname'])";

Hope this helps,

-KM-

Reply With Quote
  #3  
Old July 29th, 2004, 10:01 AM
Tiksiboy Tiksiboy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 Tiksiboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old July 29th, 2004, 10:29 AM
Tiksiboy Tiksiboy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 5 Tiksiboy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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')");

?>


Reply With Quote
  #5  
Old July 29th, 2004, 10:30 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
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.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP Parse error pleae hrep!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway