Jump to content

johnny-2step

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Everything posted by johnny-2step

  1. Hey guys, Thanks for all your help. Finally got it to work. I just needed to use the trim() function to get it not to pass on my if condition statement. Thanks pocobueno1388. I nearly had the urge to hit my head on the keyboard just trying to figure this out. Again thanks.
  2. Hi teng84, Sorry, if I wasn't able to make it clear. My first time using php you see. Well, I'm trying to get my script to get data from a text file line by line and show it. When my script encounters a blank line within the text then it will output an "UNKNOWN" message. But what my script is doing is rather show an "UNKNOWN" text, it still goes through in showing the blank line. I have tried all kinds of condition statements just so to get it to work but to no avail. I hope you get what I'm trying to accomplish. If you can suggest a different approach, I would gladly like to hear about it.
  3. Hi all, I have a problem concerning outputting a string from a text file. Here's a sample of my code: $handle = fopen("country.txt", "r"); while(!feof($handle)) { $location = fgets($handle); if(is_null($location)) { echo "UNKNOWN"; } else { echo $location; } } This is what my text file kinda looks like: location1 location2 <a null space> location3 Now my problem is, instead of my code outputting an "UNKNOWN" text whenever it encounters the null space it just shows a blank. I don't know what I'm doing wrong. I tried empty(), !isset() and $location == "" on my condition statement but the result is still the same. I'm probably missing something but I just can't figure it out. Any help would be really appreciated. Thanks in advance.
  4. Thank you very much, it works great. Didn't know it was that simple. I'll just expound on it for the application I'm building. Again thanks.
  5. Good day everyone. I'm new to the forums. I just wanted to ask if it is possible in javascript to make a script that when a user clicks a button a new textbox will appear. If he clicks again, another textbox will then appear, so on and so forth. Without having to refresh the page everytime he clicks the button or loose any information he has already typed within the textbox/s. If it is, can anyone give a simple script that I can look into. Much thanks for any help.
×
×
  • 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.