scab_dog 0 Report post Posted September 27, 2005 Hello Xisto Members,I would really like to know how to find lines in PHP, Like my forums. Like when it says Error on Line 345. How do you find the line. I sat there one day pressing the down arrow counting the line, but there should be a simpler way of doing i. Can anybody help.Well I know what i said above dosent make sence, but it will do, it is hard to explain. From,.::DAMAN::. Share this post Link to post Share on other sites
snlildude87 0 Report post Posted September 27, 2005 Find the troubled file, copy its content to Notepad, go to View - Status Bar, then scroll down, click on a random line, look at the status bar, and it will tell you what line your cursor is on. Keep doing that until you get what you want.I'm also moving this to another forum since it doesn't belong here. Share this post Link to post Share on other sites
shadowdemon 0 Report post Posted September 27, 2005 yes i have this program called edit plus 2.wwat it does is u can copy the code and paste it and find each line. pm me the code and ill find the line for u if u want Share this post Link to post Share on other sites
Tyssen 0 Report post Posted September 27, 2005 Get yourself any decent text-based web editor - they all have line numbers. Share this post Link to post Share on other sites
dogomchawi 0 Report post Posted September 27, 2005 I would suggest that you either get Dreamweaver which costs a lot of money or Textpad Within Texpad there is an option for syntax highlighting and line numbers - so you can get your code all pretty looking AND get the line numbers too =) Here is the link for Textpad: http://www.textpad.com/ Share this post Link to post Share on other sites
rvalkass 5 Report post Posted September 27, 2005 Most programs have line numbers running down the left hand side, such as the one I use, PHP Designer 2005.If you don't want to download one of these programs then use Notepad. As snlildude87 said, you can look at the status bar, but a quicker way is to press Ctrl + G and type in the line number you want. Share this post Link to post Share on other sites
saga 0 Report post Posted September 27, 2005 you need to have a text editor that displays line number, I used EditPlus 2, its cool since it support PHP codes which mean different colors on globals, variables and functions, anyway, what you do is to have the same exact copy of the php in your website and the editor so when errors appear, you could simply locate it in the editor and then correct the error in the editor then upload the corrected file to your server. you could either use ftp or simply the upload feature in the filemanager. Share this post Link to post Share on other sites
Spectre 0 Report post Posted September 27, 2005 I think we get the picture. A text editor which displays line numbers. Got it the first few times.Anyway, daman, an easy way (in my opinion, anyway) is to use PHP to find the troublesome block of code, something to the effect of: <pre><?php$code = file('script.php');for( $i=error_line-5;$i<(error_line+5);$i++ ) { $output[] = isset($code[$i]) ? $code[$i] : '';}echo implode("\n",$code);?> It's often easier to spot errors if you can crop the section of code causing the problem. Share this post Link to post Share on other sites
sonorama 0 Report post Posted September 27, 2005 You must be kidding dude!, I'm almost sure you must have Macromedia MX installed in your PC, right? if it is true, then just use Dreamweaver, that's it! there is no complication at all. But if you want to try something new, then use http://www.nvu.com/Cheers!! Share this post Link to post Share on other sites
saga 0 Report post Posted September 27, 2005 You must be kidding dude!, I'm almost sure you must have Macromedia MX installed in your PC, right? if it is true, then just use Dreamweaver, that's it! there is no complication at all. But if you want to try something new, then use http://www.nvu.com/ Cheers!! 189897[/snapback] for lots of reason i am not using Wysiwyg editor. So im stuck in text based editor like notepad Share this post Link to post Share on other sites
scab_dog 0 Report post Posted September 27, 2005 Thanks Every1,I find it much Easier to do what rvalkass said, I just copied all the PHP code into notepad, then Ctrl+G, this seemed to work for me. Thanks everyone.PS. Soory about the wrong forum snildude, dont worry i'll take a note in my mind now!! Share this post Link to post Share on other sites
snlildude87 0 Report post Posted September 28, 2005 Glad we could solve your problem.Question answered -> thread closed. Share this post Link to post Share on other sites