Jump to content

Massacres

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Massacres's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Is it possible to send emails to people using PHP? I can go through the database of members email addresses, I just don't know how to mail people using it. Find User ID# in database0 Send User Email [body][attachement] Thats basically all I need to do; and I can do the first part. I just don't know how to send the email.
  2. EDIT: it didn't work; see the bottem. Ideal situation; the underscores removed and replaced with spaces. [code]<?php for ($i=1; $i<101;$i++){       if ($i<10){             echo "_";             }       echo "_",$i;       if ($i % 5 === 0) {             echo "<br>";             }       else{             echo "_";             }       } ?>[/code] Code that didn't work T_T [code]<?php for ($i=1; $i<101;$i++){       if ($i<10){             echo "&nbsp;";             }       echo "&nbsp;",$i;       if ($i % 5 === 0) {             echo "<br>";             }       else{             echo "&nbsp;";             }       } ?>[/code] EDIT It works now haha, wow I'm blind sorry. [code]<?php for ($i=1; $i<101;$i++){       if ($i<10){             echo "&nbsp;","&nbsp;";             }       echo $i;       if ($i % 5 === 0) {             echo "<br>";             }       else{             echo "&nbsp;";             }       } ?>[/code]
  3. \n is counted as whitespace so your browser parses it out. Your browser does the bidding of html :o
  4. Using my knowledge of C/C++ (which is basic) I came up with this, I don't know a way to deal with the whole "We don't want whitespace so we WILL NOT LET YOU HAVE white space", 'thing'. I think it was for bandwidth, some programmers wouldn't get rid of whitespace and it would send useless bits; I want those 'useless' bits. (Sorry my history is a little sketchy). [code]<?php for ($i=1; $i<101;$i++){       echo $i," ";       if ($i % 5 === 0) {             echo "<br>";             }       else{             if ($i<10){                   echo " ";                   }             }       } ?>[/code] Basically I WANT the whitespace so I can make everything even; without tables.
  5. I just had a similar problem. If you view the source code it will display what its supposed to, but it doesn't. The browser reads \n as whitespace. You have to use <br> instead. [code]<?php for ($i = 1; $i < 3; $i = $i + 1) {   for ($j = 1; $j < 4; $j = $j + 1) {       for ($k = 1; $k < 3; $k = $k + 1) {         print "I: $i, J: $j, K: $k<br>";       }   } } ?>[/code]
  6. EDIT2: I got the hunch that maybe I could use the HTML linebreak ( <br> ) and it worked, so I guess I misread your post. Thank you, this is very helpful. It didn't work; or I'm missing something; [color=red][b]Input:[/b][/color] [code]<?php $someStr = 'this has \r\nnewlines \ncha\n\n\nrac\nters in \it!'; echo nl2br($someStr); ?>[/code] [color=red][b]Output[/b][/color] this has \r\nnewlines \ncha\n\n\nrac\nters in \it! EDIT: Didn't mean to send so soon >_< It displays '\n', it just doesn't use it as a linebreak =/
  7. \n in double qoutes [i]should [/i]work, but it doesn't seem to be working. [code]<?php $TF=array("False","True"); echo $TF[("hello"==="hello")]; ?> _blahblah_ <?php echo "\n",$TF[0]; ?>[/code]
  8. [Afterthought]I was pondering how do do it without an if, and I came up with this; [code]<?php $TF=array("False","True"); echo $TF [($Word1===$Word2)]; ?> [/code] Its kind of basic (programming wise) but I thought someone might be interested. EDIT: It stores False and True in spot 0 and 1 of the array. So when you get (0 or 1) with a boolean comparison, you can get the text version of it ^_^
  9. Thank you very much for the help. Answer all my questions and more =D
  10. I just started learning PhP (about half an hour in). Just messing around and making notes. I'm using strpos() to find where a string is in a string. It returns the value of its location, and if it isn't located in it would return no value. You can use it in an if statement as a boolean variable, so I was wondering if I could get it to print out a true/false text output with echo instead of "0, 1, 2, ect.." I also was wondering how I could do a line break in PhP (<br> in html). I made a guess here. C++/C/Turing uses \n to break a line in a string of characters, so I was wondering if there was something similar in PhP? [code] <?php echo strpos('Hello','lo'); break; echo 'test' ?>[/code] Note: The 'test' is just to check if its on the next line.
×
×
  • 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.