sith717 Posted September 19, 2008 Share Posted September 19, 2008 Hello, How do I add numbers to the rows in a text box? Like this: 1 test 2 lol 3 hmm more test Like each row is numbered? example: http://www.protycoon.com/2008/02/13/php-login-script-tutorial/ See the numbers where it shows the demo? Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/ Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 bump I NEED THIS DONE ASAP! Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645895 Share on other sites More sharing options...
aebstract Posted September 19, 2008 Share Posted September 19, 2008 Are you talking about how they numbered their lines when showing the code? I think we're gonna have to see some of your code to help you out, as there are various ways to approach this depending on your situation. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645896 Share on other sites More sharing options...
DamienRoche Posted September 19, 2008 Share Posted September 19, 2008 Don't shout! were not slaves, here to do your bidding!!! I think you just lost any help you were gonna get. Well done I'll say this much. You have to use a loop. While (there are lines){ add $loopnum inside a text box; } That's all you're getting. Good luck!! Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645898 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 <textarea cols="80" rows="25" name="filebody" id="filebody" wrap="soft">hey this is a test lol</textarea> In that textbox where do I add it? Sorry about the shout. I need this fast... Its kind of hard for me to figure out. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645903 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 I still need some assistance. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645907 Share on other sites More sharing options...
aebstract Posted September 19, 2008 Share Posted September 19, 2008 I don't understand what you're trying to do, put a number in front of the box.. but all you have to do is type it. I'm kinda lost on what you're getting at, probably not showing enough code. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645909 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 Like lok at the link I gave, see in the part where it shows the php code, the lines are numbered? Thats what I need. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645912 Share on other sites More sharing options...
aebstract Posted September 19, 2008 Share Posted September 19, 2008 The code you posted is for a form textarea which really has nothing to do with what you're asking about. That is why I want to see some of your code so I can help you out. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645913 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 If possible, can u give me that script that I showed in the link? Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645928 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 Still need help.. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645937 Share on other sites More sharing options...
DamienRoche Posted September 19, 2008 Share Posted September 19, 2008 I'll start you on your way. use this: $loop = 1; $limit = 20; ///you have to find a way to make this how many lines there are. while($loop <= $limit){ echo "<textarea cols='80' rows='25' name='filebody' id='filebody' wrap='soft'>$loop: hey this is a test lol</textarea>" $loop = $loop +1; } This will produce 20 lines of "hey, this is a test" all numbered, 1 to 20. Now you gotta figure out how to make it dynamic. A valid point made before is that, those numbers in the page you shown us are not within a text area. They are within a td, or a div/li etc. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645939 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 Yes I need the one so that its div and stuff. Thanks. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645945 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645964 Share on other sites More sharing options...
wildteen88 Posted September 19, 2008 Share Posted September 19, 2008 If possible, can u give me that script that I showed in the link? Thanks. FYI the script used to display the code with line numbers/syntax highlighting is called GeSHi. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645980 Share on other sites More sharing options...
sith717 Posted September 19, 2008 Author Share Posted September 19, 2008 Is there anything simpler I can use? Like you know cpanel? You know how when you do code edit, it shows the numbers where the lines are. I need something like that. I am making a filemanager type thing. Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645988 Share on other sites More sharing options...
discomatt Posted September 19, 2008 Share Posted September 19, 2008 If you want it in a text area, you're probably gonna have to make a sized custom background with line numbers... which would kinda suck. The only other way would be JavaScript. As this is so urgent, you may want to check the FreeLance forum and see how cheap you can get it done. I don't help on demand Quote Link to comment https://forums.phpfreaks.com/topic/125002-numbers-in-rows/#findComment-645997 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.