Jump to content

env3rt

Members
  • Posts

    68
  • Joined

  • Last visited

    Never

Everything posted by env3rt

  1. Lol, I went into phpmyadmin and I can't even figure out how to create a damn table nvm found out how after 5 mins
  2. Fine, I'll go learn about them Although my host only allows one
  3. I've avoided using mySQL tables do you have to use them?
  4. I've tried googling it and can't find much maybe you could find something
  5. How do you check who is currently viewing your site like on this forum it says : 51 guests viewing and users etc... And how can you check when they leave? (Please no databases)
  6. Oh, so how could I get it to work without using the submit button?
  7. <form method="post" action="wherever u saved the .php file"> <input name="fromemail" type="text" /> <input name="toemail" type="text" /> <input name="subject" type="text" /> <textarea name="mainbox"></textarea> <input type="submit"> </form> You could replace the toemail input with a dropdown menu You could also set the fromemail to whatever you wanted using <input name="fromemail" type="hidden" value="example@example.com" /> This would say that you recieved an email from example@example.com
  8. In the form for the code you can type whatever email you want.
  9. <?php $subject = $_POST['subject']; $fromemail = $_POST['fromemail']; $toemail = $_POST['toemail']; $mainbox = $_POST['mainbox']; mail( "$toemail", "$subject", "$mainbox", "From: $fromemail" 'Reply-To: $fromemail' ); header( "Location: whatever site u want" ); ?> This is a much more simple code. (the form is not included but it is very easy to make)
  10. I could make them click the button but I want it to submit even if they don't click it, and the submit fuction with javascript doesnt work
  11. The problem is that when I have javascript automatically submit the form, the php doesn't work, but when I press the submit button it works perfectly. Does anyone know what I am doing wrong? Code is below. <?php echo " <head> <script> function yes(){ document.sform.submit() } </script> </head> <body onKeypress='yes()'> <form method='post' action='?' name='sform' id='sform'> <input type='text' id='this' name='this'> <input type='submit' id='subform' name='subform' value='subform'> </form> </body> "; if ($_POST['subform']){ $page = "expage.html"; $fh = fopen($page, 'w'); $example = $_POST['this']; fwrite($fh, $example); fclose($fh); echo "<script>alert('form submitted')</script>"; } ?> Please help if you can.
  12. I wanted javascript to call php not php to call javascript
  13. Sorry, I saw people bumping earlier tons of times so I thought it was allowed, how could you doing it with Ajax, example please
  14. Is it possible to use a javascript event (ex: onUnload()) and combine it with php so it would be weird but maybe something like this <?php echo " <head> <script> function suber() {"; // EXAMPLE BELOW $expage="expage.html"; $fh = fopen($expage, 'w'); $expagewriting = "hey"; fwrite($fh, $expagewriting); fclose($fh); //EXAMPLE ABOVE echo " } </script> </head> <body onUnload='suber()'></body>"; ?> If you don't understand or can help please post
  15. <?php include ("num.php"); If ($question) { $result = Rand (1,6); $num1 = $num1 + $result; if ($result ==1) { Echo "1"; } if ($result ==2) { Echo "2"; } if ($result ==3) { Echo "3"; } if ($result ==4) { Echo "4"; } if ($result ==5) { Echo "5"; } if ($result ==6) { Echo "6"; } } echo "<br>".$num1; ?> Inside num.php is $num1 = 0; so it wont reset each time but it's still not working
  16. Ok this is what I want: If the random number is five, I want it to add 5 to the total number, add 1 for 1, 2 for 2 etc..
  17. There is probably a realy simple solution to this but I can't find it I need the $num1 to go up each time instead of switching to the number I put it to. <? $num1 = 0; $result = Rand (1,6); if ($result ==1) { Echo "1"; $num1 += 1; } if ($result ==2) { Echo "2"; $num1 += 2; } if ($result ==3) { Echo "3"; $num1 += 3; } if ($result ==4) { Echo "4"; $num1 += 4; } if ($result ==5) { Echo "5"; $num1 += 5; } if ($result ==6) { Echo "6"; $num1 += 6; } } echo "<br>".$num1; ?> Post if you don't understand problem or you can help.
  18. yea whatever, they aren't neccessary
  19. Correct solution: str_ireplace (but I don't have PHP 5) My solution: strtolower(); (Although there are other methods this was easiest)
  20. I don't understand preg_replace, well I do but not how I could use it to help, unless I switched all the caps letters to non caps
  21. Lol I have been using that all along but it is case sensitive and I don't want it to be, so they suggest str_ireplace but I have php 4
×
×
  • 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.