Jump to content

11Tami

Members
  • Posts

    329
  • Joined

  • Last visited

    Never

Everything posted by 11Tami

  1. Thank you, I appreciate that very much. The emails aren't accepting regular html. It doesn't let me put a closing tag on the A link in this forum but my following A link is correct. $messageproper = "<a href='validationpage.php'>why arent emails accepting this html?<closingslash a>" Please let me know, thanks.
  2. I'm sure I'll need to come back to this post, I'll probably get stuck soon. But, that takes the fuzziness off, I'll get started and see what happens. Thanks that helped a lot!
  3. Hello, I know how to send something to an email. How can I add a link to the email so that if someone clicks on the link some php will execute? What php I want to execute is that when they click on the link the letter "v" is sent to a database. I know how to send something to a database, I just don't know how to tie all this together with the an address link in their email. All I'm trying to do is send something to someones email and when they click on the link it will prove there email is real and not a bogus email address. I'm just missing this one piece on -----how to make the web site address link in their email activate some php. Please let me know, thanks a lot.
  4. Here's where I'm at, I'm trying to use a form and drop downs to send data to a database table named "computers" The errors say Undefined index: name Undefined index: category Undefined index: category found here: $name = $_POST['name'] ; $category = $_POST['category'] ; if ($_POST['category'] Isn't it reading these fields in the form? Can someone see why the php isn't reading these named form fields? Am I supposed to have some php in the form itelf? Thanks very, very, much. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1);{ ?> </span> <form action="<?php $_SERVER['PHP_SELF'] ;?>" method="post"> <table> <tbody> <tr> <td><input name="name" size="25"/></td> </tr> <tr> <td> <select name="category"> <option value="first">first</option> <option value="second">second</option> <option value="third">third</option> </select> </td> </tr> <tr> <td><input value="Add" type="submit" /></td> </tr> </tbody> </table> </form> <?php } $con = mysql_connect("","",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("", $con); $name = $_POST['name'] ; $category = $_POST['category'] ; if ($_POST['category'] == 'first'){ $sql="INSERT INTO computers (name,category) VALUES ('" . $_POST['name'] . "','" . $_POST['category'] . "')"; if (mysql_query($sql,$con)) {echo "row added";} else if (!mysql_query($sql,$con)) {mysql_error();}} ?>
  5. Hello, I am trying to have data entered into several tables in a database and not just one table only. Is there any way to do this? I know you can do this with columns. For instance using a form field and whatever someone entered into the form would be inserted into the table. Insert INTO table_name columnname WHERE columnname = '$formfieldentry'"; But can you do this with actual tables in the database and not just the table columns? So insert something into a table of a database, but only if a table name = something? Please let me know if this can be done, thank you very much.
  6. I don't know its not sinking in but thanks your posts led me to more about it under "regular expressions php." But deadevil and markjoe, guess what now I can name my text file what I want with this. if(preg_match("/".$currentFile."\.txt/","/".$file."\.txt/")): Now I'm working on the rest, I'll let you know how it goes.
  7. This is all I could find regarding details about delimiters it doesn't explain well enough how to use a delimiter if using like this / http://en.wikipedia.org/wiki/Delimiter
  8. Thanks again for the help deadevil and finding that other code Markjoe, looks like its working better for all of us. 60 is great for seconds. I studied all day today about this: if(preg_match("/".$currentFile."\.[A-Za-z]/","/".$file."\.[A-Za-z]/")): and I'm stumped. Deadevil can you tell me a little more about it? I don't want to have to rename all my files. The part I am not understanding is all these "/" is that to avoid parsing errors for pulling the web site adress properly or something? At any rate, its getting very close now. Once I understand why you set up preg_match that way, maybe I can help find a solution for the file names. http://www.devpapers.com/article/46
  9. Aw you guys are swell, I'll get back to this in just a few days, I got sick. BBSoon
  10. Thanks a lot, I appreciate it and I'll take a look at it. Did you see in my last code and where I mentioned much earlier that I was trying to grab two type of files?
  11. Look like maybe your # signs are just notes? Its the first time I've seen notes in php used with #signs. I did a google, didn't see anything about # being notes there either, but it looks like maybe that is why you added them?
  12. I was wondering if it was having a hard time finding each file, but what does the echo do, should I move the echo up right above $all files or should they stay where they are? I added them all to it, it makes it all bigger. The error message says unexepected Telse here elseif ($ext == "html")include($data[$currentFile]); The reason I was including the explodes and pops, so that I could include an html file with it, unless there's another way. <? php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $currentFile = date("i"); $file1 = file_get_contents('file01.txt'); $file2 = file_get_contents('file02.txt'); $file3 = file_get_contents('file03.txt'); $file4 = file_get_contents('file04.txt'); $file5 = file_get_contents('file05.txt'); $file6 = file_get_contents('file06.txt'); $file7 = file_get_contents('file07.txt'); $file8 = file_get_contents('file08.txt'); $file9 = file_get_contents('file01.html'); $file10 = file_get_contents('file10.txt'); $allfiles = array($file1,$file2,$file3,$file4,$file5,$file6,$file7,$file8,$file9,$file10); $file = explode(",", $allfiles); #echo $file[0]; // $file1 #echo $file[2]; // $file2 #echo $file[3]; // $file3 #echo $file[4]; // $file4 #echo $file[5]; // $file5 #echo $file[6]; // $file6 #echo $file[7]; // $file7 #echo $file[8]; // $file8 #echo $file[9]; // $file9 #echo $file[10]; // $file10 foreach($file as $data): $ext = substr($data, -3); #$ext = array_pop($file); if ($ext == "txt") include($data[$currentFile]); break; elseif ($ext == "html") include($data[$currentFile]); break; endforeach; $parts = explode(".", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]);} elseif ($ext == "html") {include($files[$currentFile]);}?>
  13. I changed the seconds to minutes $currentFile = date("i"); and changed the .txt files to some upcoming minutes, so the time would last longer to test. But still nothing appearing and I have text in all the text files and the inlude is inside proper div tags.
  14. Really appreciate all you wonderful help deadevil, this is very interesting. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $currentFile = date("s"); $file1 = file_get_contents('file01.txt'); $file2 = file_get_contents('file02.txt'); $file3 = file_get_contents('file03.txt'); $file4 = file_get_contents('file04.txt'); $file5 = file_get_contents('file05.txt'); $file6 = file_get_contents('file06.txt'); $file7 = file_get_contents('file07.txt'); $file8 = file_get_contents('file08.txt'); $file9 = file_get_contents('file09.txt'); $file10 = file_get_contents('file10.txt'); $this = array($file1,$file2,$file3,$file4,$file5,$file6,$file7,$file8,$file9,$file10); $files=count($this); $parts = explode(".", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]); } ?> This is now working with no error messages, as long as I have all those .txt files uploaded to the root, it takes away all error messages. But, now there are no error messages, but also no files appearing. I uploaded more files to make sure I could refresh the page for several seconds and see if anything appeared. But nothing appearing. It seems like it should be working now but nothing at all there. Not sure why. I only get an error code that says the files are missing if I remove any of them online, other than that no errors at all. Thanks
  15. Thanks for trying, it almost worked and it tried to open the correct text files, but this $parts = explode(".", $files[$currentFile]); still says undefined $current file and I don't know why. Here's where its at now. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $currentfile = date("s"); $file1 = file_get_contents('file1.txt'); $file2 = file_get_contents('file2.txt'); $this = array($file1,$file2); $files=count($this); $parts = explode(".", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]); }?>
  16. The count() is counting the items in the array and the explode() is sorting them all at the end. But I'll do it another way if it works. The error this gives says it doesn't like this $currentfile = date("s"); And I don't know why, all it is saying is get something by seconds and it usually works. If I have files on my own site and not anybody elses, do I still need file_get_contents for the files? Thanks, the following code says it doesn't like this $currentfile = date("s"); <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $currentfile = date("s"); $this=array("file01.txt","file02.txt"); $files=count($this); $parts = explode(".", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]); }?>
  17. I don't think it likes it because the explode is trying to sort the items in the previous array and they are not there to sort. Anyone know how to add $file1 = file_get_contents('file1.txt'); $file2 = file_get_contents('file2.txt'); for the array instead, without using the explode and count()... Either that or put them back in the array as they were before, and just get the file to open? Thanks <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $file1 = file_get_contents('file1.txt'); $file2 = file_get_contents('file2.txt'); $currentfile = date("s"); $files=count($file); $parts = explode(",", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]); ?>
  18. Thanks a lot evil, I'm getting this on the include: It says $currentFile in this line is undefined $parts = explode(",", $files[$currentFile]); which is keeping this from opening. {include($files[$currentFile]);} I added this to the top of the script to help with errors: ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); Reason I'm trying to do it this way Markjoe is because I need the items in the array because I'll be working with more stuff for the array. Right now just trying to get the seconds or minutes working with the items listed in an array. Anyone know why $currentFile here is undefined in deadevils code? Thanks $parts = explode(",", $files[$currentFile]);
  19. Here it is again, I had to put a "0" after file for seconds but still not working. $currentfile = date("s"); $this=array("file01.txt","file02.txt"); $files=count($this); $parts = explode(".", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]); }?>
  20. Hello, I'm trying to get a file per second or minute on a web site without sessions or cookies if possible. For testing I am trying per second. No file in the array is being included on a second. Can I number the items listed in the array and still keep them inside the array()? So it will grab one of them depending on what second it is? If so, how is that done? Thanks very much! <?php $currentfile = date("s"); $this=array("file1.txt","file2.txt"); $files=count($this); $parts = explode(".", $files[$currentFile]); $ext = array_pop($parts); if ($ext == "txt") {include($files[$currentFile]); }?>
  21. Great, I'll send you something. I'll see if I can pick each item on its own now.
  22. Thank you, no problem, I can figure out how to get them one at a time later, right now I just need to get the images included. This is where I'm at, I moved the $n++ to another line, it didn't want it earlier. Now its saying it doesn't like the $ sign past this ?> But there is no $ anywhere past this ?>. So there is something else wrong but the errors aren't telling me where to look for it. Anyone see why this code isn't activating at all? Thanks. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $files=array("file1.txt","file2.txt","file1.jpg"); $count=count($files); for ($n=0; $n < $count;){ $n++; $parts = explode(".", $files[$n]); $ext = array_pop($parts); switch ($ext){ case "jpg": echo "<img src=\"{$files[$n]}\">"; break; default: include($files[$n]); break; ?>
  23. Thanks that tool worked great. It is including each file in the array at the same time, instead of a different one in the array on each separate page load. Also the error I get says it won't include an image file along with the rest. Anyone know of a way that an image file can be included along with a .txt file? Thank you very much. <?php ini_set('error_reporting', 8191); ini_set('display_startup_errors', 1); ini_set('display_errors', 1); $files=array("file1.txt","file2.txt","file1.jpg"); $count=count($files); for ($n=0; $n < $count; $n++){ include($files[$n]); } ?>
  24. Thanks very much, nothing is appearing and I have these uploaded file1.txt file1.txt file1.jpg and the code I'm using: <?php $files=array("file1.txt","file2.txt","file1.jpg"); $count=count($files); for ($n=0;$n<$count,$n++ {include $files[$n];} ?> The code seems to want something more that it doesn't have...anyone know?
  25. Hello, is there a way to include more than one web site file with PHP? For example: <?php $includefile = "file" . ".txt"; include ($includefile); ?> Includes a web site file named file.txt into a page. I know if I wanted to include an image it would be $includefile = "file" . ".jpg"; include ($includefile); etc. But is there a way to include both in one? I'm getting kind of tired of using separate scripts for each one. Some sort of code that will allow you to add both an image type and a file type, both in the same script? Please let me know if you know something that might work or if you have bumped into anything somewhere. Thanks a lot.
×
×
  • 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.