jmr3460 Posted June 14, 2009 Share Posted June 14, 2009 <?php $test_post = "No space at top of php post"; ?> I am trying to find out how to set my editor so there is no whitespace at the beginning of my scripts. If there is no space at the beginning of this script then it is fixed otherwise I will have to work on it. Why is there a line at the top of my code? I will try another editor on this code> Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/ Share on other sites More sharing options...
jmr3460 Posted June 14, 2009 Author Share Posted June 14, 2009 <?php $post = "another editor"; ?> What is the deal? Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855336 Share on other sites More sharing options...
MadTechie Posted June 14, 2009 Share Posted June 14, 2009 its probably an encoding issule, but now saying what your using really doesn't help! also this isn't a PHP question! Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855337 Share on other sites More sharing options...
jmr3460 Posted June 14, 2009 Author Share Posted June 14, 2009 sorry I will try and find the solution somewhere else. Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855340 Share on other sites More sharing options...
PFMaBiSmAd Posted June 14, 2009 Share Posted June 14, 2009 Ummm. It's called using the cursor keys (up-arrow, left-arrow) to move to the top of the file and delete the extra characters before the <?php tag. Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855343 Share on other sites More sharing options...
MadTechie Posted June 14, 2009 Share Posted June 14, 2009 sorry I will try and find the solution somewhere else. Well I have move the post to the correct section now.. "Editor Help" Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855344 Share on other sites More sharing options...
jmr3460 Posted June 14, 2009 Author Share Posted June 14, 2009 Someone suggested once to save as a UTF-16 no BOM. Will this save as with no white space? I am going to try this. <?php include("dbin.php"); $table = "home"; $filename = 'log.txt'; mysql_connect($host, $user, $pass); mysql_select_db($database) or die(mysql_error()); $data = mysql_query("SELECT * FROM $table"); while ($info = mysql_fetch_array($data)){ $log = $info['id'] . " ||| " . $info['ip'] . " ||| " . $info['time'] . " ||| " . $info['browser'] . "\n"; if (is_writable($filename)) { if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } if (fwrite($handle, $log) === FALSE) { echo "Cannot write to file ($filename)"; exit; } fclose($handle); } else { echo "The file $filename is not writable"; } } echo "Success, wrote () to file " . $filename; ?> This is the only way I know that I can test this. No there is still a blank line at the top of my code. Is this a good way to do this? Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855422 Share on other sites More sharing options...
jmr3460 Posted June 14, 2009 Author Share Posted June 14, 2009 I found out why I have a blank line at the top of my code. it is the way I post I do the PHP with square brackets then I hit return. Bam a new line (or a blank line in my post). Now that is solved back to the coding. Quote Link to comment https://forums.phpfreaks.com/topic/162093-solved-setting-my-programming-editor/#findComment-855431 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.