env3rt
Members-
Posts
68 -
Joined
-
Last visited
Never
Everything posted by env3rt
-
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
-
Fine, I'll go learn about them Although my host only allows one
-
I've avoided using mySQL tables do you have to use them?
-
I've tried googling it and can't find much maybe you could find something
-
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)
-
Omg thanks finally
-
Oh, so how could I get it to work without using the submit button?
-
<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
-
In the form for the code you can type whatever email you want.
-
<?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)
-
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
-
bump
-
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.
-
Yea that's what I was thinking.
-
I wanted javascript to call php not php to call javascript
-
Sorry, I saw people bumping earlier tons of times so I thought it was allowed, how could you doing it with Ajax, example please
-
bump bump bump
-
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
-
<?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
-
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..
-
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.
-
yea whatever, they aren't neccessary
-
Correct solution: str_ireplace (but I don't have PHP 5) My solution: strtolower(); (Although there are other methods this was easiest)
-
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
-
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