Re: php 4.0.5 to php 4.2.2
| From: | Chris Mach | Date: | Wed, 23 Apr 2003 05:00:03 +0000 |
| Subject: | Re: php 4.0.5 to php 4.2.2 | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27292@lists.php.net to get a copy of this message | ||
ok so here's what I have now, but now it doesn't seem to do anything to the
database.
http://matrix.senecac.on.ca/~cjmach/test.php
Do I need any type of special access to the server to use a .htaccess file?
or is and average user like myself able to implement such a file?
<html>
<body>
<?php
$host="www.*******.org";
$user="***";
$password="********";
//Connect and select the database for use
$db = mysql_connect($host,$user,$password) or die("Could not connect: " .
mysql_error());
mysql_select_db("55yardline",$db);
$result = mysql_query("SELECT * FROM news1 WHERE id1 < 50",$db);
if ($myrow = mysql_fetch_array($result)) {
echo "<table border=0 width=600 align=center>\n";
echo "<tr><td>News</td></tr>\n";
$myrow['title'] = $_POST['title'];
do
{
printf("<tr><td><b>%s</b></td></tr><tr><td>%s<br><br><br><br></td></tr>\n",
$myrow["title1"], $myrow["copy1"]);
}
while ($myrow = mysql_fetch_array($result));
echo "</table>\n";
}
else
{
echo "Sorry, no records were found!";
}
if ($_POST['submit']) {
$sql = "INSERT INTO news1 (title1,copy1) VALUES
({$_POST['title']},{$_POST['copy']})";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
} else{
?>
<form method="post" action="<?php echo $PHP_SELF?>">
Enter Title:<br><input type="text" name="<?php
$_POST['title']
?>"><br>
Enter Copy:<br><textarea name="<?php $_POST['copy']
?>"
cols="75" rows="10"></textarea><br>
<input type="Submit" name="<?php $_POST['submit']
?>"
value="Enter information">
</form>
<?php
}
?>
</body>
</html>