Can you tell me what will happen to my code? This error indicates
Parse error: syntax error, unexpected T_STRING in C: \ xampp \ htdocs \ xampp \ dhiraj \ queryverify.php on line 12
Here is my code
& lt; Head & gt; & Lt; Style & gt; #margin_left {margin-left: 400px; Height: 400px;} #spanning {margin-left: 70px;} #spanning_gender {margin-left: 66px;} #spanning_marstatus {margin-left: 27px;} #spanning_city {margin-left: 82px;} #spanning_country {margin- Left: 62px;} #spanning_religion {margin-left: 63px;} #spanning_crime {margin-left: 74px;} #spanning_crimetype {margin-left: 39px;} #table {border: thick; Border color: # 09F;} #Instert {margin-left: 140px;} #foot {background: none;} & lt; / Style & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt ;? Php included ('database.php'); ('Commonheader.php'); ? & Gt; & Lt; Form method = "get" name = "queries" action = "queryverify.php" & gt; & Lt; H3 align = "center" & gt; & Lt; Font face = "Tahoma, Geneva, without-serif" color = "# 6C6" & gt; Question & lt; / Font & gt; & Lt; / H3 & gt; & Lt; Div id = "margin_left" & gt; & Lt; Table id = "table" border = "1" cellpadding = "10" & gt; & Lt; TR & gt; & Lt; TD & gt; Name: & lt; Span id = "spanning" & gt; Input gt; & Gt; Option value = "one" & gt; Murder & lt; / Option & gt; & Lt; / Select & gt; & Lt; / Time & gt; & Lt; Br / & gt; Crime type: & lt; Span id = "spanning_crimetype"> gt; Id = "crime type" size = "1" & gt; & Lt; Option value = "b" & gt; Half Murder & lt; / Option & gt; & Lt; / Select & gt; & Lt; / Span & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; Div id = "insert" & gt; Input
queryverify.php
& lt ;? Php $ name = $ _GET ['name']; $ Gender = $ _ received ['gender']; $ Marstatus = $ _ Received ['marstatus']; $ City = $ _ receive ['city']; $ Country = $ _ received ['country']; $ Religion = $ _ received ['religion']; $ Offense = $ _ ['crime']; $ Crimetype = $ _ Received ['crimtype']; ('Database.php'); $ Query = "Criminal (CID, name, gender, marriage_stats, religion, city, country, crime, crime_type) value (zero, '". $ Name "", "". $ Gender. "' Gender, .marstatus. ' ',' '. $ Religion.' ','. '$ City.' '', '". $ Country."' ',' '. $ Crime.' ',' ". $ Crimetype. '' ')"; Mysql_query ($ Query) or mysql_error () dead;; & gt;
$ is missing In future, you should check the following errors if you have PHP errors (the most common errors are for every developer):
- Do you have typed your query correctly
- All the Variables have their own dollar sign
- Have you added;
- And "use correctly"
In addition, I think you get different values but do not filter them, I suggest you use it Mysql_real_escape_string ( ) Before sending a query to the database
$ name = mysql_real_escape_string ($ _ GET ['name']);
(Just a few suggestions)
Comments
Post a Comment