-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Welcome (to be honest I end up creating small scripts for SQL cleanup's) but please skim the file as its was just a quick draft!
-
ooow that's a nice font.. now I can have update my jpeg of my Bank PIN on my site
-
you mean like this ? $result = preg_replace('/(.*?)\t(.*?)\t(.*?)\t(.*?)\t(.*)$/im', 'insert into client_desc (first_name, last_name, Address1, City, Postal, Plate_Number, Email, Phone, Robot_id, description ) values(\'\1\',\'\2\',\'\3\',\'\4\',\'\5\',\'\',\'\',\'\',\'\',\'\')', $data); see attached [attachment deleted by admin]
-
Okay, IMHO I hate the code! However line 50 of login.php should be query_mysql("INSERT INTO `Sessions` (`Cookie`, `User ID`, `User Type`, `Activity`, `Login`) VALUES ('" . escape($temp) . "', '" . escape($user["Supplier ID"]) . "', 'Supplier', '" . time() . "', '" . time() . "')");
-
You should be able to solve this with a query update, without the code that lists the products or at least some info about how it was coded its really hard to say... Posting the code you believe is the problem is a good start also any info about the database schema would help, PHP tags are the tags (see the # button)
-
modulus gives you the remainder of a division for example 100 % 24 = 4 24 goes into 100, 4 times but then has 4 remaining 100 - 24 = 76 76 - 24 = 52 52 - 24 = 28 28 - 24 = 4
-
Using the UPDATE! just echo the record values in to the form along with the record prime id (put in a hidden field later), then when you submit the form if the ID is set then use update instead of insert, ie if(empty($_POST['ID'])){ $ID = (int)$_POST['ID']; $query = "UPDATE users SET user_name = '$user_name', password='$password', etc etc etc WHERE ID=$ID"; }else{ $query = "INSERT INTO users (user_name, password, f_name, l_name, email, date) VALUES ('$user_name','$password', '$f_name', '$l_name', '$email', '$date')"; }
-
Wow, Strange how within seconds of registering a member would post here and then signs out then the thread starter logs back in to reply! I am not suggesting its the same member or anything (being in the same country doesn't prove anything)
-
No, if the email is being sent then it should be okay.. it down to how the client parses the email, Note how you seam to have extra lines, The script I posted was tested on my windows machine, I guess you could try changing the /r/n's to PHP_EOL ie $headers ="Content-Type: multipart/mixed;boundary=\"PHP-mixed-{$sep}\"\r\n"; // additional headers $headers .= "To: You <$to>\r\n"; $headers .= "From: Me <$from>\r\n"; ] to $headers ="Content-Type: multipart/mixed;boundary=\"PHP-mixed-{$sep}\"".PHP_EOL; // additional headers $headers .= "To: You <$to>".PHP_EOL; $headers .= "From: Me <$from>".PHP_EOL;
-
Please use the previously attached file, as it seams to have extra spaces [/img] [attachment deleted by admin]
-
Tested on outlook 2007 and the attached script works for me!
-
change --PHP-mixed-{$sep} Content-Type: multipart/alternative; boundary="PHP-alt-{$sep}" to --PHP-mixed-{$sep} Content-Type: multipart/alternative;boundary="PHP-alt-{$sep}" EDIT: in fact try the attached [attachment deleted by admin]
-
try this <?php $to = "tomail@hotmail.com"; $from = "frommail@hotmail.com"; $subject = "=?iso-2022-jp?B?".base64_encode(mb_convert_encoding("...Japanese TEXT goes here...","JIS","SHIFT_JIS"))."?="; // Setting a timezone, mail() uses this. date_default_timezone_set('America/New_York'); // recipients // subject $subject = "Test for Embedded Image & Attachement"; // Create a boundary string. It needs to be unique $sep = sha1(date('r', time())); // Add in our content boundary, and mime type specification: $headers ="Content-Type: multipart/mixed;boundary=\"PHP-mixed-{$sep}\"\r\n"; // additional headers $headers .= "To: You <$to>\r\n"; $headers .= "From: Me <$from>\r\n"; $file = chunk_split(base64_encode(file_get_contents('TEMP_Folder\abcd.gif'))); // Your message here: $body =<<<EOBODY --PHP-mixed-{$sep} Content-Type: multipart/alternative; boundary="PHP-alt-{$sep}" --PHP-alt-{$sep} Content-Type: text/html <html> <head> <title>Test HTML Mail</title> </head> <body> <font color="red">This should be HTML but it doesnt work damn!!!</font> <img src="cid:PHP-CID-{$sep}" /> </body> </html> --PHP-alt-{$sep} Content-Type: text/plain plain text --PHP-alt-{$sep} Content-Type: multipart/related; boundary="PHP-related-{$sep}" --PHP-related-{$sep} Content-Type: image/gif Content-Transfer-Encoding: base64 Content-ID: <PHP-CID-{$sep}> {$file} --PHP-related-{$sep}-- --PHP-alt-{$sep}-- --PHP-mixed-{$sep}-- EOBODY; mail($to, $subject, $body, $headers); ?>
-
2 quick things, 1. $body as a extra return at the start, remove that, 2. --PHP-related-{$sep} should be --PHP-related-{'.$sep.'} fix them and try again, if it don't work I'll look closer
-
Sure function flooring($number, $significance = 1) { return ( is_numeric($number) && is_numeric($significance) ) ? (floor($number/$significance)*$significance) : false; } echo flooring(1.3, 0.5); // 1 echo flooring(1.7, 0.5); // 1.5 put in a simple inline code it would be $value = 1.7; echo sprintf("%01.2f", floor($value/0.5)*0.5);
-
Nothing (technically) wrong with the code Define: Breaks your page
-
What do you want it to display ? for birthday echo $birthday; etc
-
<?php function ceiling($number, $significance = 1) { return ( is_numeric($number) && is_numeric($significance) ) ? (ceil($number/$significance)*$significance) : false; } echo ceiling(1.3, 0.5); // 1.5 echo ceiling(1.7, 0.5); // 2 Use your own formatting to format it Hope this helps
-
shouldn't $birthday = $year."-".$month."-".$day; be $birthday = birthday($year."-".$month."-".$day); and return $year_diff; echo $year_diff; be echo $year_diff; return $year_diff; Infact not sure why you even have the echo! and you maybe better off sending 3 parameters instead of 1
-
You may want to look at preg_match or strpos substr
-
if you don't want to change the size then yo don't want to change the DPI but the PPI instead.
-
I am not sure what you mean, but you could just use date to format the result, but if you wanted to use the array why not just do this echo $titleMonths[$items['month']-1] or $titleMonths = array ( 1=> 'January', 2=> 'Febuary', 3=> 'March', 4=> 'April', 5=> 'May', 6=> 'June', 7=> 'July', 8=> 'August', 9=> 'Septmeber', 10=> 'October', 11=> 'November', 12=> 'Decem' ); echo $titleMonths[$items['month']]
-
Why ? You could use CURL, to post the username and password to the site and return the HTML to PHP as a string, the defence against this is Captcha (image verification)
-
welcome, if this is solved please click topic solved
-
maybe use str_ireplace instead