Jump to content

11Tami

Members
  • Posts

    329
  • Joined

  • Last visited

    Never

Everything posted by 11Tami

  1. Thanks very much but are you serious? Isn't there a way that anyone knows of? I was trying to avoid preg_match I hate using it, and loved what preg_grep was doing. Can the other of you coders confirm this? I really don't want to go back to preg_match, please let me know, thanks a lot.
  2. Thanks, yes it works fine like that and with file_get_contents all by itelf, but if I insert it as an else after preg_grep it no longer works and don't know why.
  3. Thanks very much it doesn't need to match at the end, but still have a problem. If it finds an image it shows the image, but if there is no image it is supposed to pull the file http://www.website.com/textfile.txt at a real web site address. But its not, its only pulling the images not the file http://www.website.com/textfile.txt . Can someone please tell me what's wrong with my else? Thanks. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $content = Array(); $content[1] = "http://www.website.com/textfile.txt"; $content[2] = "<img src='http://www.website.com/thatfile.gif'/>"; $content[3] = "<img src='http://www.website.com/thisfile.jpg'/>"; $contenttimer = date("s")%count($content)+1; if (preg_grep('/(?:jpg)|(?:gif)/', $content)) {$gcontent = $content[$contenttimer]; echo $gcontent;} else { $gcontent = file_get_contents($content[$contenttimer]); echo $gcontent;} ?>
  4. That was it btherl thanks! I'll send you something. Thanks everybody for helping too.
  5. Hello, how do I add more than one type of image file to preg_grep for example this is working code for looking for a jpg. How to get it to look for a gif as well. $get = preg_grep('/jpg/', $content); I tried variations of this and didn't have any luck looking for jpg or gif. $get = preg_grep('/jpg/||/gif/', $content); Can someone tell me the correct way to list both? Thanks very much.
  6. Thanks, so most agree the session only lasts for one visit? How would it identify those logging in each time if it ends after each visit? Please let me know, thanks very much.
  7. Whats the difference between a session and a cookie? Please let me know, thanks very much.
  8. Thanks a lot, I sort of tried that but it wants the .gif in an image format, and I don't know where to put it. Also I don't think I can use file_get_contents with a .gif because I believe thats just for web page files unless I'm mistaken. Anyone know how to add the .gif? Thanks very much.
  9. That simplifies it alot Madtechie, any way I can add a .gif to it? My other one I could add .gifs to but the array wasn't numbered would like to keep the array numbered. I looked at yours inside and out and can't figure out how. Pretty sure I don't need to merge two arrays, I just need to break off a .gif from the rest somehow. Thank very much, I hope your still out there, your helping a lot.
  10. ok thanks I'll get started, if anyone knows of a way to do it similar to the above already, please let me know.
  11. Thanks very much, the page is already refreshing the page another way. Can't I just get some text to show if it happens to be a certain second as long as a page is refreshing?
  12. Thanks, I'm not updating the browser, a page refresh is being done. Its to change to a new second only on the second that the page refreshes or loads. At second 1 I need it to be should be showing "testone" etc. one at a time, not all at seconds at once. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $a = date('s'); $maximum=10; $text = Array(); $text[1] = "testone"; $text[2] = "testtwo"; $text[3] = "testthree"; $text[4] = "testfour"; $text[5] = "testfive"; $text[6] = "testsix"; $text[7] = "testseven"; $text[8] = "testeight"; $text[9] = "testnine"; $text[10] = "testten"; $text++; for($i=0;$i<$maximum;$i++) echo $text[i].$a; ?>
  13. Sure am, also forgot to put this right above the array, thanks. $text = Array(); <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $a = date('s'); $maximum=10; $text = Array(); $text[1] = "test1"; $text[2] = "test2"; $text[3] = "test3"; $text[4] = "test4"; $text[5] = "test5"; $text[6] = "test6"; $text[7] = "test7"; $text[8] = "test8"; $text[9] = "test9"; $text[10] = "test10"; $text++; while($maximum>10){$text[1];} echo "$text[a]" ?>
  14. Thanks very much, its not working, its pulling them all. I should be able to have one appear on the second, but there is no room for the $a variable in the echo, anyone know? Thanks.
  15. Hi, how do I make this go from one item to the next every second? It's not liking the end of my code. Please let me know, thanks very much. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $a = date('s'); $maximum=10; $text[1] = "test1"; $text[2] = "test2"; $text[3] = "test3"; $text[4] = "test4"; $text[5] = "test5"; $text[6] = "test6"; $text[7] = "test7"; $text[8] = "test8"; $text[9] = "test9"; $text[10] = "test10"; $text++; while($maximum>10){$text[1];} echo "$text[a]" ?>
  16. Thank you, the code isn't reading the array number. Here's the rest. Its supposed to go from one item in the array to the next on each visit. Anyone know why this code isn't reading the array numbers to select the next item? Thanks a lot. <?php $maximum = 2; $a = (isset($_COOKIE['e']) && intval($_COOKIE['e']) < $maximum)? intval($_COOKIE['e'])+1 : 1; setcookie("e", $a, time()+60*60*24*180); $currentFile = $a; $allfiles = Array(); $allfiles[1] = "thisfile.txt"; $allfiles[2] = "thatfile.html"; foreach($allfiles as $file): if(preg_match("/".$currentFile."\.txt/","/".$file."\.txt/")): $file_content = file_get_contents($file); break; elseif(preg_match("/".$currentFile."\.html/","/".$file."\.html/")): $file_content = file_get_contents($file); break; endif; endforeach; echo $file_content; exit(); ?>
  17. Hello, how would I convert an array like this: $thesefiles = array('something1.txt','another2.txt','3.txt'); Into an array where numbers are put into the array instead. I tried this but it doesn't work. $thesefiles = new Array(); $thesefiles [1] = ["something1.txt"]; $thesefiles [2] = ["another2.txt"]; $thesefiles [3] = ["3.txt"]; Please let me know how to number the array in php. Thanks very much.
  18. Thanks for all your great help~! ballhogjoni Turned out I was missing the tiny dots here!!! $headers . after the header variables. Works great now. Thanks again for being so nice and helpful! Tami
  19. Thanks, how are they able to click on your link, I don't see a link. I need to know how to do html in an email for other reasons as well. So I can format some emails I send. Here's all of it. Its only reading html like this <span> etc. How to get an email to read html? Thanks very much. <?php ?> <form action="<?php $_SERVER['PHP_SELF'] ;?>" method='post'> <input type='text' name='username' size=15> <span>User name</span><br /> <input name='email' size=15> <span>Email</span><br /> <input type='submit' name="submit" value='Submit'><br /><br /> </form> <?php if (isset($_POST['submit'])) { $username = $_POST['username'] ; $pemail = $_POST['email'] ; $from = 'noreplysupport@somesite.com'; $subject = "Validation Email" ; $messageproper = "<span style=\"font-family:arial,sans-serif;font-size:14px\">Just click on the following link to validate your email.</span> <a href=\"http://www.example.com/validate.php?username=$username\" target=\"blank\">Validate</a>"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers = "From: <$from>\r\n"; $headers .= "Reply-To: ".preg_replace('/[\r\n]+/', ' ', $from)."\r\n"; mail($pemail, $subject, $messageproper, $headers); } ?> This doesn't work either: $messageproper = "<html><body><div><span style='font-family:arial,sans-serif;font-size:14px'>Just click on the following link to validate your email.</span><a href='http://www.example.com/validate.php?username=$username' target='blank'>Validate</a></div></body></html>";
  20. Strange, didn't help, I also sent it to two other emails, aol and a no name brand. Same thing, doesn't read the html. or the A link even all by itself with the escape slashes. I've been reading all over google, its working for everyone else, why not for me?
  21. I appreciate that, thats not it. Its showing all this as is even your added escape slashes. <head> <title>HTML email</title> </head> <body>
  22. I got the validation part working, just need help with why the emails aren't reading my A links and html.
  23. Anyone know anything about putting html in email and why my just above email code isn't working? Thanks.
  24. Heres the link I'm using for html in emails. http://www.w3schools.com/php/func_mail_mail.asp Here's what I'm using in the php and the email is sending, but it shows this just as is in the email. Its not reading any of this as html. Anyone see whats wrong with my html email code? Thanks. $validateemail = 'anemail@address.com ; $from = 'noreplysupportaddress'; $subject = "Email validation" ; $messageproper = "<html> <head> <title>HTML email</title> </head> <body> <div><span style='font-family:arial,sans-serif;font-size:14px'>Testing text and html in an email.<a href='http:www.example.com/validate.php?username=$username ' target='blank'>Validate Your Email</a></span></div> </body> </html>"; $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers = "From: <$from>\r\n"; $headers .= "Reply-To: ".preg_replace('/[\r\n]+/', ' ', $from)."\r\n"; mail($validateemail, $subject, $messageproper, $headers);
×
×
  • 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.