Jump to content

Jragon

Members
  • Posts

    148
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Jragon

  1. This is what i have done so far: <?php function crypty($string){ $search = array('Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M', 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm'); $replace = array('W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'V', 'B', 'N', 'M', ' ', 'Q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a' 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm', 'q'); $subject = $string; $output = str_replace($search, $replace, $subject); return $output; } $encypt = 'Hello' echo crypty($encrypt); ?> but there an error: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in C:\xampp\htdocs\cript.php on line 4
  2. QAZ = WSX WSX = EDC EDC = RFV RFV = TGB TGB = YHN UJM = IK OLP = QAZ
  3. Hello People, I need a little help in making my own encryption thingy. It wont be used for sucuraty I'm just doing this so i can broden my knowage of php. What my encryption will do: QAZ = WSX WSX = EDC EDC = RFV RFV = TGB TGB = YHN . . . I was wondering if someone could point me in the right direction? Thanks Jragon
  4. Thats cool! is there anyway to change the text color cos its a little hard to read
  5. This is mine <html> <head> <title>Hats</title> <style type="text/css"> th { background-color: #999;} .odd_row { background-color: #EEE; } .even_row { background-color: #FFF; } </style> </head> <body> <table border="0"> <tr> <th>Number</th> <th>Monday</th> <th>Tuseday</th> <th>Wesnesday</th> <th>Thesday</th> <th>Friday</th> </tr> <?php /* Rules: 1 hat must be worn all day A hat must be worn every weekday Cant change hat once put on in the moring Mathmatical Statment 4*4*4*4*4 = 1024 What is going to happen: Every statment will be echoed out E.G: <table> <tr> <th>Monday</th> <th>Tuseday</th> <th>Wesnesday</th> <th>Thesday</th> <th>Friday</th> </tr><tr> <td>Pink</td> <td>Brown</td> <td>Blue</td> <td>Red</td> <td>Red</td> </tr> </table> */ $hats = array('pink','brown','blue','red'); $i = 1; foreach($hats as $hat1) { foreach($hats as $hat2) { foreach($hats as $hat3) { foreach($hats as $hat4) { foreach($hats as $hat5) { echo ($odd == true) ? '<tr class="odd_row">' : '<tr class="even_row">'; echo <<<ENDHTML <td>{$i}</td> <td>{$hat1}</td> <td>{$hat2}</td> <td>{$hat3}</td> <td>{$hat4}</td> <td>{$hat5}</td> </tr> ENDHTML; $odd = !$odd; $i++; } } } } } ?> </table> </body> </html> Thanks for the help Jragon
  6. where should i put the PHP_eol in my table? also what dose that function do(i cant find it on the manual)
  7. Also when i am trying to add numbers to it i get this error Parse error: syntax error, unexpected $end in C:\xampp\htdocs\mathstatment.php on line 56 my code: $hats = array('pink','brown','blue','red'); $i = 1; foreach($hats as $hat1) { foreach($hats as $hat2) { foreach($hats as $hat3) { foreach($hats as $hat4) { foreach($hats as $hat5) { echo $i . $hat1 . " " . $hat2 . " " . $hat3 . " " . $hat4 . " " . $hat5 . PHP_EOL . '<br />'; $i++; } } } }
  8. Why would you be afraid of showing me?
  9. How should i incorperate that in to a table that has the days of the week as headings and numbers down the side? Also how dose this work?
  10. My code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>What would you like to be said over and over agien?</title> </head> <body> <h1>What would you like to be said over and over agien?</h1> <h6>By Rory Anderson!</h6> <?php if(isset($_POST['submit'])){ if(is_int($_POST['times'])){ for($i=0; $i <= $_POST['times']; $i++){ echo $_POST['text']; echo '<br />'; } }else{ echo <<<ENDHTML <form method="post" action=""> <h2>What would you like to be said:</h2> <br /> <input type="text" name="text" value="$_POST['text']"/> <br /> <h2>How many times would you like it to be said:</h2> <br /> <input type="text" name="times"/> <br /> <input type="submit" value="say!" name="submit"/> </form> <h2>Please enter a number in the How many times would you like it to be said box</h2> ENDHTML; } }else{ echo <<<ENDHTML <form method="post" action=""> <h2>What would you like to be said:</h2> <br /> <input type="text" name="text"/> <br /> <h2>How many times would you like it to be said:</h2> <br /> <input type="text" name="times"/> <br /> <input type="submit" value="say!" name="submit"/> </form> ENDHTML; } ?> </body> </html> My Error: unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING when i submit something but with the times bit as a 'A' it comes up with this
  11. I saw that but it did not make much sense. Its working now. Thakns
  12. I have changed it to: if(isset($_POST['submit'])){ for($i=0; $i >= $_POST['times']; $i++){ echo $_POST['text']; echo '<br />'; } But I'm still getting nothing
  13. sort ov. the first paragraph is almost correct eddited verstion: In mathematics, the notion of permutation is used with several slightly different meanings, all related to the act of permuting (rearranging in an ordered fashion) objects or values. Informally, a permutation of a set of values is an arrangement of those values into a particular order. Thus there are six permutations of the set {1,2,3}, namely [1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], [3,2,1], [3,3,3], [2,2,2], [1,1,1], [3,3,2], [3,2,3] ECT.
  14. It is going to make a table with a differnt color hat worn every day.
  15. In this little script all i am getting is the headings <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>What would you like to be said over and over agien?</title> </head> <body> <h1>What would you like to be said over and over agien?</h1> <h6>By Rory Anderson!</h6> <?php if(isset($_POST['submit'])){ for($i=0; $i >= $times; $i++){ echo $text; echo '<br />'; } }else{ echo <<<ENDHTML <form method="post" action=""> <h2>What would you like to be said:</h2> <br /> <input type="text" name="text"/> <br /> <h2>How many times would you like it to be said:</h2> <br /> <input type="text" name="times"/> <br /> <input type="submit" value="say!" name="submit"/> </form> ENDHTML; } ?> </body> </html> when i sumit it nothing happens exsept the headings
  16. No. Because I'm lasy and dont want to make a table my self for each differnt time. I want php to do it for me using somthing like a while loop or a for loop in the end it would make somthing like this: <table> <tr> <th>Monday</th> <th>Tuseday</th> <th>Wesnesday</th> <th>Thesday</th> <th>Friday</th> </tr><tr> <td>Pink</td> <td>Brown</td> <td>Blue</td> <td>Red</td> <td>Red</td> </tr><tr> <td>pink</td> <td>pink</td> <td>pink</td> <td>pink</td> <td>pink</td> </tr> <tr> <td>blue</td> <td>blue</td> <td>blue</td> <td>blue</td> <td>blue</td> </table> ect. But i have no idea how to do this
  17. Thanks mate =] I can now program in pece
  18. Still not working My error: Parse error: syntax error, unexpected T_SL in C:\xampp\htdocs\whattosay.php on line 18
  19. It says what i want to happen
  20. <html> <head> <title>Hats</title> </head> <body> <?php /* Rules: 1 hat must be worn all day A hat must be worn every weekday Cant change hat once put on in the moring Mathmatical Statment 4*4*4*4*4 = 1024 What is going to happen: Every statment will be echoed out E.G: <table> <tr> <th>Monday</th> <th>Tuseday</th> <th>Wesnesday</th> <th>Thesday</th> <th>Friday</th> </tr><tr> <td>Pink</td> <td>Brown</td> <td>Blue</td> <td>Red</td> <td>Red</td> </tr> </table> */ $hat1 = 'Pink'; $hat2 = 'Brown'; $hat3 = 'Blue'; $hat4 = 'Red'; $odd = true; while ($num <= 1024){ } ?> </body> </html> If you reed the notes it says what i want to do If anyone has any ideas how i can do this it would be cool Thanks Jragon
  21. Just got a little error with my heredoc thing: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>What would you like to be said over and over agien?</title> </head> <body> <h1>What would you like to be said over and over agien?</h1> <h6>By Rory Anderson!</h6> <?php if(isset($_POST['submit'])){ for($i=0; $i >= $times; $i++){ echo $text; } }else{ $form = null; $form .= <<<ENDHTML <form method="post" action=""> <h2>What would you like to be said:</h2> <br /> <input type="text" name="text"/> <br /> <h2>How many times would you like it to be said:</h2> <br /> <input type="text" name="times"/> <br /> <input type="submit" value="say!" name="submit"/> </form> ENDHTML; } ?> </body> </html> <?php for($i=0; $i >= $times; $i++){ echo $text; } ?> The syntax highlithgting says that there is somthing wrong with it? Please tell me what is wrong with it Thanks JRagon
  22. Hey, I was wondering how i could make a form that when submited it would stay on the same page but skip to the php bit# Idea: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>What would you like to be said over and over agien?</title> </head> <body> IF DATA ALLL READY EXITS DONT EXACUTE <h1>What would you like to be said over and over agien?</h1> <h6>By Rory Anderson!</h6> <form action="" method="post"> <h2>What would you like to be said:</h2> <br /> <input type="text" name="text"/> <br /> <h2>How many times would you like it to be said:</h2> <br /> <input type="text" name="times"/> <br /> <input type="submit" value="say!"/> </form> IF DATA DOSE NOT EXIST DONT EXACUT <?php for($i=0; $i >= $times; $i++){ echo $text; } ?> </body> </html> Thanks Jragon
×
×
  • 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.