
nutt318
Members-
Posts
76 -
Joined
-
Last visited
Never
Everything posted by nutt318
-
[SOLVED] Upgraded to php5 and now mail() not working
nutt318 replied to nutt318's topic in PHP Coding Help
nevermind, someone else got it I guess -
[SOLVED] Upgraded to php5 and now mail() not working
nutt318 replied to nutt318's topic in PHP Coding Help
where is the solved button? -
[SOLVED] Upgraded to php5 and now mail() not working
nutt318 replied to nutt318's topic in PHP Coding Help
PFMaBiSmAd, Thanks for the help, that worked. -
[SOLVED] Upgraded to php5 and now mail() not working
nutt318 replied to nutt318's topic in PHP Coding Help
Ok, here is the entire code I'm using, I am setting the variables unless this is the wrong way of doing it. <?PHP # Only edit the following lines $redirecturl="http://www.mysite.com"; # Where you're sent after submitting the contact form $subject="mysite - Customer Question"; # Subject of the email message $waitmessage="Please Wait. Sending Information. You will now be redirected back to the homepage."; # Message shown to user while emailing their info $ToEmail="[email protected]"; # Enter email address in between $name = $HTTP_POST_VARS['userName']; $email = $HTTP_POST_VARS['userEmail']; # $phone = $HTTP_POST_VARS['userPhone']; # $subject2 = $HTTP_POST_VARS['userSubject']; $message = $HTTP_POST_VARS['userMessage']; # if (!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/", $email)) { # echo "<h4>Invalid Email Address</h4>"; # echo "<a href='javascript:history.back(1);'>Back</a>"; $msg = "Name: $name \n"; $msg = "E-Mail Address: $email \n"; $msg = " \n"; $msg = "$message \n"; $headers = "From: $name<$email>"; echo' <HTML><HEAD><TITLE>' . $waitmessage . '</TITLE> <META HTTP-EQUIV="refresh" CONTENT="3;url=' . $redirecturl . '">'; mail ($ToEmail, $subject, $msg, $headers); echo ' <CENTER>' . $waitmessage . ' <P> </P> '; ?> -
So I have hosting with godaddy and I updgraded my php4 to php5 due to a joomla extension needing php5. Anyways after upgrading some of my other sites mail() sending is no longer working. It acts like it sends the mail but I never receive the message. I'm guessing some properties changed on how the mail() function works but have been searching forums and google and havent found anything. I have been playing around with it and its something to do with the message part. It not showing the varibles properly and cant find any examples. $msg = "Name: $name \n"; $msg = "E-Mail Address: $email \n"; $msg = " \n"; $msg = "$message \n"; $headers = "From: $name<$email>"; echo' <HTML><HEAD><TITLE>' . $waitmessage . '</TITLE> <META HTTP-EQUIV="refresh" CONTENT="3;url=' . $redirecturl . '">'; mail ($ToEmail, $subject, $msg, $headers); Thanks for the help, if possible can someone provide an example on how to make this work?
-
I am working on a site and for some reason my flash header has 6 text feilds that I have change the text. When viewing the site in firefox it shows this newly changed text correctly. However when in IE or Chrome it still shows the old text. Any ideas why firefox displays this correctly and the others do not? Thanks for the help.
-
So I should start googling PreHypertext Processing?
-
This may be a stupid question but is there a way in PHP to have content on the page and then by clicking a button it would show another piece of content without refreshing? For example in gmail, you have have a gchat window open and still go into spam, inbox, even compose a new email. Basically my site has a live video feed on it and i want to have an image show up below the live stream when clicking a button, only problem is that the ways doing this just refreshes the page and the feed has to be started again. Hopefully I explained this without too much confusion. Thanks,Jake
-
I'm out of ideas, does anyone have any suggestions? I've been change different things and googling the crap out of it but nothing. Thanks.
-
The below code works with only one mapping for a button. When I add the second map for another Hotspot on the same image it executes both PHP scripts. Is there something that I have out of place? Just need some help getting this thing to work right. Thanks. <body> <img src="control.png" width="600" height="350" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="rect" coords="42,9,104,30" href="#" onclick="javascript:document.frm1.submit();" /> <area shape="rect" coords="6,35,68,56" href="#" onclick="javascript:document.frm2.submit();" /> </map> <?php if($_POST['Submit']){ $open = fopen("commands.dat","a+"); $text = "81\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/control.php']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"hidden\" value=\"Submit\" />\n </form>"; ?> <?php if($_POST['Submit']){ $open = fopen("commands.dat","a+"); $text = "82\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm2' action=\"".$_SERVER['http://mysite.com/wordpress/control.php']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"hidden\" value=\"Submit\" />\n </form>"; ?> </body>
-
I've been trying different ways to format this code and its still not working, I tried changing the form name in the sumbit button but that doesnt seem to work. Is something out of place? Thanks.
-
Well I thought I had the code right but it does all 4 php commands. Is there something out of place? Do I need the map id different? <img src="control.png" width="600" height="350" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="rect" coords="43,8,105,29" href="#" onclick="javascript:document.frm1.submit();" /></map> <map name="Map" id="Map"> <area shape="rect" coords="6,35,68,56" href="#" onclick="javascript:document.frm2.submit();" /></map> <map name="Map" id="Map"> <area shape="rect" coords="80,35,142,56" href="#" onclick="javascript:document.frm3.submit();" /></map> <map name="Map" id="Map"> <area shape="rect" coords="48,63,102,83" href="#" onclick="javascript:document.frm4.submit();" /></map> <?php if($_POST['Submit']){ $open = fopen("commands.dat","a+"); $text = "81\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/control.php']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"hidden\" value=\"Submit\" />\n </form>"; ?>
-
Well, it doesnt seem to work right. Do I have something wrong again? <body> <img src="control.png" width="600" height="350" border="0" usemap="#Map" /> <map name="Map" id="Map"> <area shape="rect" coords="43,8,105,29" href="http://www.mysite.com/wordpress/control.php" onclick="javascript:document.frm1.submit100();" /> <area shape="rect" coords="6,35,68,56" href="http://www.mysite.com/wordpress/control.php" onclick="javascript:document.frm1.submit101();" /> <area shape="rect" coords="80,35,142,56" href="http://www.mysite.com/wordpress/control.php" onclick="javascript:document.frm1.submit102();" /> <area shape="rect" coords="48,63,102,83" href="http://www.mysite.com/wordpress/control.php" onclick="javascript:document.frm1.submit103();" /> </map> <?php if($_POST['Submit100']){ $open = fopen("commands.dat","a+"); $text = "81\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/control.php']."\" method=\"post\">"; echo "<input name=\"Submit100\" type=\"hidden\" value=\"Submit100\" />\n </form>"; ?> <?php if($_POST['Submit101']){ $open = fopen("commands.dat","a+"); $text = "82\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/?page_id=3']."\" method=\"post\">"; echo "<input name=\"Submit101\" type=\"hidden\" value=\"Submit101\" />\n </form>"; ?> <?php if($_POST['Submit102']){ $open = fopen("commands.dat","a+"); $text = "85\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/?page_id=3']."\" method=\"post\">"; echo "<input name=\"Submit102\" type=\"hidden\" value=\"Submit102\" />\n </form>"; ?> <?php if($_POST['Submit103']){ $open = fopen("commands.dat","a+"); $text = "84\n"; fwrite($open, $text); fclose($open); } echo "<form name='frm1' action=\"".$_SERVER['http://mysite.com/wordpress/?page_id=3']."\" method=\"post\">"; echo "<input name=\"Submit103\" type=\"hidden\" value=\"Submit103\" />\n </form>"; ?> </body>
-
Very Cool, Thanks samshel!
-
Well I have an image with a bunch of buttons and I want to be able to use a hotspot to act as a button to execute some PHP. I have the following but I am in need of some direction. As you can see the image is there and the first hotspot is on the Add Address. When I put my php code in it just creates a normal button. Is there a different spot I need my php code or a differway to complete this? Thanks. <body> <img src="buttons_osc1.gif" width="500" height="305" border="0" usemap="#Map" /> <map name="Map" id="Map"><area shape="rect" coords="56,12,181,33" href=" <?php if($_POST['Submit']){ $open = fopen("hello.txt","a+"); $text = "hello\n"; fwrite($open, $text); fclose($open); } echo "<form action=\"".$_SERVER['http://mysite.com/wordpress/?page_id=3']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"submit\" value=\"hello\" />\n </form>"; ?>" /></map> </body>
-
[SOLVED] If this AND this statment - not working
nutt318 replied to nutt318's topic in PHP Coding Help
rhodesa, Thanks for the help help. It was the '||' that fixed it. Thanks -
I want to make sure that the password and email field are Equal To the stored info. For some reason I can enter in just the password and it works. It seems to skip the Equal To for the email Also, my code doesnt work with '==' but works with '<>', is there a reason for that? Thanks for your help. <? } /* END FUNCTIONS */ $errormsg=''; if (substr($_SERVER['REQUEST_URI'],-7)!='control.php') {// if someone tries to request sas.php if (isset($_POST['sub'])) { // if form has been submitted $submitted_pass=md5($_POST['password']); // encrypt submitted password $submitted_email=($_POST['email']); //if ($submitted_email<>$encrypt_email) if ($submitted_pass <> $encrypt_pass && $submitted_email <> $encrypt_email) { // if password is incorrect $errormsg=$msg; show_login_page($errormsg); exit(); } else { // if password is correct setmycookie(); } } else { if (isset($_COOKIE[$cookiename])) { // if cookie isset if ($_COOKIE[$cookiename]==$encrypt_pass) { // if cookie is correct // do nothing } else { // if cookie is incorrect show_login_page($errormsg); exit(); } } else { // if cookie is not set show_login_page($errormsg); exit(); } } } else { echo 'Try requesting control.php'; } ?>
-
Is there such thing as a timer or only page refresh time limit?
nutt318 replied to nutt318's topic in PHP Coding Help
So using Javascript can act as a timer and say every 5mins the timer will run my code to log them out? -
Well I a page that requires a password to view the contents. Once a user logs in with this password the page times out after 5 minutes and prompt them to reenter their password. So how would I make this page after those 5 mins run another php function? Is there some sort of timer I can have that runs every 5mins without someone actually being on the page? Thanks for your help.
-
And I was so close to figuring it out, I just needed the . (dot) Thanks Printf
-
I am pulling $email from another page and it stores it in the variable and the below command does work and write to the file. My problem is how do I make the following code do a new line after the $text? I know that if it was just normal text i could do "my text here \n" Which works, but I have this variable and I need it to do the same. But the \n doesnt work after my variable. Is there another option or way to do this? Thanks $open = fopen("email.txt","a+"); $text = $email; fwrite($open, $text); fclose($open);
-
Well I want a simple form on my site that a user can input their email address and then hit submit. Once they hit the submit button I also want it to create a generic password and write the email address and generic password to a text file on my site. Anyways I have the following code, It generates the password but im not sure how to post the information to a text file including the generic password. <?php /** * The letter l (lowercase L) and the number 1 * have been removed, as they can be mistaken * for each other. */ function createRandomPassword() { $chars = "abcdefghijkmnopqrstuvwxyz023456789"; srand((double)microtime()*1000000); $i = 0; $pass = '' ; while ($i <= 7) { $num = rand() % 33; $tmp = substr($chars, $num, 1); $pass = $pass . $tmp; $i++; } return $pass; } // Usage $password = createRandomPassword(); echo "Your random password is: $password"; ?> <form action="signup2.php" method="post" name="signup"> <p>E-mail Address: <input name="email" type="text" /> <input name="submit" value="Sign Up" class="submit-button" type="submit" /> </p> </form> Thanks for your help.
-
Thanks for the link mat-tastic.
-
Well it looks like I need to look at AJAX then. Is there a certain section or functions that I should be looking at in order to duplicate the PHP code? Thanks guys.
-
I have the following code when clicking the button in modifies a text file. Is there a way that I can click the button without the page refreshing? Basically there is a video feed on this same page and i have to restart it when clicking the button because it refreshes the page. <?php if($_POST['Submit']){ $open = fopen("test.txt","a+"); $text = "Left\n"; fwrite($open, $text); fclose($open); } echo "<form action=\"".$_SERVER['PHP_SELF']."\" method=\"post\">"; echo "<input name=\"Submit\" type=\"submit\" value=\"Left\" />\n </form>"; ?> Can I use a frame or a different type of php code? Thanks.