Jump to content

businessman332211@hotmail.com

Members
  • Posts

    304
  • Joined

  • Last visited

Posts posted by businessman332211@hotmail.com

  1. See I also have to do something recent that he asked for, he wants each and every page to be a url, on the site, like if it's a funny movie about a dog falling off a bed, it would be www.funnyemailforwards.com/dogfallingoffbedor whatever it was, I need to figure out how to set this up, I will keep this in mind but I don't understand how to take the file types and make them do this. I have been stuck on this a few days, I don't know why I am so confused on this, I have learned so much during these recent projects, I just don't understand 2 things.How to work with files and get them to embed and everything, and how to display data from a form, and allow someone to update that, like delete stuff, sort of like creating a mini admin page or something.

  2. I am not sure about that, I have in my database, the following information currently.

    Field Type Attributes Null Default type varchar(100)  Yes NULL                nameoffunny varchar(100)  Yes NULL                keywords varchar(100)  Yes NULL                funnyurl varchar(100)  Yes NULL                entrydate int(11)  Yes NULL                approval tinyint(1)  No 0

    Ok the form gathers some of this, the type meaning what kind of file, poem, or song, or video, or whatever they choose, out of 6 choices.THe name of the funny, is what they nam eit, the keywords, are what they choose as keywords to help with searching later. The funnyurl, is the website address the file is moved too, and the entry date, records information about the date it was entered, I put it in as a unix time stamp, so I could custom format it whichever way I want when I pull the date out.The approval is what I am goign to use when I start to allow him to approve, or decline, it is set to 0 to start, if he approves it changes to 1, if he declines, it simply removes it completely from the database, all this is what I need guidance on, specifically you said file type, I am accepting the following extension types currently ubt I have no idea if these are good ideas, I had a longer list, but made severe revisions earlier at the advice of multiple people. $_accepted_extensions = array

    ('.mpeg', '.mpg', '.wav', '.avi', '.mid', '.jpg', '.jpeg', '.jfif', '.pdf', '.txt', '.wav', '.gif', '.mp2', '.mp3', '.bmp');

    The mpeg, mpg, wav, avi, mid, mp2, and mp3 I should be able to all put into a windows media player on the page.The jpg, jpeg, jfif, gif, bmp, I should be able to simply display on the page.The txt, pdf, I should be able to just allow to show there, but I have no idea how to get any of this to work, or what functions to look towards, some examples, or other stuff, and i have done extensive checking on this, right now I am also researching what to do about virus scanning file downloads, before entry into the server, but so far have found nothing, no tutorials, no software no nothing.

  3. I have 2 things I am about to do, and I don't know how to do either, hopefully someone can point me in the right direction, 3 questions actually.1. On a linux server what do I do about scanning file downloads for viruses before download.2. How do I embed files, I am at that point, I have my entire script, the last thing left for me to do, is get each file upon entry to embed, if it's a music or video, then in windows media player, if it's text, then just displayed on the page, the songs, and videos will have a link also to download, but will by default be embedded in a page, sort of like on youtube.com I guess is what he said, how do I do that. Or atleast someone who can point me in the right general direction.3. I have to do something else on 2 different projects, the end of this one, and a new one, this is the section, I have to display the data, but have them be able to change it, on one of the projects, he has to be able to change the data, by just entering form information. Then it will update the display information in the other page. The other question I now have to ask here is how do I get the information to display and be able to have them delete it. I have a column in my database, it says approve, it starts at 0, if it is approved, it is changed to 1, if declined, it is deleted. I think I know how do display it, but have no idea how to set it up, so he see's the entries that are most recent, then it says all the information about them, and has a place to delete them as well, then if he approves, they work, like a list, I don't know any advice would be appreciated thanks.

  4. Ok well I have finished my entire script so far, and this is what it does.It takes the form information on http://www.funnyemailforwards.com and does the following(the form with the attachment).I did full custom error handling and think I covered everything.It checks for blank spaces in form, it checks to see if the file was uploaded, it checks the extensions. It checks to see if the file already is in the directory, if not then it moves it there. After that it connects to the database, checks for the existence of the data and if it's not there it entersThe name of the funny, The type, the keywords, I have it set to get the url, and the date. All 100% functional, fast, and working. Now I have some questions and advice, first here is what I have now, as a finished script(what I have so far anyway).

    <?php$management = true;$errorhandler = "";$filemanager = true;$dateinfo = strtotime("now");$dateformatted = date("n-d-y", $dateinfo);if ($_POST['name'] == "") {	$errorhandler .= "The Name field has been left blank<br />";	}if ($_POST['keywords'] == "") {	$errorhandler .= "The Keywords were left blank<br />";	}if(!is_uploaded_file($_FILES['file']['tmp_name'])){	$errorhandler .= "No file has been uploaded<br />";	$filemanager = false;	}  if ($filemanager === true) {$_accepted_extensions = array('.mpeg', '.mpg', '.wav', '.avi', '.mid', '.jpg', '.jpeg', '.jfif', '.pdf', '.txt', '.wav', '.gif', '.mp2', '.mp3', '.bmp');   if ($filemanager == true) {  $tmp = pathinfo($_FILES['file']['name']);  if (in_array('.' . $tmp['extension'],$_accepted_extensions)) { 	 $filemanager = true; 	 $management = true; 	 }else { 	 $filemanager = false; 	 $management = false; 	 $errorhandler .= "You have attempted to upload the wrong file type<br />"; 	 $errorhandler .= "We only accept mpeg, mpg, wav, avi, mid, jpg<br />"; 	 $errorhandler .= "jpeg, jfif, pdf, txt, wav, gif, qt, mp2, mp3 bmp formats<br />"; 	 $errorhandler .= "To request new file types email<br />"; 	 $errorhandler .= "information@theyellowpagesnetwork.com"; 	 }  }	}    // Relative URL with desired folder name and the name of the file on the user's machineif ($management === true && $filemanager === true) {	$newfile = "uploads/".basename($_FILES['file']['name']);	$newfiletemp = "{$_FILES[file][tmp_name]}";	if (file_exists($newfile)) {  $errorhandler .= "The file already exists";  $filemanager = false;	}	if($filemanager === true) {  if (!move_uploaded_file($newfiletemp, $newfile)) { 	 $errorhandler .= "The file was not moved properly"; 	 $filemanager = false; 	 $manager = false;  }	} }if ($filemanager === true || $manager === true) {	$connect = mysql_connect("#####", "#####", "#####");	$select = mysql_select_db("funnyemailforwards"); if (!$connect && !$select) {  $errorhandler .= "The database could not connect, or selected";  $management = false;  $filemanager = false;	}  }if ($filemanager === true && $management === true) {$query = "SELECT * from fileinfo WHERE type = '" . implode("", $_POST['type']) . "' AND nameoffunny = '" . mysql_real_escape_string($_POST['name']) . "' AND keywords = '" . mysql_real_escape_string($_POST['keywords']) . "' AND funnyurl = '" . mysql_real_escape_string($newfile) . "' AND entrydate = '" . mysql_real_escape_string($dateinfo) . "'";$result = mysql_query($query);$matches = mysql_num_rows($result); 	if ($matches == 0) {$inserter = "INSERT INTO fileinfo (type, nameoffunny, keywords, funnyurl, entrydate) VALUES ('" . implode("", $_POST['type']) . "', '" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['keywords']) . "', '" . mysql_real_escape_string($newfile) . "', '" . mysql_real_escape_string($dateinfo) . "')";	if(mysql_query($inserter)){  	 $management = true; 	 $filemanager = true; 	 }else { 	 $management = false; 	 $filemanager = false; 	 $errorhandler .= "The information was not inserted into the database properly"; 	 echo mysql_error(); 	 }	} else {  $filemanager = false;  $managment = false;  $errorhandler .= "The information was already in the database, could not complete";	}	}if ($management === false || $filemanager === false) {	echo "{$errorhandler}";	}		?>

    Ok and here is my database information for this specifically.I have the table name and fields listed in the script.Here are the questions I wanted to ask before I move on, I have learnt a lot from doing what I have so far, more than I would have ever imagined, but as I look forward into the rest of the project, I am at a standstill and need some enlightenment.1. Is there anything else I can do to the file handling aspect of my script to make it more secure?2. Is saving the url like that going to work right later when I do other things with the files.3. How do I go about using my stored information to send an email to my client with each entry so he can accept/decline, I don't understand how to make the email be related to each specific entry, I can send an email but not make the email and current entry attached, how do I do this?4. I need to decide what to do with the files, should I embed them in the pages, or make them links5. Also on top of that I have no idea how to do either, any advice might give me something to think about when I start all of this on monday?6. What do I do when I get ready to call this data on the homepage with the three most recent entries, I won't do this until the other part is done, but how do i get the file url to be a url where someone can use, or either embed each file individual into a page as it is downloaded, or make it a link, I don't understand specifically how to make each file do it, everytime someone uploads one.ANY other advice, opinions, or theories relating to anything like this would help a lot and give me more to think about when it's time for me to do the hardest part on monday.Thanks for all of the help.

  5. That might work, so far I modifyed it to look like this

    if ($management === true && $filemanager === true) {	$newfile = "uploads/".basename($_FILES['file']['name']);	$newfiletemp = "{$_FILES[file][tmp_name]}"; if (!file_exists($newfile)) {	if (!move_uploaded_file($newfiletemp, $newfile)) {   	 $errorhandler .= "Your file was not uploaded properly.<br />";   	 $filemanager = false;   	 $management = false;    } }}

    If it doesn't exist then, it works out properly.

  6. I have made some great progress on this, I have everything working now, and it uploads it to a folder, I am just about to database all the information but what i need to ask is, how do I get the ability to check the folder. If it uplaods the file to a folder, then later someone uploads teh same file, is there anything I can do to check if it's already there, orw uold it say file already exists, or would it just overwrite the old file, also here is my code below, so far by what I have, is there anything I can do to be more secure, or protect myself from anything.

    <?php$management = true;$errorhandler = "";$filemanager = true;$dateinfo = date("n-d-y");if ($_POST['name'] == "") {	$errorhandler .= "The Name field has been left blank<br />";	}if ($_POST['keywords'] == "") {	$errorhandler .= "The Keywords were left blank<br />";	}if(!is_uploaded_file($_FILES['file']['tmp_name'])){	$errorhandler .= "No file has been uploaded<br />";	$filemanager = false;	}  if ($filemanager == true) {$_accepted_extensions = array('.mpeg', '.mpg', '.wav', '.avi', '.mid', '.jpg', '.jpeg', '.jfif', '.pdf', '.txt', '.wav', '.gif', '.mp2', '.mp3', '.bmp');   if ($filemanager == true) {  $tmp = pathinfo($_FILES['file']['name']);  if (in_array('.' . $tmp['extension'],$_accepted_extensions)) { 	 $filemanager = true; 	 $management = true; 	 }else { 	 $filemanager = false; 	 $management = false; 	 $errorhandler .= "You have attempted to upload the wrong file type<br />"; 	 $errorhandler .= "We only accept mpeg, mpg, wav, avi, mid, jpg<br />"; 	 $errorhandler .= "jpeg, jfif, pdf, txt, wav, gif, qt, mp2, mp3 bmp formats<br />"; 	 $errorhandler .= "To request new file types email<br />"; 	 $errorhandler .= "information@theyellowpagesnetwork.com"; 	 }  }	}    // Relative URL with desired folder name and the name of the file on the user's machineif ($management === true && $filemanager === true) {	$newfile = "uploads/".basename($_FILES['file']['name']);	$newfiletemp = "{$_FILES[file][tmp_name]}";	if (!move_uploaded_file($newfiletemp, $newfile)) {   	 $errorhandler .= "Your file was not uploaded properly.<br />";   	 $filemanager = false;   	 $manager = false;    }}	if ($management === false && $filemanager === false) {	echo "{$errorhandler}";	}		?>

  7. I have a few questions on how to work this out with files.I have this script so far.

    $management = true;$errorhandler = "";$filemanager = true;  if ($_POST['name'] == "") {  $errorhandler .= "The Name field has been left blank<br />";  }  if ($_POST['keywords'] == "") {  $errorhandler .= "The Keywords were left blank<br />";  }  	if(!is_uploaded_file($_FILES['file']['tmp_name'])){  $errorhandler .= "No file has been uploaded<br />";  $filemanager = false;  }    if ($filemanager == true) {$_accepted_extensions = array('.mpeg', '.mpg', '.wav', '.avi', '.mid', '.htm', '.jpg', '.jpeg', '.jfif', '.pdf', '.txt', '.wav', '.html', '.gif', '.mp2', '.mp3', '.bmp');    if ($filemanager == true) {   	 $tmp = pathinfo($_FILES['file']['name']);    if (in_array('.' . $tmp['extension'],$_accepted_extensions)) {   	 $filemanager = true;   	 $management = true;      }else {      $filemanager = false;      $management = false;      $errorhandler .= "You have attempted to upload the wrong file type<br />";      $errorhandler .= "We only accept mpeg, mpg, wav, avi, mid, midi, doc, htm, jpg<br />";      $errorhandler .= "jpeg, jfif, pdf, txt, wav, html, gif, qt, mp2, mp3 formats<br />";      $errorhandler .= "To request new file types email<br />";      $errorhandler .= "information@theyellowpagesnetwork.com";      }   	 }    }   	  	 if ($management == false || $filemanager == false) {    echo "{$errorhandler}";    }    

    Ok This is what I have so far.Everything works great, I check the form over onwww.funnyemailforwards.com and I handle it here.I set my script at the top, I go through checking for blank space, then checking if the file was uploaded, if it uploaded I check for file extensions, then it gets down there, and if there were any errors encountered it displays error messages. But I have to get advice on a few things1. Are those good or bad files to download, s hould I add or remove some extensions.2. How do I move the files over to a folder, and should I embed them in teh page, or leave them as downloadable links, how do I get the pages to imbed automatically, with each upload3.The hardest thing is I have to set up to where I record the url of them and everythign including date, into a database, and then get something to send my client an email, he can accept/decline the entry, if he declines I need it to remove tha tentry from the database, and if not leave it alone, but I need the email to be directly related to the file that was entered, I don't know how to set this up.I really need advice any and all advice you could give would be greatly appreciated.

  8. I tried that, the top I am not really worried about as much as hte bottom, see I have the bottom set up like that but it went retarded, and what's worse is the top is good but I can't get that other piece of text around there

  9. I need some help with this, advice or direction, I am not new at css I am very good with it but this has me stuck.Below is the picture I am trying to get the format to look like.test.gifNow this is what I currently have, I took what he had, I left the absolute positioning alone, because I didn't know how to get the same look with the top part, and I added in the second lower part, and formatted his css better, and easier to read, and worked on some of his html, here is the pic I got from what I ended up doing.test2.gifOk that is what I currently have, and I am confused as to why I can't get atleast somewhat near the layout, I thought it would work, here is the final xhtml, and css I have so far, again the absolute positioning is what he did with golive I don't use that anymore, but I don't know how to really change that either and nothing I am trying is getting even close, when I try to dismantle the top part and redo it, it falls apart, I have a hard time with graphics heavy sites, so far anyway, any advice would be appreciated, nothign I can do, can seem to get the bottom part situated, liek I want it, the reason I am doing htis, is because I am going to use javascript after that, to get the pics to make the text appear, and from a past experience I can easily figure that out, I am just looking for some guidance, or tips on the layout.XHTML

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><html>	<head>  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  <meta name="generator" content="Adobe GoLive" />  <meta name="Keywords" content="custom, furniture, design, kensington, san francisco, bay  area, repair, woodworking, antique, antiques, library, card, catalog, catalogs, catalogue" />  <title>Entryway to Furniture Section</title>  <link rel="stylesheet" href="FurnPhotoSculpCSS.css" />	</head>	<body>		<!-- Begin Entire head section -->	<div id="topmasterdiv">	<div id="HuttBrooksLogo"><img src="CommonImages/logoFurniture2aSm.gif" alt="" height="80"	width="293" border="0" /></div>	<div>	<p>For over 50 years I have been retrofitting, redesigning, repairing, restoring, recombining, inventing, and building fine furnishings and antiques.  My Devotion, is to well thought out design, lasting craftsmanship, and just plain making things extremely functional	</p>	</div>	</div>	<div id="NavBarFoundation"><div id="NavBarSpacerLeft"><img 	src="CommonImages/NavBar/1pxspacer.gif" width="1" height="1" alt="" /></div>	<div id="NavBarBook1"><a href="FurnitureCompleteWorks.html"><img 	src="CommonImages/NavBar/NavBarBook1.gif" width="59" height="175" alt="Book of Complete Works of Furniture" /></a></div>	<div id="NavBarBook2"><a href="FurnitureWhoWhyEtc.html"><img src="CommonImages/NavBar/NavBarBook2.gif" width="49" height="175" alt="Book of Who, Why, What, etc." /></a></div>  	<div id="NavBarBook3"><a href="ContactInfo.html"><img src="CommonImages/NavBar/NavBarBook3.gif" width="52" height="175" alt="Book of Contact Information" /></a></div>  	<div id="NavBarBook4"><a href="FurnitureStudioShop.html"><img src="CommonImages/NavBar/NavBarBook4.gif" width="45" height="175" alt="Book of The Studio Store" /></a></div>  	<div id="NavBarBook5"><a href="MasterSiteIndex.html"><img src="CommonImages/NavBar/NavBarBook5.gif" width="54" height="175" alt="Combined Site Index" /></a></div>  	<div id="NavBarBook6"><a href="index.html"><img src="CommonImages/NavBar/NavBarBook6.gif" width="57" height="175" alt="Book linking to Opening Scene Card Catalogue" /></a></div>  	<div id="NavBarSpacerRight"><img src="CommonImages/NavBar/1pxspacer.gif" width="1" height="1" alt="" /></div>  	<div id="NavBarShelf"><img src="CommonImages/NavBar/NavBarShelf.gif" width="372" height="33" alt="Book Shelf" /></div>  </div></div>  	<!-- End Entire head section -->  	<!-- Begin situating rest of body -->  	<div><!-- Wrapper -->  	<div><!-- photo 1 set -->  	<div><!-- photo link 1 -->  	<a href="piece1.htm">  	<img src="FurnitureHmPgImages/1CDBureauArts&craftsLight150.jpg" alt="Photo 1" />  	</a>  	</div>  	<div>  	<h3>Photo 1 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above this  	paragraph has space above it and (slightly less) space below it.  This paragraph, as   	printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 1 set -->  	<div><!-- photo 2 set -->  	<div><!-- Photo link 2 -->  	<a href="piece2.htm">  	<img src="FurnitureHmPgImages/2TrebleClefStool150x180.jpg" alt="Photo 2" />  	</a>  	</div>  	<div>  	<h3>Photo 2 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above this  	paragraph has space above it and (slightly less) space below it.  This paragraph, as   	printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 2 set -->  	<div><!-- photo 3 set -->  	<div><!-- Photo link 3 -->  	<a href="piece3.htm">  	<img src="FurnitureHmPgImages/3PearsonTablePlus150x180.jpg" alt="Photo 3" />  	</a>  	</div>  	<h3>Photo 3 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above  	this paragraph has space above it and (slightly less) space below it.  This paragraph,   	as printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 3 set -->  	<div><!-- photo 4 set -->  	<div><!-- Photo link 4 -->  	<a href="piece4.htm">  	<img src="FurnitureHmPgImages/4LaPineGreenTable150x180.jpg" alt="Photo 4" />  	</a>  	</div>  	<h3>Photo 4 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above   	this paragraph has space above it and (slightly less) space below it.  This paragraph,   	as printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 4 set -->    <div><!-- photo 5 set -->  	<div><!-- Photo link 5 -->  	<a href="piece5.htm">  	<img src="FurnitureHmPgImages/5BuckeaselBack150x180.jpg" alt="Photo 5" />  	</a>  	</div>  	<h3>Photo 5 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above this  	paragraph has space above it and (slightly less) space below it.  This paragraph, as   	printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 5 set -->  	<div><!-- photo 6 set -->    <div><!-- Photo link 6-->  	<a href="piece6.htm">  	<img src="FurnitureHmPgImages/6RollingIndexVic150x180.jpg" alt="Photo 6" />  	</a>  	</div>  	<h3>Photo 6 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above this  	paragraph has space above it and (slightly less) space below it.  This paragraph, as   	printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 6 set -->  	<div><!-- photo 7 set -->  	<div><!-- Photo link 7-->  	<a href="piece7.htm">  	<img src="FurnitureHmPgImages/7SpanishBenchResurectn150x18.jpg" alt="Photo 7" />  	</a>  	</div>  	<h3>Photo 7 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above   	this paragraph has space above it and (slightly less) space below it.  This paragraph, as  	printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 7 set -->  	<div><!-- photo 8 set -->  	<div><!-- Photo link 8-->  	<a href="piece8.htm">  	<img src="FurnitureHmPgImages/8Bunny1a150x180.jpg" alt="Photo 8" />  	</a>  	</div>  	<h3>Photo 8 Text</h3>  	<p>Setting space around elements is a basic tool in typography.  The headline above this  	paragraph has space above it and (slightly less) space below it.  This paragraph, as   	printed in the book, has space on the left.</p>  	</div>  	</div><!-- end photo 8 set -->  	</div><!-- end wrapper -->  	<!-- End main content -->  </body>	</html>

    CSS

    /* Styles for all pages in all 3 sections: Furniture, Photographic Works, Sculpture Etc.  One for Logo,	the next 10 for the Navigation Book Shelf, one for the big blank book, and the last to create breathing	space at the bottom */	body  { 	background-image:url(CommonImages/Backgrd1Furniture.gif); 	background-color:#000000; 	margin: 0; 	padding: 0 }		#HuttBrooksLogo{ 	visibility:visible; 	position:absolute; 	top:16px; 	left:32px; 	width:293px; 	height:80px }#NavBarFoundation{ 	visibility:visible; 	position:absolute; 	top:2px; 	left:432px; 	width:372px; 	height:208px }#NavBarSpacerLeft { 	visibility:visible; 	position:absolute; 	left:0px; 	top:0px; 	width:24px; 	height:175px; }#NavBarBook1 { 	visibility:visible; 	position:absolute; 	left:24px; 	top:0px; 	width:59px; 	height:175px; }#NavBarBook2 { 	visibility:visible; 	position:absolute; 	left:83px; 	top:0px; 	width:49px; 	height:175px; }#NavBarBook3 { 	visibility:visible; 	position:absolute; 	left:132px; 	top:0px; 	width:52px; 	height:175px; }#NavBarBook4 { 	visibility:visible; 	position:absolute; 	left:184px; 	top:0px; 	width:45px; 	height:175px; }#NavBarBook5 { 	visibility:visible; 	position:absolute; 	left:229px; 	top:0px; 	width:54px; 	height:175px; }#NavBarBook6 { 	visibility:visible; 	position:absolute; 	left:283px;  	top:0px; 	width:57px; 	height:175px; }#NavBarSpacerRight { 	visibility:visible; 	position:absolute; 	left:340px; 	top:0px; 	width:32px; 	height:175px; }#NavBarShelf { 	visibility:visible; 	position:absolute; 	left:0px; 	top:175px; 	width:372px; 	height:33px; }#OpenBook	{ 	visibility:visible; 	position:absolute; 	top:230px; 	left: 0; 	width:804px; 	height:670px }#Footer { 	visibility:visible; 	position:absolute; 	top:900px; 	left:0; 	width:804px; 	height:100px }		#topmasterdiv{	clear:both;}a{border:none;}$bottomwrap{clear:both;}

    Again the top section was him, I have tried cutting it down, so I decided to try and find a way to make the bottom part happen without touching the top.

  10. Is it possible to use vb-script with anything but asp. The reason I am asking is I use javascript with php, but if I ever use asp, can I still use vb-script, I know it's possible to use php/asp together, because I know for a fact, that you can, I have seen someone use mostly asp, with some php where php was better, I use mostly php, should I ever even learn vb-script, or should I wait, I don't really intend to use asp, I will learn it, and have it for projects, If I find at the time I like it more than php, then I will use them both together, jsp I will also eventually take a look at, I can work on that, just advice, if you can, thanks,.

  11. Ok so what I need to do now, is just start programming, see what ideas I can come up with and what I can piece together. I appreciate the help so far thanks.

  12. I have never started with this before, so I wanted to clarify a few things first, before I get too confused.In order for me to prepare the form, to start getting information to php I added the

    enctype="multipart/form-data"

    Ok I know that was needed to prepare the form, now on the form file field, before it you are supposed to input something along the lines of

    <input type="hidden" name="MAX_FILE_SIZE" value="30000" />

    This would go above the file form field. Now here is my entire form right now, but I had a few questions, I will be wading through it, but after I get done I will have tripled my php knowledge, I am learning so fast lately, I do everything I can on my own and seek help when I get stuck.

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><link rel="stylesheet" type="text/css" href="funnyemails.css" /><meta name="Description" content="If you have a funny email, feel free to put it into our database, to send to all the people signed up to recieve funny emails" /><meta name="Keywords" content="funny, emails, email, fowards, joke, video, song, poem, picture, yellow pages, services" /> <!-- Search engine preparation --><!-- If you have a funny email, feel free to put it into our database, to send to all the people signed up to recieve funny emails --><!-- funny, emails, email, fowards, joke, video, song, poem, picture, yellow pages, services --><!-- Above comment tags accommodate search engines that do not pick up Meta Tags --><meta name="author" content="A service of Yellow Pages Online" /><title>Funny Email Forwards</title></head><body><div id="header"><!-- Begin top area, with logo, and text below it --><img src="images/logo.gif" alt="Logo" /><br /><p id="headertext">The web's directory of funny Email forwards<br /><a href="http://www.yellowpagesservices.com" id="headerbelow" target="_blank"><img src="images/ypol.gif" alt="The Yellow Pages" /></a></p></div><!-- End top area --><!-- Begin middle area, this is the place that contains masses of information, it has the 2 forms.  The search form, and the add something form, they both go to different pages, and have different functions.  I wrapped them all inside of other divs, to allow for maximum flexibility, for future designs or re-designs --><div id="containleftright"><div id="leftdiv"><h3>Add Something Funny:</h3><form name="submitinformation" id="submitinformation" enctype="multipart/form-data" action="whatever.php" method="post"><label for="type">What Type of Funny is it:</label><select tabindex="1"name="type" id="type"><option>Video</option><option>Picture</option><option selected="selected">Joke</option><option>Song</option><option>Poem</option><option>Story</option></select><br /><label for="name">Name the Funny:</label><input tabindex="2" name="name" id="name" type="text" maxlength="80" /><br /><label for="keywords"><a href="keywords.htm">Keywords:</a></label><input tabindex="3" name="keywords" id="keywords" type="text" maxlength="80" /><br /><label for="file">Upload your file here:</label><input tabindex="4" name="file" id="file" type="file" /><br /><input tabindex="5" name="submit" id="submit" type="submit" value="Do It!" /></form></div><div id="middlediv"><p>OR</p></div><div id="rightdiv"><h3>Search For Something Funny:</h3><form name="searchform" id="searchform" action="something.php" method="get"><label for="searchfield">What would you like to search for?</label><br /><input tabindex="6" name="searchfield" id="searchfield" type="text" size="33" maxlength="80" /><br /><input tabindex="7" name="search" id="search" type="submit" value="Do It!" /></form></div></div><!-- End middle area --><!-- begin lower areas, This areas list links to other areas of the site, that contain the newest additions to the database --><div id="wrapmiddle"><h3 id="directory">Directory of Listings:</h3><div id="upperleft"><h3 class="specialheader">VIDEOS</h3><ul><li>Link Number one will go here</li><li>Link Number two will go here</li><li>Link Number three will go here</li></ul></div><div id="uppermid"><h3 class="specialheader">PICTURES</h3><ul><li>Link Number one will go here</li><li>Link Number two will go here</li><li>Link Number three will go here</li></ul></div><div id="upperright"><h3 class="specialheader">JOKES</h3><ul><li>Link Number one will go here</li><li>Link Number two will go here</li><li>Link Number three will go here</li></ul></div><div id="lowerleft"><h3 class="specialheader">SONG</h3><ul><li>Link Number one will go here</li><li>Link Number two will go here</li><li>Link Number three will go here</li></ul></div><div id="lowermid"><h3 class="specialheader">POEM</h3><ul><li>Link Number one will go here</li><li>Link Number two will go here</li><li>Link Number three will go here</li></ul></div><div id="lowerright"><h3 class="specialheader">STORY</h3><ul><li>Link Number one will go here</li><li>Link Number two will go here</li><li>Link Number three will go here</li></ul></div></div><!-- end area near bottom --><!-- Bottom area, this area at the bottom contains copyright information and teh link list, I set it up in a list and ran it sideways, and did some adjusting to margin/padding, so it should work perfectly in teh future if new links need to be added, they should all fall into place quite easily --><div id="bottomwrap"><ul id="bottomnav"><li><a href="aboutfunnyemails.htm" tabindex="8" title="The About Page">About FunnyEmailForwards.com</a></li><li><a href="signup.php" tabindex="9" title="Sign up for the newsletter">Sign Up</a></li><li><a href="contactus.php" tabindex="10" title="Contact Us">Contact Us</a></li></ul><p>Copyright 2000-2006 FunnyEmailFowards.com a service of YellowPages Online.  All Rights Reserved.</p></div><!-- End bottom area --></body></html>

    The form I am currently focusing on is the one accepting files. What I need to find out, what is the average recommended maximum file size. I also need to know a few things.When I first start this I know how to accept the form, I need to figure out, what php functions should I use to validate file types, the extensions. And what kind of file types should I accept into the database, and not accept into the database, I need to figure this out,Ok as for the databaseI was thinking for the table to have these fields, do you think this will cover everything I was wanting, this is hard for me, because I have to allow the owner(ceo) of the company to recieve an email and be able to approve/deny any material inserted into the database. I don't know how to work all of this yet.So I create a table I would havefilenamekeywordsumm file I guessHow do I set the table(I know how to create one and everything now) is there anything I should take into consideration, like that. Do I need to worry about viruses, or find a way to validate for them, so far I know what i need to do,validate the fields as always, validate and screen out specific unwanted file types(extensions), I need it to enter it into the database, under a specific field, and have the email be sent with a link to another page allowing him to approve or deny, what do I do with the database to allow it to not show up until he approves it, and I will have to do it with all of these fields. Another thing I know I have to take into account is the keywords, are going to have to be something I use later when creating the query in the other form to search the information, is there anything special I need to take into account for that. The other question now was I have to do this right, I already know I will end up rewriting the script probably 4-5 times before it's done, I did with the other one, but now I have a broader deeper understanding of php/mysql because of it. The last question I wanted to ask, with my subscribe unsubscribe one I was doing earlier, I had to do 2 scripts one for subscribe and one for unsubscribe, 1 to handle each part. With this do I need 6 different script sections one to handle each file type field like1 for isset($_POST['joke']and all the 5 others, one for each type of field they can choose, I am just looking for guidance advice, direction or anything, thanks.

    HELP

    I have that part now but can't get it to work with my form fields $_POST['name'] and $_POST['email']. Here is what I have$query = "SELECT * FROM signoninfo WHERE name=" . "$_POST['name'] AND email =" . "$_POST['email']";And it is not working.

  13. I tried some changes I picked up and it didn't work.Here is the code I have changed it into.

    <?php// This is a page that holds 2 different scripts, this completely controls the results coming from the form on signup.php, the purpose of these 2 scripts is to detect which button was pressed, if subscribe was pressed the top set of scripts under the giant if statement run.  If unsubscribe is pressed then the if statement corresponding to unsubscribe is ran.// Begin subscribe scriptif (isset($_POST['subscribe'])) {  // tests if subscribe was clicked on, on the form page$errorhandler = ""; // This will control holding error information$management = true; // Gives me full control over when the script runs and stops$regex = "^[A-Za-z0-9\._-]+@([A-Za-z0-9][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";	// regex variables has a regex value initialized into it, this allows me to quickly run	// the regex functions through the email field to test it's format.  It makes sure it 	// contacts an at symbol, and a period, and in the proper places.	if ($_POST['name'] == "") { // checks if name is empty, and puts error info into string  $errorhandler .= "The Name Field was not filled in correctly<br />";	}	if ($_POST['email'] == "") { // checks if email is blank  $errorhandler .= "The Email Field was not filled in correctly<br />";	}	if ($_POST['email'] != $_POST['verifyemail']) { //checks if email fields match  $errorhandler .= "The email address DO NOT match<br />";	}	if (!ereg("$regex", $_POST['email'])) { //tests emails format with regex variable above  $errorhandler .= "The email address is improperly formatted<br />";	}	if ($errorhandler != "") { //This tests the error handler to see if it has recieved  print "$errorhandler"; //any information or not, if it has then it prints the errors  $management = false;  // and changes management to false, which prevents other parts of	}    // the script from running later on down the road	if($management == true) {// This is were management first comes into play.  $connect = mysql_connect("localhost", "#####", "#####"); //connects to db  $select = mysql_select_db("#####"); // selects db 	 if (!$connect || !$select){ //Tests the connection and sellection 	 echo "There was a problem interacting with the database please contact us at "; 	 echo "info@theyellowpagesnetwork.com";  // If it doesn't connect or select it returns 	 $management = false; //errors and changes the management to prevent action during other 	 } //parts of the script  }  // It gets closed 2 times, once for the first if, a second for the other if statement 	   if($management == true) {$query = "SELECT * from signoninfo WHERE name = " . "$_POST['name']" . "AND email =" . "$_POST['email']";$result = mysql_query($query);$matches = mysql_numrows($result);if ($matches == 0) { 	 $inserter = "INSERT INTO signoninfo (name, email) VALUES ('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['email']) . "')"; 	 if(mysql_query($inserter)){  	 $management = true; 	 }else { 	 echo "There was some sort of error interacting with the database.<br />"; 	 echo "Your information was not inserted into it for some unknown reason.<br />"; 	 echo "Please contact us at info@theyellowpagesnetwork.com and notify us of this<br />"; 	 echo "we thank you for your patience!<br />"; 	 $management = false; 	 }  } 	}  	if($management == true) { // start major if mail system construct 	 $mailmanager = true; // sets another manager to manage all email scripts    if($mailmanager == true) {  //tests for the mail manager script    $to = "{$_POST['email']}"; // sets where the email goes to    $subject = "Funny Email Forwards News Letter Notification";  // sets the subject    $message = " This is to notify {$_POST['name']} that you have signed up to ";    $message .= "Funny Email Forwards at {$_POST['email']}.  You should be ";    $message .= "Recieving an email within the next hour that will give you a full list ";    $message .= "of all funny related entries from our database. ";    $message .= "If you do not recieve the other email within 24 hours please contact ";    $message .= "info@theyellowpagesnetwork.com and we will manually send you one.";    // everything under the message variables sets the contents for the mail   	 if(mail($to, $subject, $message)){ // opens up another if construct for email to user   	 echo "Thank you for signing up to the news letter<br />"; // confirmation message   	 echo "You should recieve a confirmation and first letter within 3 hours"; //same here   	 $mailmanager = true; // sets mail manager for use with script below this one   	 }else { // if it doesn't mail then instead it does this   	 echo "There was some sort of problem sending you a confirmation email"; // error message   	 echo "this problem is direcly relating to sending you a confirmation email"; //same   	 echo "I apologize for this error, please contact us at info@theyellowpagesnetwork.com";   	 echo "and we will manually get the process started for you, thanks for your"; //same   	 echo "time and patience"; // same   	 $mailmanager = false; // sets mail manager to false to discontinue the script later      } //closes the else construct above   	 }// closes the bigger if construct containing mail function          if($mailmanager = true){ // starts admin mail section      $to = "businessman332211@hotmail.com"; // sets email to send to      $subject = "Funny Email Forwards Subscription"; // sets subject      $message = "This is to inform you that {$_POST['name']} has signed up to the ";      $message .= "newsletter under {$_POST['email']} at Funny Email Forwards.com.";      // sets email message      mail($to, $subject, $message); // send an email to admin  } //  final if, encloses all coding in admin mail section	} // closes entire mail related script} // closes entire section pertaining to subscribe // End Subscribe Script	//Begin Unsubscribe Script// The script below here is used if someone clicked on unsubscribe on the form. 	 ?>

    I don't know I changed some but it didn't work, any help would be greatly appreciated. I am currently getting this error message.

    Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/all/funnyemailforwards/public_html/apex/signupprocessor.php on line 39
  14. oh ok, I had one more question, I finished my entire script, below is what it looks like, how do I test to see if something exists in a database, I am almost done with half of my script, after this I start on my part of my script that handle's unsubscribe. After that I am done with this part of the website, I need to check the database, to prevent something from going in there 2 times, this took me awhile to get but here is what I have so far, and it all works perfectly, and all the error handling and everything works 100% as expected and I learnt more than I ever thought possible.

    <?php// This is a page that holds 2 different scripts, this completely controls the results coming from the form on signup.php, the purpose of these 2 scripts is to detect which button was pressed, if subscribe was pressed the top set of scripts under the giant if statement run.  If unsubscribe is pressed then the if statement corresponding to unsubscribe is ran.// Begin subscribe scriptif (isset($_POST['subscribe'])) {  // tests if subscribe was clicked on, on the form page$errorhandler = ""; // This will control holding error information$management = true; // Gives me full control over when the script runs and stops$regex = "^[A-Za-z0-9\._-]+@([A-Za-z0-9][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";	// regex variables has a regex value initialized into it, this allows me to quickly run	// the regex functions through the email field to test it's format.  It makes sure it 	// contacts an at symbol, and a period, and in the proper places.	if ($_POST['name'] == "") { // checks if name is empty, and puts error info into string  $errorhandler .= "The Name Field was not filled in correctly<br />";	}	if ($_POST['email'] == "") { // checks if email is blank  $errorhandler .= "The Email Field was not filled in correctly<br />";	}	if ($_POST['email'] != $_POST['verifyemail']) { //checks if email fields match  $errorhandler .= "The email address DO NOT match<br />";	}	if (!ereg("$regex", $_POST['email'])) { //tests emails format with regex variable above  $errorhandler .= "The email address is improperly formatted<br />";	}	if ($errorhandler != "") { //This tests the error handler to see if it has recieved  print "$errorhandler"; //any information or not, if it has then it prints the errors  $management = false;  // and changes management to false, which prevents other parts of	}    // the script from running later on down the road	if($management == true) {// This is were management first comes into play.  $connect = mysql_connect("localhost", "####", "######"); //connects to db  $select = mysql_select_db("######"); // selects db 	 if (!$connect || !$select){ //Tests the connection and sellection 	 echo "There was a problem interacting with the database please contact us at "; 	 echo "info@theyellowpagesnetwork.com";  // If it doesn't connect or select it returns 	 $management = false; //errors and changes the management to prevent action during other 	 } //parts of the script  }  // It gets closed 2 times, once for the first if, a second for the other if statement 	   if($management == true) { 	 $inserter = "INSERT INTO signoninfo (name, email) VALUES ('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['email']) . "')"; 	 if(mysql_query($inserter)){  	 $management = true; 	 }else { 	 echo "There was some sort of error interacting with the database.<br />"; 	 echo "Your information was not inserted into it for some unknown reason.<br />"; 	 echo "Please contact us at info@theyellowpagesnetwork.com and notify us of this<br />"; 	 echo "we thank you for your patience!<br />"; 	 $management = false; 	 }  }   	if($management == true) { // start major if mail system construct 	 $mailmanager = true; // sets another manager to manage all email scripts    if($mailmanager == true) {  //tests for the mail manager script    $to = "{$_POST['email']}"; // sets where the email goes to    $subject = "Funny Email Forwards News Letter Notification";  // sets the subject    $message = " This is to notify {$_POST['name']} that you have signed up to ";    $message .= "Funny Email Forwards at {$_POST['email']}.  You should be ";    $message .= "Recieving an email within the next hour that will give you a full list ";    $message .= "of all funny related entries from our database. ";    $message .= "If you do not recieve the other email within 24 hours please contact ";    $message .= "info@theyellowpagesnetwork.com and we will manually send you one.";    // everything under the message variables sets the contents for the mail   	 if(mail($to, $subject, $message)){ // opens up another if construct for email to user   	 echo "Thank you for signing up to the news letter<br />"; // confirmation message   	 echo "You should recieve a confirmation and first letter within 3 hours"; //same here   	 $mailmanager = true; // sets mail manager for use with script below this one   	 }else { // if it doesn't mail then instead it does this   	 echo "There was some sort of problem sending you a confirmation email"; // error message   	 echo "this problem is direcly relating to sending you a confirmation email"; //same   	 echo "I apologize for this error, please contact us at info@theyellowpagesnetwork.com";   	 echo "and we will manually get the process started for you, thanks for your"; //same   	 echo "time and patience"; // same   	 $mailmanager = false; // sets mail manager to false to discontinue the script later      } //closes the else construct above   	 }// closes the bigger if construct containing mail function          if($mailmanager = true){ // starts admin mail section      $to = "businessman332211@hotmail.com"; // sets email to send to      $subject = "Funny Email Forwards Subscription"; // sets subject      $message = "This is to inform you that {$_POST['name']} has signed up to the ";      $message .= "newsletter under {$_POST['email']} at Funny Email Forwards.com.";      // sets email message      mail($to, $subject, $message); // send an email to admin  } //  final if, encloses all coding in admin mail section	} // closes entire mail related script} // closes entire section pertaining to subscribe // End Subscribe Script	//Begin Unsubscribe Script// The script below here is used if someone clicked on unsubscribe on the form. 	 ?>

    HELP

    How do I check a database to see if something exists, I have my whole script worked out, it works perfectly but I don't know how to get it to where it checks the database first.

    <?php// This is a page that holds 2 different scripts, this completely controls the results coming from the form on signup.php, the purpose of these 2 scripts is to detect which button was pressed, if subscribe was pressed the top set of scripts under the giant if statement run.  If unsubscribe is pressed then the if statement corresponding to unsubscribe is ran.// Begin subscribe scriptif (isset($_POST['subscribe'])) {  // tests if subscribe was clicked on, on the form page$errorhandler = ""; // This will control holding error information$management = true; // Gives me full control over when the script runs and stops$regex = "^[A-Za-z0-9\._-]+@([A-Za-z0-9][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";	// regex variables has a regex value initialized into it, this allows me to quickly run	// the regex functions through the email field to test it's format.  It makes sure it 	// contacts an at symbol, and a period, and in the proper places.	if ($_POST['name'] == "") { // checks if name is empty, and puts error info into string  $errorhandler .= "The Name Field was not filled in correctly<br />";	}	if ($_POST['email'] == "") { // checks if email is blank  $errorhandler .= "The Email Field was not filled in correctly<br />";	}	if ($_POST['email'] != $_POST['verifyemail']) { //checks if email fields match  $errorhandler .= "The email address DO NOT match<br />";	}	if (!ereg("$regex", $_POST['email'])) { //tests emails format with regex variable above  $errorhandler .= "The email address is improperly formatted<br />";	}	if ($errorhandler != "") { //This tests the error handler to see if it has recieved  print "$errorhandler"; //any information or not, if it has then it prints the errors  $management = false;  // and changes management to false, which prevents other parts of	}    // the script from running later on down the road	if($management == true) {// This is were management first comes into play.  $connect = mysql_connect("localhost", "####", "######"); //connects to db  $select = mysql_select_db("######"); // selects db 	 if (!$connect || !$select){ //Tests the connection and sellection 	 echo "There was a problem interacting with the database please contact us at "; 	 echo "info@theyellowpagesnetwork.com";  // If it doesn't connect or select it returns 	 $management = false; //errors and changes the management to prevent action during other 	 } //parts of the script  }  // It gets closed 2 times, once for the first if, a second for the other if statement 	   if($management == true) { 	 $inserter = "INSERT INTO signoninfo (name, email) VALUES ('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['email']) . "')"; 	 if(mysql_query($inserter)){  	 $management = true; 	 }else { 	 echo "There was some sort of error interacting with the database.<br />"; 	 echo "Your information was not inserted into it for some unknown reason.<br />"; 	 echo "Please contact us at info@theyellowpagesnetwork.com and notify us of this<br />"; 	 echo "we thank you for your patience!<br />"; 	 $management = false; 	 }  }   	if($management == true) { // start major if mail system construct 	 $mailmanager = true; // sets another manager to manage all email scripts    if($mailmanager == true) {  //tests for the mail manager script    $to = "{$_POST['email']}"; // sets where the email goes to    $subject = "Funny Email Forwards News Letter Notification";  // sets the subject    $message = " This is to notify {$_POST['name']} that you have signed up to ";    $message .= "Funny Email Forwards at {$_POST['email']}.  You should be ";    $message .= "Recieving an email within the next hour that will give you a full list ";    $message .= "of all funny related entries from our database. ";    $message .= "If you do not recieve the other email within 24 hours please contact ";    $message .= "info@theyellowpagesnetwork.com and we will manually send you one.";    // everything under the message variables sets the contents for the mail   	 if(mail($to, $subject, $message)){ // opens up another if construct for email to user   	 echo "Thank you for signing up to the news letter<br />"; // confirmation message   	 echo "You should recieve a confirmation and first letter within 3 hours"; //same here   	 $mailmanager = true; // sets mail manager for use with script below this one   	 }else { // if it doesn't mail then instead it does this   	 echo "There was some sort of problem sending you a confirmation email"; // error message   	 echo "this problem is direcly relating to sending you a confirmation email"; //same   	 echo "I apologize for this error, please contact us at info@theyellowpagesnetwork.com";   	 echo "and we will manually get the process started for you, thanks for your"; //same   	 echo "time and patience"; // same   	 $mailmanager = false; // sets mail manager to false to discontinue the script later      } //closes the else construct above   	 }// closes the bigger if construct containing mail function          if($mailmanager = true){ // starts admin mail section      $to = "businessman332211@hotmail.com"; // sets email to send to      $subject = "Funny Email Forwards Subscription"; // sets subject      $message = "This is to inform you that {$_POST['name']} has signed up to the ";      $message .= "newsletter under {$_POST['email']} at Funny Email Forwards.com.";      // sets email message      mail($to, $subject, $message); // send an email to admin  } //  final if, encloses all coding in admin mail section	} // closes entire mail related script} // closes entire section pertaining to subscribe // End Subscribe Script	//Begin Unsubscribe Script// The script below here is used if someone clicked on unsubscribe on the form. 	 ?>

    someone please help me with this, I learnt a lot but I still ran into this problem, i have a few ideas but none of them worked. I wish they just allower LIMIT 1 to work in this situation, it would be a whole lot easier, than forcing another way. Any advice thanks.

  15. ('" . mysql_real_escape_string($_POST['name']) . "', '" . mysql_real_escape_string($_POST['email']) . "')";This is what you gave me earlier, can you explain something, when I am inserting what does the ' and " at the beginning do, and I know what the . is for but why is it there?

  16. I had finally gotten it, what was happening was I was testing it, but when the script got there it testing to see if it was true, IF IT wasn't true then it popped up that message in the else statement so I changed that part to this.

    <?phpif (isset($_POST['subscribe'])) {$errorhandler = ""; // This will control holding error information$management = true; // Gives me full control over when the script runs and stops$regex = "^[A-Za-z0-9\._-]+@([A-Za-z0-9][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";	// regex variables has a regex value initialized into it, this allows me to quickly run	// the regex functions through the email field to test it's format.  It makes sure it 	// contacts an at symbol, and a period, and in the proper places.	if ($_POST['name'] == "") { // checks if name is empty, and puts error info into string  $errorhandler .= "The Name Field was not filled in correctly<br />";     	}	if ($_POST['email'] == "") { // checks if email is blank  $errorhandler .= "The Email Field was not filled in correctly<br />";		}	if ($_POST['email'] != $_POST['verifyemail']) { //checks if email fields match  $errorhandler .= "The email address DO NOT match<br />";		}	if (!ereg("$regex", $_POST['email'])) { //tests emails format with regex variable above  $errorhandler .= "The email address is improperly formatted<br />";  	}	if ($errorhandler != "") { //This tests the error handler to see if it has recieved  print "$errorhandler"; //a string information if so it passes the information below.  $management = false; 	}	if($management == true) {// This is were management first comes into play.  $connect = mysql_connect("localhost", "####", "#####");  $select = mysql_select_db("#####"); 	 if (!$connect || !$select){ 	 echo "There was a problem interacting with the database please contact us at "; 	 echo "info@theyellowpagesnetwork.com"; 	 $management = false; 	 }  }      if($management == true) {  echo "everything seemed to work all right";  }     	 }?>

    and it worked, I just have to think ahead from now on when organizing me if else statements, I was unaware I could create an if statement, with others inside of it, to that level, I am starting to understand control structures more and more, thanks for all the help I really appreciate it.

  17. when an error is encountered in the script, it should change management to false, when the scripts tests if management is true and it's not then it shouldn't try to run that part of the script at all, unless there were no errors, and management stayed true, do you see why I am having such a problem now, I don't understand this at all.

  18. and this is the exact code you gave me, just set up to simulate if someone tried entering form information and forgot to fill out the fields.The only changes are at the top, to simulate if someone had forgot to enter the form information

    <?php$subscribe = "hello";$name = "";$email = "";$verifyemail = "";if (isset($subscribe)) {$errorhandler = ""; // This will control holding error information$management = true; // Gives me full control over when the script runs and stops$regex = "^[A-Za-z0-9\._-]+@([A-Za-z0-9][A-Za-z0-9-]{1,62})(\.[A-Za-z][A-Za-z0-9-]{1,62})+$";// regex variables has a regex value initialized into it, this allows me to quickly run// the regex functions through the email field to test it's format.  It makes sure it// contacts an at symbol, and a period, and in the proper places.if ($name == "") { // checks if name is empty, and puts error info into string$errorhandler .= "The Name Field was not filled in correctly<br />";$management = false;    }if ($email == "") { // checks if email is blank$errorhandler .= "The Email Field was not filled in correctly<br />";$management = false;}if ($email != $verifyemail) { //checks if email fields match$errorhandler .= "The email address DO NOT match<br />";$management = false;}if (!ereg("$regex", $email)) { //tests emails format with regex variable above$errorhandler .= "The email address is improperly formatted<br />";$management = false;}if (!empty($errorhandler)) { //This tests the error handler to see if it has recievedprint "$errorhandler"; //a string information if so it passes the information below.$management = false;}if($management == true) {// This is were management first comes into play.//$connect = mysql_connect("localhost", "#####", "######");//$select = mysql_select_db("#######");echo "sql<br>";}else {echo "There was a problem interacting with the database, please contact us at";echo "info@theyellowpagesnetwork.com";$management = false;}if($management == true) {echo "everything seemed to work all right";}}?>

  19. Yes that is great, but here is what happensYou can't simulate a form you said you didn't feel like it, what happens is I changed the variables name, email, and verify email to "" which is what it would be if someone was filling out a form and forgot to fill them in, and the EXACT SAME Thing happen that was happening with my script I get this. THE SAME freaking nightmare

    The Name Field was not filled in correctlyThe Email Field was not filled in correctlyThe email address is improperly formattedThere was a problem interacting with the database, please contact us atinfo@theyellowpagesnetwork.com
    and that is from your script specifically, now you see why I am so pissed, and having so many problems, even people with triple my experience, are redoing my script and the same thing is happening, you and someone else, I don't understand the logic behind this error, I have thought through this script 200 times.
  20. That's still not the root of the problem, but I understand what you are saying it could cause me problems later, I will change that, just for that sake, but it still won't help me figure out what is causing this other nightmare to happen. I see what you mean though, in the manual it is something that said as a user comment, but currently I changed the script like you siad, it's still having a nightmare, I Don't understand this.

  21. I also tried a complete redo, someone rewrote the script for me entirely, I tried it as a test run and it does the same thing, it goes through and reports all the errors and still returns the database be interacted with, I have run into ######, a programmers worse nightmare, This is the most evil, gruesome thing I have ever encountered. It's a nightmare I don't think I will ever wake up from, an unruly script, that you can't beat into submission.

  22. Thats not fixing the problem. I chose this method because I am trying to learn various functions, the php.net manual says specifically that is_string tests a variable to see if it is a string if it is, it returns true, if not it returns false, it says specifically that if is_string checks a variable and it has an empty string meaning "" as it's value then it will return false, because essentially "" == null, with this being true it's saying $errorhandler = null;it's the same thing. But that has nothing to do with the current problem, I did however try that out to test to make sure, and the script still misperformed, I don't understand the logic behind it doing this.

×
×
  • Create New...