Jump to content

cpd

Members
  • Posts

    883
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by cpd

  1. In a form, how do i make the page NOT refresh when hitting the "Enter" key after typing in a text box <form method="post"> <input type="text" name="message"> </form> say i was focused on that text box how do i make it so that when the form is submitted it doesnt refresh the page? Cheers
  2. The subject says it all really. Its probably really simple but i dont know how to do it. Ive made an Ajax Chat and id like the user to be able to hit the enter button rathern then pressing Submit and im not sure how to do it without making the page refresh?
  3. Hi, im baisically looking to take note and put into a database peoples IP's so that i can check to see if they are banned. Could someone please tell me how to do this. Ive tried a few things and they do work but NOT for everyone. Some peoples IP's just wont log and some peoples do...
  4. Ive got another little problem, im not sure how to split difference characters with the preg_split functions. Is there a link that will show me what to use for splitting different characters. ~\s~ will split a space what will split a forward slash?
  5. Right ive tried the preg split exactly as shown there and it worked perfectly. Thank you very much for your help
  6. Right, after some research ive found some stuff out which i didnt know however my problem still stands. Ive found out that when you have a text file that has double, tripple or however many spaces between columns, the "file" function splits each line into an array and replaces all double spaces tripple spaces etc, with single spaces. So from that i now know that all i need to do is "explode" or "preg_split" each array to get the single columns however when i do this (baring in mind i havnt tried preg_split yet, still need to research how it works) it only creates two arrays eg: $file = file(something); $line = explode(" ", $file[0]); print $line[0]; // This gives the first column value print $line[1];; // This gives the other columns however many there are Im gonna try the preg_split. Is there any chance someone could explain why it only explodes the first space and then does nothing to the other spaces? Thank yooouuu =]
  7. Hello, im currently trying to parase some data from a file. Ive done the "file("htttp://www.example.com")" function and split all the rows into arrays however i need to now explode the spaces between the columns, example below. Column1 Column2 Column3 Column4 Column5 <= take this row Column1 Column2 Column3 Column4 Column5 Column1 Column2 Column3 Column4 Column5 $File = file(link); $File[0]; <= This is the first row $Data = explode(" ", $File[0]); print $Data[3]; <=I presumed this would print column four but it doesnt it just does nothing. $Data[0] prints Column1 and $Data[1] will print the last four columns. At this point im not sure if im making much sense but my target is to split the columsn into arrays and then be able to use the data from there. Could someone please tell me how to do this. Regards Chris
  8. Yeah ive done that already and that works absolutely fine but they can still delete that text and type something else. i just dont want them to delete it what so ever...
  9. Hello, im trying to set an input tag so that it has "EUF" permanantly in it however the user can still type text AFTER the "EUF" text. Could someone please push me on my way an tell me how to do this using JS? thankyou
  10. Baisically im trying to make a background image on the body of my website and ive tried several different things. 1. background: url(images/body-bg.jpg) repeat-y; 2. background: url('images/body-bg.jpg') repeat-y; 3. background: #9eb9c4 url(images/body-bg.jpg) repeat-y; 4. background-image: url(images/body-bg.jpg); background-repeat: repeat-y; 5. background-image: url('images/body-bg.jpg'); background-repeat: repeat-y; and nothing has worked. Could somone offer a solution or something much appreciated. The final design will be a gradient image going from dark to lighter then the lighter colour will be the background colour so that it all blends.
  11. Lool, i would agree with you if i hadnt come across this layout
  12. and is the $timestamp just time()?
  13. Could you explain what mktime does and how it works because i dont understand the php.net explanation
  14. Ok so i do it with the time() function. how do i then change that into the format of d H:i
  15. It was unchecked when i went into it :S:S and it still drops a line as it gets to the right side of the apge
  16. What do i set automatic wrapping to please? its says enter a num between 1 and 1024 which is my screen size. And i dont want either i want it off
  17. yer but i dont wana write an if statement say if($VAUE != 1 || $VALUE != 2 etc etc That would take ages
  18. So should i simple store it as a big time stamp manually. Because im not EVER going to use seconds what so ever end of. thats why i dont want it. I also wont need the "Time" in many circumstances therefore i saw no point in using timestamp in the PHPmyadmin Also, when getting the timestamp say $TIMESTAMP What would strtotime($TIMESTAMP) do and how do i format it into Y M d H:i ? Then do the time they last attempted to enter this section take away 2 days and then print that out?
  19. tried it and it over complicated things so i left it. Tried notepad and it didnt work properly coz it couldnt hand large files. Tried Notepad2 and it worked wonderfully but i got annoyed at it coz when your working on several pages it opens a new window for each so i then tried Notepad++ which tabs and it was fine but it does stupid things like inndents elseif tags on its own which i didnt want etc and also i had to have a folder with all my filed open. A friend showed me his layout for dreamweaver which has prooved to be the best out of all five. I now want to disable self closing tags and make the page extend from left to right which it doesnt do atm. It just drops a line when i dont want it to but im sure i can get it sorted. Far easier and i find i can code quicker because theres a list of all my files to the left of dreamweaver/. And thats my story of how i came to use dreamweaver:P Any idea how to disable self closing tags? AHAHA
  20. I only use dreamweaver in Code mode and i used to agree it was awful but i now find it very easy. Reason being is ive set the workspace up so i can view all my files to the left and just click it and it also tabs it like Notepad++. So all in all its the same as Notepad++ or Notepad etc but it has the files right next to you then has the pages your working on tabed at the top. If i can only get the self closing tags off it will be fine
  21. Ok so say i use them TimeStamp columns, how do i change it into the format of Y M d H:i and Y M d Using explode or something?
  22. I want to stop someone from accessing something before 48 hours has passed since the last time the accessed it (Which ive managed to do). Then i want to tell them how much time they have left... So the time they last accessed it is in my table as "Y M d H:i" EG "2008 Dec 13 12:41". Ive managed to work out how to stop them from accessing it but i now want to tell them how much time they have left before they can access this "area" again. To find out if 48 hours has passed i did: if($Last_attempt > date("Y M d H:i",strtotime("-2 days"))) { Where $Last_attempt is in the same format as the date(). I now want to return the time left...How do i do this?
  23. All that did was ask me if i wanted to Save Changed then closed Dreamweaver. After i reopened it presuming it was the standered way to do it (Dunno why) and nothing changed...
  24. How do you disbale self closing tags in Adobe Dreamweaver?
  25. So how do i check if its from say 1-12 or the the Month is not from Jan to Dec
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.