Jump to content

sumolotokai

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

sumolotokai's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks very much ! I used a mixture of the two solutions.
  2. Hello, I am having issues creating a birthday countdown script. I have tried all sorts of things as you can see. It seems that am only one step away from success but am missing something. If i have done something completely stupid, please just point me in the right direction. Sorry for the mess... $x = $_POST["name"]; if (strstr($x,"-2")) { echo "There are $x days until your birthday";} else { echo "Your date of birth is not in the correct format, please press backwards and try again.";} $y = explode("-", $x); $mydob = mktime(0,0,0,$y[1],$y[0],$y[2]); print $mydob; echo date("d/m/y", $mydob); $today = time(); settype($mydob, 'integer'); settype($today, 'integer'); echo "<br>"; print $mydob - $today; $remain = $mydob - $today; echo "<br>"; print $mydob; echo "<br>"; print $today; echo "<br>"; print date($remain); echo "<br>"; print $remain; echo "<br>"; echo "There are..." . date("m/d/y g.i:s",$remain)
  3. aha i was using wamp in the wrong way... sorry for wasting your time i will try not to do this again
  4. Thanks for the quick response. I made the amendment and am still seeing this error. this is how the script reads now. $name = $_POST[name]; $name = ucwords($name); echo "<p>Thank you, <b>$_POST[name]</b>, for your message!</p>"; echo "<p>Your e-mail address is: <b>$_POST[email]</b>.</p>"; echo "<p>Your message was:<br>"; echo "$_POST[message] </p>";
  5. Hi, I am trying to capitalize the input from an incoming email form and have been unable to do it. The browser merely tells me there is a parse error. Thanks in advance. <?php $name = $_POST[name]; $name = ucwords($name); echo "<p>Thank you, <b>$_POST[name]</b>, for your message!</p>";} echo "<p>Your e-mail address is: <b>$_POST[email]</b>.</p>"; echo "<p>Your message was:<br>"; echo "$_POST[message] </p>"; ?>
  6. Brilliant! Thanks very much. It didnt occur to me that you would have to use the method again.
  7. Hi, I have been staring at this for an hour and am confused. It is apparent that addcalc is unable to access the properties of basecalc but I am unsure why? Probably a quick one. Thanks in advance! (basecalc works, i checked) class basecalc { var $n1 = '5'; var $n2 = '6'; function calculator() { echo $this ->n1.$this ->n2;}} $hello = new basecalc(); $hello -> calculator(); class addcalc extends basecalc { echo $this -> n1 + $this -> n2;} $hello = new addcalc; $hello -> calculator();
  8. Hi again, I have written the code below to create a function with four arguments that returns a string that contains a table element. This will contain each of the variables in its own cell. I was wondering, is this the best way to do it and if not, what is? <?php function x ($a, $b, $c, $d) { echo "<table border=\"1\" cellpadding=\"4\" cellspacing=\"4\">\n"; echo "<tr><td>$a</td></tr>"; echo "<tr><td>$b</td></tr>"; echo "<tr><td>$c</td></tr>"; echo "<tr><td>$d</td></tr></table>"; } echo x ('bert', 'ernie', 'geoff', 'pat'); ?> Thanks in advance Sumo
  9. Thanks for all the help!!! It is starting to make a bit more sense, time to continue
  10. Ahhh, I see. Hopefully I will have more luck here, thanks for moving it.
  11. hello again, I dont really understand why people are viewing this and not responding. I know it is a silly question. 8: function tagWrap( $tag, $txt, $func="" ) { 9: if ( ! empty( $txt ) && function_exists( $func ) ) { 10: $txt = $func( $txt ); 11: return "<$tag>$txt</$tag>\n"; 12: } 13: } 14: 15: function underline( $txt ) { 16: return "<u>$txt</u>"; 17: } 18: 19: print tagWrap('b', 'make me bold'); 20: // <b>make me bold</b> 21: 22: print tagWrap('i', 'underline me too', "underline"); 23: // <i><u>underline me too</u></i> 24: 25: print tagWrap('i', 'make me italic and quote me', 26: create_function('$txt', 'return ""$txt"";')); 27: // <i>"make me italic and quote me"</i> 28: I have found the code online and here it is above! my query again, what does line 10 do? I cant bring myself to skip this and carry on. I have been stuck on this one line for 72 hours!
  12. Hi, Any help with this would be much appreciated, I have racked my brains but to no avail. I am new to all this (3 weeks experience). I am working through a book at the mo and this code popped up function tagwrap($tag, $txt, $func = " ") { if ((!empty($txt)) && (function_exists($func))) { $txt = $func($txt); return "<$tag>$txt</$tag>\n"; } } I am happy with what it does but not how it does it. what does this do? $txt = $func($txt); Thanks in advance.
×
×
  • 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.