[ubuntu-za] LAMP install
Alf Stockton
alf at stockton.co.za
Sat Oct 20 09:06:24 UTC 2012
I have followed the procedure at
http://community.linuxmint.com/tutorial/view/486 to install LAMP on my
Mint 13 laptop with a view to developing locally & once working emigrate
to my server but ......
Displaying html & php in Firefox works fine but links seem to be failing.
The following extract from one of my proggies works fine from the
command line but not when called from a link in the browser. I suspect
the problem may have something to do with the
require_once('includes/configuration.inc');
but what?
<?php
require_once('includes/configuration.inc'); // database connect
script & the rest.
?>
<!DOCTYPE html>
<html>
<head>
<title>Insert a new User</title>
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="Mon, 22 Jul 2000 11:12:01 GMT"
</head>
<?php
DBConnect();
$Message = sprintf("<br />Line %d After DBConnect()<br />", __LINE__);
trigger_error($Message, E_USER_ERROR);
if (!get_magic_quotes_gpc())
{
$_POST['uname'] = addslashes($_POST['uname']);
}
$name_check = "SELECT Usrname FROM Users WHERE Usrname =
'".$_POST['uname']."'";
$Result = mysql_query($name_check);
$Count = 0;
while ($row = mysql_fetch_array($Result))
{
++$Count;
}
if ($count != 0)
{
$Message = sprintf("%s %d <br>Sorry, the username: %s is
already taken, please pick another.", __FILE__, __LINE__);
trigger_error($Message, E_USER_ERROR);
exit;
}
$Message = sprintf("<br />Line %d After username check<br />",
__LINE__);
trigger_error($Message, E_USER_ERROR);
if ($_POST['passwd'] != $_POST['passwd_again'])
{
$Message = sprintf("%s %s %s %s<br
/>",strip_tags($_POST['Surname']),strip_tags($_POST['FirstName']),
strip_tags($_POST['uname']),strip_tags($_POST['passwd']));
trigger_error($Message, E_USER_ERROR);
$Message = sprintf("%s %d %s %s<br>Passwords did not match!<br
/>",__FILE__, __LINE__,$_POST['passwd'],$_POST['passwd_again']);
trigger_error($Message, E_USER_ERROR);
exit;
}
etc etc etc
--
Regards,
Alf Stockton www.stockton.co.za
More information about the ubuntu-za
mailing list