Jump to content

.josh

Staff Alumni
  • Posts

    14,780
  • Joined

  • Last visited

  • Days Won

    43

Everything posted by .josh

  1. $this->$page should be $this->page
  2. is this script being included in some other script? because I see you using session variables but no session_start();
  3. Your first post shows that you understand the concept of conditions...
  4. so...it would help if you posted relevant code.
  5. You already posted this question here: http://www.phpfreaks.com/forums/index.php/topic,199885.msg903133.html#msg903133 It was moved to the 3rd party forum because it's a 3rd party script. Please do not make multiple threads asking the same thing. Thread closed.
  6. Well you can't be that much of a purist, suggesting ajax, such and all... Well, what you should be considering is that javascript can be turned off on the user's end, rendering your script useless. The same could be said about ajax.
  7. \n signifies an internal line break for some OS's. You know how when you open up your editor and you write a line of something and then press enter and go to the next line? like: blah blah blah blah more blah blah blah Well that stuff is stored in the file as one string of text, with line breaks like this: blah blah blah blah\nmore blah blah blah But we don't see it like that the computer knows you want to see your two lines of blah. The \n is invisible to us. But the thing is, different OS's use different things to specify end of line, so if you were to try to open a text file in windows that was made in a unix environment for example, you would not get your formatted lines it would be one long line and where the linebreaks are supposed to be, it would show some default character signifying it's a non-printable character, like a black square, or just a plain blank space, or whatever. Most ftp programs will automatically convert the line breaks to the target OS's line break system, transferring them in "ASCII mode." So...my guess is that the person who made the .html page has a different OS than the server and when he uploaded it to the server, for whatever reason, it did not xfer it in ASCII mode so the line breaks did not convert properly. Since the browser ignores and displays \n as a blank space, it looks okay to the eye, and you can highlight, copy/paste and the copy/pasted will indeed just be blank spaces, so it was parsing correctly from that. But if you do a view source on it, the editor knows that \n is a line break, so it shows up formatted as such. Also, when you do a string compare, the get_contents was coming up shorter, because all the blank spaces didn't actually exist, and therefore it wasn't parsing properly. So basically what solved it was to simply replace the \n's with real blank spaces and there you have it.
  8. I think you're making a mountain out of a molehill though. I'd agree if we're talking about thousands of choices in each box or something but people usually don't have anywhere near that many choices, so it's really not a big deal.
  9. You'll want to use ajax if you are wanting to retrieve the selections from a database or flatfile, which is what you will be wanting to do if you plan on wanting to change those selections from time to time for whatever reason. But if you don't plan on changing any of the selection choices, I'd stick with pure javascript, regardless of how many choice/subchoices.
  10. <?php class chalkboard { function writedown ($msg, $num) { for ($x = 1;$x <= $num; $x++) { echo "$x : $msg <br />"; } } } $chalk = new chalkboard(); $chalk->writedown("I will provide more info.", 100); ?>
  11. Okay I got it. <?php $file = file_get_contents ('yourlinkhere'); $file = ereg_replace("\n", " ", $file); $a = explode(' ',$file); // explode each space separated set into an array // for each position in the array... foreach ($a as $b) { $c[] = explode(',',$b); // explode each comma separated set into a nested array, making a 2d array overall }
  12. In your first script posting you had no value=".." in your input fields. The 2nd one you have value="true" What "value" exactly are you trying to find out? You said earlier it's returning "1" well "true" = "1". Look, it's really not that hard to have a checkbox and then have a script check to see if it has been checked: form: <form action = 'somepage.php' method = 'post'> <input type = 'checkbox' name = 'blah' value = 'someval'> check me <br /> <input type = 'submit' value = 'submit'> </form> somepage.php <?php if ($_POST['blah']) { echo "checkbox was checked! checkbox data: {$_POST['blah']}"; } else { echo "checkbox not checked!"; } ?> so...if that's not the issue, then I guess we're not understanding you.
  13. I don't see any value ="blah" in your input fields. Also, == is a condition operator not an assignment operator.
  14. You had a few typos and stuff. There, I fixed it for you.
  15. Gaping sarchasm ftw.
  16. Most people try to pick a name that somehow represents the type of community/product/etc..I bet people might be able to better make suggestions if you told us a little bit about your community system/goals.
  17. $varsendmail = $_POST['varsendmail']; $vartext = $_POST['vartext']; $varemail1 = $_POST['varemail1']; $varemail2 = $_POST['varemail2']; $varemail3 = $_POST['varemail3']; $varemail4 = $_POST['varemail4']; $varemail5 = $_POST['varemail5']; if ($varsendmail) { $to = "$varsendmail,"; } if ($varemail1) { $to .= "$varemail1,"; } if ($varemail2) { $to .= "$varemail2,"; } if ($varemail3) { $to .= "$varemail3,"; } if ($varemail4) { $to .= "$varemail4,"; } if ($varemail5) { $to .= "$varemail5,"; } rtrim($to,',');
  18. okay...i'm stumped. doing strcmp(); on the get_contents vs. a straight string from the output returns -1 meaing the get_contents string is shorter. But when I echo them side by side, it displays the exact same thing. But if I view source from output, get_contents string is formatted different. Each set is on its own line, but there's no line break tags or anything (it's all strung together on the output string source). My next guess is that whatever editor you used to create the html file is using some sort of hidden formatting code or something...but at this point in time I'm just guessing. Or maybe there's a setting on the server that does that. I really don't know. You gave me a link to the page..do you have the actual source file or know what editor was used?
  19. umm okay well i just copy/pasted and tested exactly what you posted, except for I changed $file = ... to just a string of the numbers and it outputs just the 3 vars as expected, so...my guess is that there's something different about link.html can you post the code for link.html
  20. $varsendmail = $_POST['varsendmail']; $vartext = $_POST['vartext']; $varemail1 = $_POST['varemail1']; $varemail2 = $_POST['varemail2']; $varemail3 = $_POST['varemail3']; $varemail4 = $_POST['varemail4']; $varemail5 = $_POST['varemail5']; $to = "$varsendmail, $varemail1, $varemail2, $varemail3, $varemail4, $varemail5";
  21. works just fine for me... repost the code maybe you somehow changed or forgot something
  22. In a capitalist society, the central focus on laws is to make an extra buck. Their interest in keeping people safe only extends as far as keeping customers alive because dead men can't pay. So what's 'morally' right doesn't really apply most of the time.
  23. oops it seems you said each "set" is separated by spaces not commas. All you have to do is move the comma in the first explode to the 2nd explode $a = explode(' ',$content); // explode each comma separated set into an array // for each position in the array... foreach ($a as $b) { $c[] = explode(',',$b); // explode each space separated set into a nested array, making a 2d array overall }
  24. yes, you can use a text file as an alternative to a database.
×
×
  • 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.