variable passing

0 reema dawes · September 11, 2014
<form action="page2.php" method="post">
title <input type="text" name="title" >
content <input type="text" name="content">
homepage <input type="checkbox" name="chk" value="yes">
<input type="submit" name="submit" value="submit">
<?php
if (isset($_POST['submit']))
$title= $_POST['title'];
$content=$_POST ['content'];
$chk=$_POST['chk'];
if ( $title=='' or $content==''){
echo"enter all fields";
}
else {
$query=INSERT into posts VALUE ('',$title,'$content,'')
}
if ($query_run=mysql_query($query) {
echo "successful";
}

if (isset($_POST['chk'])&& $chk=='yes'))
while ($row=mysql_fetch_assoc($query_run)){
echo "<a href=\"index.php?id=".$row['id']."/> </a>";
}





?>

Post a Reply

Replies

- page 2
Oldest  Newest  Rating
0 JOhaL jaTT · September 12, 2014
error in my chat section can't chat 
 
-4 reema dawes · September 12, 2014
im not sure what you mean franz
+1 Franz Schmidt · September 12, 2014
At the beginning you posted a code is this the index.php or another page of yours?
  • 1
  • 2

PHP

107,148 followers
About

Server-side, HTML embedded scripting language used to create dynamic Web pages.

Links
Moderators