What the hell!.Help me Please.
Here is my code.I am using switch statement method.
//For New menu Input Form
function addmenuform()
{
include('connect_to_database.php');
$query=mysqli_query($connect,"SELECT * FROM menu WHERE showing='1' ORDER BY id ASC") or die(mysqli_error($connect));
$list='';
while($row=mysqli_fetch_array($query))
{
$id=$row['id'];
$pagetitle=$row['pagetitle'];
$list.="<option value=".$id.">".$pagetitle."</option>";
}
$inputform='<center><form action="index.php?op=savemenu" method="post">
<h1>Insert New menu</h1>
Menu Title:<input name="pagetitle" style="width:600px" type="text" required><br/><br/>
Page Content:<br/><textarea name="pagebody" cols="80" rows="25" required></textarea><br/><br/>
Page Order:<input style="width:600px" name="pageorder" type="text"><br/><br/>
Keyword For SEO:<input style="width:565px" name="keyword" type="text"><br/><br/>
Meta description For SEO:<br/><textarea name="metadescription" cols="80" rows="5"></textarea><br/><br/>
Select A Parent Id to Make Dropdown Menu:<select name="parent_id">
<option selected value="0">No Parent</option>
'.$list.'
</select><br/><br/>
<input name="submit" type="submit" value="Create Menu"> <input name="reset" type="reset" value="Reset">
</form></center><br/><br/>';
echo $inputform;
}
//For Inserting The Menu In The Database
function menusave()
{
include('connect_to_database.php');
$title=trim($_POST['pagetitle']);
$content=trim($_POST['pagebody']);
$order=trim($_POST['pageorder']);
$keyword=trim($_POST['keyword']);
$metadescription=trim($_POST['metadescription']);
$parentid=trim($_POST['parent_id']);
$query=mysqli_query($connect,"INSERT INTO menu (pagetitle, pagebody, pageorder, keyword, metadescription, parent_id) VALUES('$title','$content','$order','$keyword','$m etadescription','$parentid')") or die(mysqli_error($connect));
if($query)
{
echo "Successfully Inserted.<a href='index.php?op=addmenu'>Back.</a>";
echo '<meta http-equiv="refresh" content="2 index.php?op=addmenu"/>';
}else{
echo "Please Try Again.<a href='index.php?op=addmenu'>Back.</a>";
echo '<meta http-equiv="refresh" content="2 index.php?op=addmenu"/>';
}
exit();
}
Now i want to insert this function through textarea by writing it
<?php newsticker('Top news');?>
And when i submit to save it mysql gives error but this code works in my localhost perfectly.How to overcome this problem?.I am waiting for your reply.
Thank's in advance.
-
KirkMcD -
[ 1 ] Thanks - 1 reply
{{ DiscussionBoard.errors[10569318].message }}-
Duc Aaron -
Thanks - 1 reply
SignatureWebinar Jeo Bonus | Webinar Jeo Review | InstaViral 2.0 Review | InstaViral 2.0 Bonus | Viral Loop Review | Viral Loop Bonus{{ DiscussionBoard.errors[10573007].message }}-
belyas -
Thanks
{{ DiscussionBoard.errors[10581033].message }} -
-
-