Page 1 of 1

run on public server pls help!!!!!

Posted: Mon Apr 06, 2009 12:06 pm
by christosyia
pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.


hey, i am new in php.

i try to create a simple web page in php and everything are ok if i use my local Apache server (wamp).

i write the following code:

Code: Select all

<?php
$dbhost = 'myhost';
$dbuser = 'myusername';
$dbpass = 'mypassword';
 
session_start();
$conn = mysql_connect($dbhost, $dbuser, $dbpass)
or die ('Error connecting to mysql');
$dbname = 'mydatabase';
mysql_select_db($dbname);
 
$email = $_REQUEST["email"];
$pwd = $_REQUEST["password"];
$type = $_REQUEST["type"];
if($email != null){
if ($type=="m"){
$sql = "SELECT * FROM members WHERE email = '$email' AND password = '$pwd'";
$result = mysql_query($sql);
if($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$m = "yes";
$_SESSION['member']= $m;
$_SESSION['email']= $row['email'];
$_SESSION['fullname']= $row['fullname'];
$_SESSION['memberid']= $row['memberid'];
header( 'Location: memberAccount.php' );
}else{
header('Location: registerlogin.php?err=1');
}
}else{
$sql = "SELECT * FROM administrator WHERE email = '$email' AND password = '$pwd'";
$result = mysql_query($sql);
if($row = mysql_fetch_array($result, MYSQL_ASSOC)){
$m = "yes";
$_SESSION['administrator']= $m;
$_SESSION['email']= $row['email'];
$_SESSION['fullname']= $row['fullname'];
$_SESSION['administratorid']= $row['administratorid'];
header('Location: administratorAccount.php');
}else{
header('Location: registerlogin.php?err=1');
}
 
}
}
 
 
?>
Now, when i try to upload it in my space on internet (using a local ISP provider), the server does not give me any errors but the web page does not work.

if anyone can help me i will appreciate in advance

Thank you!!!


pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.

Re: run on public server pls help!!!!!

Posted: Thu Apr 09, 2009 3:10 pm
by nyoka
Add the following two lines at the top of your code to force php (assuming it is installed and available) to display any errors.

Code: Select all

 
<?php
error_reporting(E_ALL ^ E_NOTICE);
ini_set('display_errors', '1');
?>