-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
to be trueful one of these should work, SMTP = smtp.tiscali.co.uk sendmail_from = garydt88@tiscali.co.uk smtp_port = 25 ;auth_username= garydt88@tiscali.co.uk ;auth_password= ***** SMTP = smtp.tiscali.co.uk sendmail_from = garydt88@tiscali.co.uk smtp_port = 25 auth_username= garydt88@tiscali.co.uk auth_password= ***** maybe get the php.ini off of the server and compare, or create a phpinfo(); and check the setting on the server
-
[SOLVED] Fatal error: Cannot redeclare myfunction()
MadTechie replied to villain222's topic in PHP Coding Help
i am not 100% sure what your trying to do but.. heres a clean version.. it may work.. <?php $sessionid = $_SESSION['userid']; $join = "SELECT items.*, image.* FROM items, image WHERE items.imageid = image.imageid AND items.userid = $sessionid"; include_once "raffleprogresstemp.php"; echo "<strong>"; $PicSQL = mysql_query($join)or die(mysql_error()); while ($row=mysql_fetch_array($PicSQL)) { echo $row['name']."<br>"; echo $row['descrip']."<br>"; //echo $row['imagename']; echo "<img src=\"/dev/uploads/". $row['imagename'] ."thumbnail\">"; //echo $row['imageid']; echo "<br>Price: "; echo $row['price']; $itemImg = $row['imageid']; $itemid = $row['id']; ShowPB($itemid); echo "<hr>"; } ?> <?php function ShowPB($itemid) { if($itemid <0) return; $progSQL = mysql_query("SELECT items.*, tickets.* FROM items, tickets WHERE items.id = tickets.item AND items.id = $itemid"); //Not sure what your trying to do here??? //but it will only get the LAST value... /* while($row6=mysql_fetch_array($progSQL)) * { * $price = $row6['price']; * $number=mysql_num_rows($progSQL); * //echo "total tickets sold= ". $number; * echo "<br>"; * } */ //Revised version of above $row6=mysql_fetch_array($progSQL); $price = $row6['price']; $number=mysql_num_rows($progSQL); //echo "total tickets sold= ". $number; echo "<br>"; progressBar($price, $number); } function progressBar($price, $number) { $percentage=($number / $price) * 100; echo '<table cellpadding=1 cellspacing=1 border=1 width=100><TR><td><img src="images/bar.jpg" height=10 width='.$percentage.'></td></TR></table>' ; } ?> -
Okay.. i'll try to explain.. their different types of email services.. but buy default PHP uses SMTP... so you don't need to change anything.. whats the problem.. why do you think you need to change it ?
-
ahh very true (if the invalid file is AFTER a valid one) OK simple fix.. Do one or both of the below (each will fix the proble) if($copy) to if($copy && $Valid) and/or if(file_exists($path . $file_name) ) { echo "The file {$file_name} already exists."; to if(file_exists($path . $file_name) ) { echo "The file {$file_name} already exists."; $copy= false;
-
PHP headers come up with error and dont work using iis server
MadTechie replied to GrayFox12's topic in PHP Coding Help
its 2 single quotes, thats nothing.. as its part of the string it will have no effect.. but i guess its worth a shot.. it would make my day to see IIS fall over at such a thing.. -
one thing i know cause some problems header("Content-Disposition: attachment; filename=".$filename); should be header("Content-Disposition: attachment; filename=\"$filename\""); i assume you don't have magic quotes on! change header("Content-Type: application/force-download",false); to header("Content-Type: application/force-download"); do you have all the latest patches for IIS ?
-
i corrected the S's i added the edit incase you tried it before the correction.. sounds cool, PM me when you have a more details..
-
thanx.. and i hope so.. happy PHPing
-
Coool,
-
you could have else.. remember i am not 100% sure of the logic you want.. to be truful the formatting is the key..
-
added an error reporting thing.. *untested <?php //This is the directory where images will be saved $path = '../images/'; //This gets all the other information from the form $name=$_POST['name']; $suburb=$_POST['suburb']; $price=$_POST['price']; $content=$_POST['content']; $content2=$_POST['content2']; $agentmobile=$_POST['agentmobile']; $agentemail=$_POST['agentemail']; $uploadFile0=($_FILES['uploadFile0']['name']); $uploadFile1=($_FILES['uploadFile1']['name']); $uploadFile2=($_FILES['uploadFile2']['name']); $uploadFile3=($_FILES['uploadFile3']['name']); $uploadFile4=($_FILES['uploadFile4']['name']); $uploadFile5=($_FILES['uploadFile5']['name']); $uploadFile6=($_FILES['uploadFile6']['name']); $uploadFile7=($_FILES['uploadFile7']['name']); $uploadFile8=($_FILES['uploadFile8']['name']); // Connects to your Database mysql_connect("localhost", "root", "5050888202") or die(mysql_error()) ; mysql_select_db("gcproperty") or die(mysql_error()) ; // Uploads Images $uploadNeed = $_POST['uploadNeed']; // start for loop $errors = array(); for($x=0;$x<$uploadNeed;$x++) { $file_name = $_FILES['uploadFile'. $x]['name']; //test $Size = $_FILES['uploadFile'. $x]['size']; //Test Check $Valid = false; if(valid_ext($file_name)) { $Valid = true; }else{ $errors[] = "$file_name has an Invalid FileType"; } echo "<br>"; if(!valid_size($Size)) { $Valid = false; $errors[] = "$file_name is too large"; } if($Valid) { // strip file_name of slashes $file_name = stripslashes($file_name); $file_name = str_replace("'","",$file_name); if(file_exists($path . $file_name) ) { $errors[] = "The file {$file_name} already exists."; }else { $copy = move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], $path . $file_name); } } } // check if successfully copied if($copy) { print "<meta http-equiv=\"refresh\" content=\"0;URL=property_added_successfully.php\">"; //Writes the information to the database mysql_query("INSERT INTO `employees` VALUES ('$name', '$suburb', '$price', '$content', '$content2','$agentmobile', '$agentemail','$uploadFile0','$uploadFile1', '$uploadFile2', '$uploadFile3', '$uploadFile4', '$uploadFile5', '$uploadFile6', '$uploadFile7', '$uploadFile8')") ; } if(count($errors)>0) { echo "The following File(s) could not be uploaded,<BR>"; foreach($errors as $err) { "$err <br>"; } echo "The file must be under 1 meg and be of a valid extension type, (jpeg, ,jpe, jpg, png or gif!<br /> <br /> Please go <a href=\"property_add.php\">back</a> and try again"; } // end of loop //***FUNCTIONS //filter extensions function valid_ext($file_name) { $valid = array("jpeg","jpg","jpe","png","gif"); $extension = strtolower(substr($file_name,-3,3)); return (in_array($extension, $valid)); } //filter by size, function valid_size($size) { return ($size <= 1048576); } ?> EDIT: OOOOPS forgot the s on errors EDIT: also i have never heard of a jpe file!!
-
you mean this ? *re-formatted <?php if( $property_type == "Agricultural Land" || $property_type == "Business" || $property_type == "Cafe/Deli" || $property_type == "Commerical Site" || $property_type == "Development Site" || $property_type =="Farm Land" || $property_type == "Franchises" || $property_type == "Garage" || $property_type == "Health and Beauty" || $property_type == "Hotels/B+Bs" || $property_type == "Industrial Unit" || $property_type == "Investment" || $property_type == "Licensed Premises" || $property_type == "New Developments" || $property_type == "Office Share" || $property_type == "Office Unit" || $property_type == "Parking Space") { echo "<input type='hidden' name='numberofrooms' value='1'>"; }elseif( $property_type == "Public House" || $property_type == "Retail Unit" || $property_type == "Shops" || $property_type == "Supermarkets" || $property_type == "Warehouse Unit") { echo "<td align='left'>"; echo "<font size=2 face='arial' color='#650066'><b>Bedrooms</b></font>"; echo "</td>"; echo "<td align='left'>"; echo "<select name='numberofrooms'>"; include("select/numrooms.inc.php"); echo "</select></td>"; } ?>
-
on an INSERT.. don't use CONCAT (theirs no need) use this (same as echo'ing) VALUES('$txtShippingFirstName $txtShippingLastName'),etc or even $FullName = "$first $surname"; VALUES('$FullName '),etc
-
i'm not sure what your asking for but .. maybe.. <?php if(!empty($property_type)) { echo "<input type='hidden' name='numberofrooms' value='1'>"; } else { echo "<td align='left'>"; echo "<font size=2 face='arial' color='#650066'><b>Bedrooms</b></font>"; echo "</td>"; echo "<td align='left'>"; echo "<select name='numberofrooms'>"; include("select/numrooms.inc.php"); echo "</select></td>"; } ?>
-
PHP headers come up with error and dont work using iis server
MadTechie replied to GrayFox12's topic in PHP Coding Help
may be useful (but i don't know) Errors may occur when you run CGI applications on a fast multi-processor computer that is running IIS 5.0 and IIS 6.0 http://support.microsoft.com/default.aspx?scid=kb;EN-US;884764 OR Try creating the "\Temp" folder in your root directory and share access to all (guest) users. (its used for caching.. so i hear) -
1).. really need to see some code.. but check the force download, here 2) your probably sending extra into to the page.. (error message or CSS.. anything can mess it up)
-
i used NOW(), i guess you could add the () after the date on your version
-
try this (quick fix) <?php //This is the directory where images will be saved $path = '../images/'; //This gets all the other information from the form $name=$_POST['name']; $suburb=$_POST['suburb']; $price=$_POST['price']; $content=$_POST['content']; $content2=$_POST['content2']; $agentmobile=$_POST['agentmobile']; $agentemail=$_POST['agentemail']; $uploadFile0=($_FILES['uploadFile0']['name']); $uploadFile1=($_FILES['uploadFile1']['name']); $uploadFile2=($_FILES['uploadFile2']['name']); $uploadFile3=($_FILES['uploadFile3']['name']); $uploadFile4=($_FILES['uploadFile4']['name']); $uploadFile5=($_FILES['uploadFile5']['name']); $uploadFile6=($_FILES['uploadFile6']['name']); $uploadFile7=($_FILES['uploadFile7']['name']); $uploadFile8=($_FILES['uploadFile8']['name']); // Connects to your Database mysql_connect("localhost", "root", "5050888202") or die(mysql_error()) ; mysql_select_db("gcproperty") or die(mysql_error()) ; // Uploads Images $uploadNeed = $_POST['uploadNeed']; // start for loop for($x=0;$x<$uploadNeed;$x++) { $file_name = $_FILES['uploadFile'. $x]['name']; //test $Size = $_FILES['uploadFile'. $x]['size']; //Test Check $Valid = false; if(valid_ext($file_name)) { echo "valid ext"; $Valid = true; }else{ echo "invalid Type"; } echo "<br>"; if(valid_size($Size)) { echo "valid size"; }else{ $Valid = false; echo "invalid Size"; } if($Valid) { // strip file_name of slashes $file_name = stripslashes($file_name); $file_name = str_replace("'","",$file_name); if(file_exists($path . $file_name) ) { echo "The file {$file_name} already exists."; }else { $copy = move_uploaded_file($_FILES['uploadFile'. $x]['tmp_name'], $path . $file_name); } } } // check if successfully copied if($copy) { print "<meta http-equiv=\"refresh\" content=\"0;URL=property_added_successfully.php\">"; //Writes the information to the database mysql_query("INSERT INTO `employees` VALUES ('$name', '$suburb', '$price', '$content', '$content2','$agentmobile', '$agentemail','$uploadFile0','$uploadFile1', '$uploadFile2', '$uploadFile3', '$uploadFile4', '$uploadFile5', '$uploadFile6', '$uploadFile7', '$uploadFile8')") ; }else{ echo "$file_name The File(s) could not be uploaded!<br>The file must be under 1 meg and be of a valid extension type, (jpeg, ,jpe, jpg, png or gif!<br /> <br /> Please go back and try agian"; } // end of loop //***FUNCTIONS //filter extensions function valid_ext($file_name) { $valid = array("jpeg","jpg","jpe","png","gif"); $extension = strtolower(substr($file_name,-3,3)); return (in_array($extension, $valid)); } //filter by size, function valid_size($size) { return ($size <= 1048576); } ?>
-
try this $query ="select from product where unixtime_stamp(now())>='$lastweek' and unixtime_stamp(now())<$today";
-
lack of quotes $sql = "INSERT INTO clientaddresses(Name, Address1, City, State, Zip, Phone, FlagStatus, DateStatus, DateCreated) VALUES ('$txtShippingLastName','$txtShippingAddress1','$txtShippingCity','$txtShippingState','$txtShippingPostalCode','$txtShippingPhone','A',date('YmdHis'),date('YmdHis'))"; also check the date field
-
But it works.. ??? ooow Okay one thing.. try this switch($_FILES['uploadfile']['type']) { case "image/gif": $src = imagecreatefromgif($uploadedfile);//Create from GIF! $type = "gif"; break; case "image/jpg": case "image/pjpeg": //Add this (photoshop jpeg) case "image/jpeg": $src = imagecreatefromjpeg($uploadedfile);//Create from JPEG! $type = "jpg"; break; }
-
setup one and add another table, for data and a tinyint for approve 1=approved, as thorpe says
-
try [mail function] ; For Win32 only. SMTP = smtp.tiscali.co.uk smtp_port = 25 auth_username= garydt88@tiscali.co.uk auth_password= mypassword ; For Win32 only. sendmail_from = garydt88@tiscali.co.uk *googled the tiscali SMPT domain
-
please enter a valid SMTP domain!
-
What do you need to know ? its probably best to use a mysql database, do you have a Moderation/User system inplace ?