education5866 Posted January 7, 2009 Share Posted January 7, 2009 Okay...my server is running php5, but I am getting a parse error message: Parse error: syntax error, unexpected T_STRING, expecting '(' in /home/gcc/public_html/pro-php/admin/AddCat.php on line 44 Here's the phpcode for that page (I've marked line 44): <?php require_once("../db.php"); include("Header.php"); $db = new db_layer(); $db->getConnection(); if($_SERVER['REQUEST_METHOD'] == "POST") { $catName = $_POST["catName"]; if($catName == "") { $formError = "1"; } else { $qry = "insert into mag_name(name) values('".str_replace("'","",$catName)."')"; $db->execute_sql($qry,$result,$error_msg); if($error_msg <> "") { echo $error_msg; } else { $new_id = mysql_insert_id(); ?> <script language="javascript" type="text/javascript"> document.location.href="AddMag.php?CatID=<?php echo $new_id ?>"; </script> <?php die; } } } ?> <table width="600" border="0" align="center" cellpadding="10" cellspacing="1" bgcolor="#666666"> <Form name="NewCategory" method="post" action="../../pro-php/admin/?Process=AddCat"><tr> <td colspan="2" bgcolor="#222222"><span style="font-family: Tahoma, Verdana, sans-serIf; font-size:20px; font-weight:bold">Add Category</span></td> </tr> <?php if($FormError == "1") { ?> [u][b]LINE44 [/b][/u] <%If Request("Process")="AddCat" and FormError=1 Then%><tr> <td colspan="2" align="center" bgcolor="#222222" style="font-family: Tahoma, Verdana, sans-serIf; font-size:16px; color:#f30">*<p>missing information! category name required...</p></td> </tr> <?php } ?> <tr> <td width="30%" align="right" bgcolor="#222222" style="font-family: Tahoma, Verdana, sans-serIf; font-size:18px">Category Name:</td> <td bgcolor="#222222"><input name="catName" type="text" id="catName" style="font-family:Verdana, Arial, Helvetica, sans-serIf; font-size:16px; padding:3px; width:350px; height:30px" maxlength="100"></td> </tr> <tr> <td align="right" bgcolor="#222222"> </td> <td bgcolor="#222222"><input type="submit" name="Submit" value="Submit" style="font-family: Tahoma, Verdana, sans-serIf; font-size:16px"></td> </tr></Form> </table> <?php include("Footer.php"); ?> If anyone can figure out why I'm getting a parse error in this php file, I would greatly appreciate it! Thanks in advance! NewbieToPhp Quote Link to comment https://forums.phpfreaks.com/topic/139907-newbie-with-problem/ Share on other sites More sharing options...
premiso Posted January 7, 2009 Share Posted January 7, 2009 <%If Request("Process")="AddCat" and FormError=1 Then%> Looks like it is an ASP line. That is not valid php. Quote Link to comment https://forums.phpfreaks.com/topic/139907-newbie-with-problem/#findComment-731960 Share on other sites More sharing options...
education5866 Posted January 7, 2009 Author Share Posted January 7, 2009 <%If Request("Process")="AddCat" and FormError=1 Then%> Looks like it is an ASP line. That is not valid php. Thanks for the quick reply... Can you figure out how to put that line back 'into' PHP...I got the code from somewhere else and don't have access to other support? Thanks again. Quote Link to comment https://forums.phpfreaks.com/topic/139907-newbie-with-problem/#findComment-731964 Share on other sites More sharing options...
premiso Posted January 7, 2009 Share Posted January 7, 2009 if($FormError == "1" && $_REQUEST['Process'] == "AddCat") { ?> <tr> <td colspan="2" align="center" bgcolor="#222222" style="font-family: Tahoma, Verdana, sans-serIf; font-size:16px; color:#f30">*<p>missing information! category name required...</p></td> </tr> Should solve it. Quote Link to comment https://forums.phpfreaks.com/topic/139907-newbie-with-problem/#findComment-731987 Share on other sites More sharing options...
education5866 Posted January 8, 2009 Author Share Posted January 8, 2009 if($FormError == "1" && $_REQUEST['Process'] == "AddCat") { ?> <tr> <td colspan="2" align="center" bgcolor="#222222" style="font-family: Tahoma, Verdana, sans-serIf; font-size:16px; color:#f30">*<p>missing information! category name required...</p></td> </tr> Should solve it. Premiso...wow! Thanks alot for your help. Hopefully, someday I'll have enough PHP knowledge to help someone else on this board. Thanks again! Education Quote Link to comment https://forums.phpfreaks.com/topic/139907-newbie-with-problem/#findComment-732408 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.