I have this form:
<form action="index.php?type=add_lesson&type=add" method="post">
<?php echo $lesson_title; ?><br/><input type="text" name="title" style="width:450px;" /><br/>
<?php echo $lesson_url; ?><br/><input type="text" name="url" style="width:450px;" /><br/>
<?php echo $keywords; ?><br/><input type="text" name="kewyords" style="width:450px;" />
<br/><br/><br/>
<input type="submit" value="<?php echo $submit;?>" class="button" /></form>
and this index.php code:
if($_GET['type'] == "add_lesson"){
include_once(fls."add_lesson.php");
}
and this add_lesson.php code:
if($_GET['type'] == 'add'){
$title = htmlspecialchars($_POST['title']);
$url = htmlspecialchars($_POST['url']);
$kewyords = htmlspecialchars($_POST['kewyords']);
$sql = $mysqli->query("INSERT INTO LESSONS(L_TITLE,L_URL,L_COMMENTS,L_VIEWS,L_KEYWORDS)
VALUES('".$title."','".$url."','0','0','".$kewords."') ");
echo $added_sucessfully;
}
but when I click submit I get white page
what is the problem??
You have error in your code: include_once(fls.”add_lesson.php”); probably you ment include_once($fls.”add_lesson.php”);
Also make sure your php installation shows php errors. Probably you have Fatal PHP Error that is not displaying.
Here is simple tutorial to follow to make sure you see php errors:
http://www.wallpaperama.com/forums/how-to-display-php-errors-in-my-script-code-when-display-errors-is-disabled-t453.html
Another thing.. You have
<form action="index.php?type=add_lesson&type=add" method="post">So you get only type=add in PHP 🙂