daveoffy Posted February 28, 2009 Share Posted February 28, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/ Share on other sites More sharing options...
DarkSuperHero Posted February 28, 2009 Share Posted February 28, 2009 mkdir('../sites/'.$username.'/'.$sitename); you were missing an apostrophe on like 25 Quote Link to comment https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/#findComment-773396 Share on other sites More sharing options...
daveoffy Posted February 28, 2009 Author Share Posted February 28, 2009 Sorry I had that, I don't know how it went away. But still get an error. Quote Link to comment https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/#findComment-773401 Share on other sites More sharing options...
cooldude832 Posted February 28, 2009 Share Posted February 28, 2009 <?php not <?PHP and its a whitespace issue. Quote Link to comment https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/#findComment-773417 Share on other sites More sharing options...
daveoffy Posted February 28, 2009 Author Share Posted February 28, 2009 <?php not <?PHP and its a whitespace issue. Where is there a whitespace issue? And all the other pages with <?PHP work just fine. Quote Link to comment https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/#findComment-773419 Share on other sites More sharing options...
daveoffy Posted February 28, 2009 Author Share Posted February 28, 2009 *COULD NOT MODIFY* I fixed it. I first had to set it to make a folder of usrname when they join, than it will make it when they add a site. Thanks for all the help! Quote Link to comment https://forums.phpfreaks.com/topic/147340-solved-error-in-safari-and-not-firefox/#findComment-773435 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.