Jump to content

[SOLVED] Error in Safari and not FireFox


daveoffy

Recommended Posts

I have this code, and it works fine in FireFox, but my friend on Safari is getting errors!

 

code is below, under that is error

 

<?PHP
session_start();
include 'config.php';
$errmsg_arr = array();
$errflag = false;
$sitename = $_POST['sitename'];
$username = $_COOKIE['username'];
if($sitename == ''){
	$errmsg_arr[] = 'Please enter a site name!';
	$errflag = true;
}
if($errflag) {
	$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
	session_write_close();
	header("location: ../editor.php");
	exit();
}
$sql = "SELECT * FROM users WHERE username = '$username'";
$sqlresult = mysql_query ($sql);
while ($row = mysql_fetch_array($sqlresult))
$id = $row['id'];
$qry = "INSERT INTO site (id, site) VALUES('$id', '$sitename')";
$result = @mysql_query($qry);
if($result) {
mkdir(../sites/'.$username.'/'.$sitename);
header("location: ../editor.php");
	$errmsg_arr[] = 'New site added!';
	$errflag = true;
}else {
echo mysql_error();
die("Query failed");
}
if($errflag) {
	$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
	session_write_close();
	header("location: ../editor.php");
	exit();
}
?>

 

Warning: mkdir() [function.mkdir]: No such file or directory on line 25

 

Warning: Cannot modify header information - headers already sent on line 26

 

Warning: Cannot modify header information - headers already sent on line 36

Link to comment
https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.