supanoob Posted June 24, 2007 Share Posted June 24, 2007 Basically i want to limit the ammount of data echoed. So say someone types a 1500 word description about themself, i want to just echo 250 characters of that. is there a way to do this? Quote Link to comment Share on other sites More sharing options...
trq Posted June 24, 2007 Share Posted June 24, 2007 substr(). Quote Link to comment Share on other sites More sharing options...
predator Posted June 24, 2007 Share Posted June 24, 2007 do you want to do it so if shows something like this Description: this is like a chopped ver..... (the above shows there is more text then what has been echoed) or do you just wanna word limit the text so no more that 250 characters cannot be entered. Regards Mark Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 24, 2007 Author Share Posted June 24, 2007 how would i do that use that? Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 24, 2007 Author Share Posted June 24, 2007 i would like it so it has a link after the 250 words that allows them to click it and see the rest. Quote Link to comment Share on other sites More sharing options...
Rojay Posted June 24, 2007 Share Posted June 24, 2007 then you need javascrpit Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 24, 2007 Author Share Posted June 24, 2007 im sure ive seen a tutorial on how to do it using PHP somewhere. Quote Link to comment Share on other sites More sharing options...
Rojay Posted June 24, 2007 Share Posted June 24, 2007 it can be done using php but why?? if youre going to do it using php that means that you will load another page with the full description. With JavaScript you can just send the short description using php and make a javascript/ajax function that loads the rest upon request. Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 24, 2007 Author Share Posted June 24, 2007 because the other page will hold all the other information like name age location etc etc, also it will have the character profile on too. Quote Link to comment Share on other sites More sharing options...
Rojay Posted June 24, 2007 Share Posted June 24, 2007 okay. can you tell me exactly what are you trying to do ?? like you have page1 and there is a list of short descriptions and when you click on one it send you to another page with the full description and other information about the user? or it is more like a youtube kind of a thing like you one description per page but you dont want to the description to take the whole page so you want to display the first 250 and when the user clicks for example (View full desc.) it shows the full description? Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 24, 2007 Author Share Posted June 24, 2007 Basically you have 1 profile page on this you have an image 2 descriptions 1) Character Description (for a description you have made about your character) 2) Player Description (a description about YOU) now i want these to be upto 1500 characters but i only want 250 of them to show on the profile page, once you click them it will take you to another page/step where you can view the rest of the profile Quote Link to comment Share on other sites More sharing options...
Rojay Posted June 24, 2007 Share Posted June 24, 2007 ohh then use php. you konw how to load data from the database,right? then use $short_desc = substr($description, 0, 250); echo $short_desc." <a href='profile.php?user_id=".$user_id."'> View profile</a>"; hope that helps Quote Link to comment Share on other sites More sharing options...
teng84 Posted June 24, 2007 Share Posted June 24, 2007 Basically i want to limit the ammount of data echoed. So say someone types a 1500 word description about themself, i want to just echo 250 characters of that. is there a way to do this? if($input>250) { //use 250 only } hope that helps Quote Link to comment Share on other sites More sharing options...
supanoob Posted June 25, 2007 Author Share Posted June 25, 2007 thanks ila try that Quote Link to comment 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.