Jump to content

MSUK1

Members
  • Posts

    188
  • Joined

  • Last visited

Everything posted by MSUK1

  1. so... guessing UPDATE products SET price = (price = Round())
  2. ok that was great! is there an sql command i can use to round all prices to nearest pound? i.e price: 74.53 -> 75.00 or 74.47 -> 74.00
  3. thats genius ill give it a try! thankyou!
  4. their is over 1000 products, the mysql export doesnt work, just crashes our phpmyadmin... so how can i get the php script to go through each entry all at once? and multiply current value by 2.5%
  5. a douche hard coded my shopping carts VAT to 17.5% i wanted to just adjust the VAT in the shopping cart, but he has removed the feature.. so what i was thinking to counter it, was to make a php script that could EDIT all the prices in the database +2.5% can anybody help me with this please?
  6. so in php // Additional headers $headers .= 'From: \"MSUKGroup\" <info@msukgroup.co>' . "\r\n";
  7. yes shared, but i had the hosting provider change the outgoing mail IP still think thats the issue? if so i wil purchase a Dedi IP
  8. // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: MSUKGroup <info@msukgroup.co>' . "\r\n"; // Mail it if(mail($msuk, $Subject2, $usermail, $headers)){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; } i know im using an out-dated refresh method just focus on the headers for now hehe x
  9. i think because of my code used to send the mail, on my site, its appearing in the spam folder of most of my clients PLUS myself is their a way to eradicate this? correct headers? etc?
  10. Process is Index.php --> process.php --> index.php?qwerty
  11. realised what the mistake was their, here is what ive updated to: // Mail it if(mail($EmailTo, $Subject2, $usermail, $headers)){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error1\">"; } if(mail($EmailFrom, $Subject2, $staffmail, $headers)){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error2\">"; } still not sending?
  12. ok i get that now, i have done this: // Mail it $mail1 = "$EmailTo, $Subject2, $usermail, $headers"; $mail2 = "$EmailFrom, $Subject2, $staffmail, $headers"; $sent = mail($mail1); $sent2 = mail($mail2); if($mail1){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error1\">"; } if($mail2){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error2\">"; } i get this error, then it returns me to successful:
  13. because usually if theirs an error on line 74, php stops executes upto that line error? the database function is after mail, theirfore if their was an error at the mail process the data shouldnt be getting submitted to the DB? excuse my ignorance if im wrong can you advise what i can do to test this then?
  14. the information is being sent to the database and is being stored correctly, so if their was an error at the email stage it shouldnt work at all!
  15. I have found it a bit strange recently how i stopped receiving online emails from my website, we havnt changed the code as far as i am aware. but for some reason neither the user or staff receives an email the code below is our process for the mail. please could somebody advise why? <?php $host="localhost"; // Host name $username="HIDDEN"; // Mysql username $password="HIDDEN"; // Mysql password $db_name="HIDEEN"; // Database name $tbl_name="HIDDEN"; // Table name $name = $_POST['name']; $email = $_POST['email']; $web = $_POST['web']; $tel = $_POST['tel']; $sub = $_POST['sub']; $message = $_POST['message']; $ip = $_SERVER['REMOTE_ADDR']; $datetime=date("d-m-y"); //date time // validation function is_valid_email($email) { return preg_match('#^[a-z0-9.!\#$%&\'*+-/=?^_`{|}~]+@([0-9.]+|([^\s]+\.+[a-z]{2,6}))$#si', $email); } if (!is_valid_email($email)) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; exit; } $validationOK=true; if (Trim($name)=="") $validationOK=false; if (Trim($email)=="") $validationOK=false; if (Trim($tel)=="") $validationOK=false; if (Trim($sub)=="") $validationOK=false; if (Trim($message)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; exit; } $EmailFrom = Trim(stripslashes($_POST['email'])); $EmailTo = "info@msukgroup.co"; $Subject2 = Trim(stripslashes($_POST['sub'])); $Name = Trim(stripslashes($_POST['name'])); $Comments = Trim(stripslashes($_POST['message'])); $Subject = "MSUKGroup - Thankyou For Contacting "; // STAFF EMAIL $staffmail = ' <!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" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MSUKGroup</title> <style> p { margin-top:0; margin-bottom:4px; } </style> </head> <body style="color: #666666; font-size:small; font-family:Franklin Gothic Book"> <table style="width: 516px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 516px"> <table style="width: 500px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 500px"> <img src="http://msukgroup.co/img/logos/orange.png" width="323" height="42" /></td> </tr> </table> </td> </tr> </table> <p>Dear ' . $name . ',</p> <p>Thankyou for contacting the MSUKGroup via our online submission form. A relevant representative will be with you within 24 hours to assist you further with your query. </p> <p>Here is what we gathered from your query:</p> <table style="width: 100%" cellspacing="4" cellpadding="0"> <tr> <td style="width: 60px" align="right"><strong> Name:</strong></td> <td> ' . $name . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Email:</strong></td> <td> ' . $email . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Website:</strong></td> <td> ' . $web . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Tel:</strong></td> <td> ' . $tel . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Subject:</strong></td> <td> ' . $sub . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Message:</strong></td> <td> ' . $message . '</td> </tr> </table> <p>In the meantime, if you have any unanswered questions please take a look around our website and you&#39;ll find out more about our group and services.</p> <p><img src="http://msukgroup.co/img/logo3.png" width="129" height="21" /></p> <p>Hosting - Designs - eCommerce - Solutions - Events and more...</p> <p><strong>Web:<br /> </strong><a href="http://www.msukgroup.co"><span style="color:#FF7800">http://www.msukgroup.co</span></a></p> <p><strong>Email:<br /> </strong><a href="http://www.msukgroup.co"><span style="color:#FF7800"> info@msukgroup.co</span></a></p> </body> </html> '; // USER EMAIL $usermail = ' <!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" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>MSUKGroup</title> <style> p { margin-top:0; margin-bottom:4px; } </style> </head> <body style="color: #666666; font-size:small; font-family:Franklin Gothic Book"> <table style="width: 516px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 516px"> <table style="width: 500px; height: 42px;" cellspacing="0" cellpadding="0"> <!-- MSTableType="layout" --> <tr> <td valign="top" style="height: 42px; width: 500px"> <img src="http://msukgroup.co/img/logos/orange.png" width="323" height="42" /></td> </tr> </table> </td> </tr> </table> <p>Hello Admin,</p> <p>' . $name . ' has sent a message using the contact form on the site.<br> <strong>Date Message Sent: ' . $datetime . ' <br> IP Address: ' . $ip . ' </strong><br> </p> <p>Here is what we gathered from their query:</p> <table style="width: 100%" cellspacing="4" cellpadding="0"> <tr> <td style="width: 60px" align="right"><strong> Name:</strong></td> <td> ' . $name . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Email:</strong></td> <td> ' . $email . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Website:</strong></td> <td> ' . $web . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Tel:</strong></td> <td> ' . $tel . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Subject:</strong></td> <td> ' . $sub . '</td> </tr> <tr> <td style="width: 60px" align="right"><strong> Message:</strong></td> <td> ' . $message . '</td> </tr> </table> <p>He has been notified of a 24 hour wait so please respond within this time frame.</p> <p><img src="http://msukgroup.co/img/logo3.png" width="129" height="21" /></p> <p>Hosting - Designs - eCommerce - Solutions - Events and more...</p> <p><strong>Web:<br /> </strong><a title="MSUKGroup" href="http://www.msukgroup.co"><span style="color:#FF7800">http://www.msukgroup.co</span></a></p> <p><strong>Email:<br /> </strong><a href="http://www.msukgroup.co"><span style="color:#FF7800"> info@msukgroup.co</span></a></p> </body> </html> '; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: DO NOT REPLY - MSUKGroup <noreply@msukgroup.co>' . "\r\n"; // Mail it mail($EmailTo, $Subject2, $usermail, $headers); mail($EmailFrom, $Subject2, $staffmail, $headers); // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="INSERT INTO $tbl_name(name, email, web, tel, sub, message, date, ip)VALUES('$name', '$email', '$web', '$tel', '$sub', '$message', '$datetime', '$ip')"; $result=mysql_query($sql); //check if query successful if($result){ print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=successful\">"; } else { print "<meta http-equiv=\"refresh\" content=\"0;URL=../Contact/?sent=error\">"; } mysql_close(); ?>
  16. how do would i create a database where data would be linked together. here is the structure i want, and the idea i just dont know how to impliment it. im good with creating single databases with many fields, but no clue about many databases with relevant fields? okay so, i have a client area, all the clients details are stored in one table. i want then a table that has the clients projects in it, and if i want to add a new project of the clients i can. so here are the fields for the first table i have already setup: `userid` varchar(65) collate latin1_general_ci NOT NULL, `company` varchar(65) collate latin1_general_ci NOT NULL, `firstname` varchar(65) collate latin1_general_ci NOT NULL, `lastname` varchar(65) collate latin1_general_ci NOT NULL, `email` varchar(65) collate latin1_general_ci NOT NULL, `tel` varchar(65) collate latin1_general_ci NOT NULL, `address` text collate latin1_general_ci NOT NULL, `websites` varchar(65) collate latin1_general_ci NOT NULL, `username` varchar(65) collate latin1_general_ci NOT NULL, `password` varchar(65) collate latin1_general_ci NOT NULL, `clientid` int(4) NOT NULL, `userlevel` tinyint(1) NOT NULL, `timestamp` int(11) NOT NULL, `ip` varchar(15) collate latin1_general_ci NOT NUL clientid is what i want to be the clients global identifier maybe even what i have done so far is wrong.. then for the projects table i would like each client to have project name project image [image url that displays on their dashboard] start and expiry date ----------------------- so how can i have this linked to the clients id so that i can display it on a php page relevantly.. [thats the next question] in the php part i was hoping to use a query that returns only the clientid, which it would get from the first table ahh confusing?
  17. We know it may be slower but would like to traffic the requests we get until my new dedi server is up Our site receives 20k hits daily and we recently lost a good server so this is just for this weekend when our hits expect to double as it comes to a close for the reality tv show my sisters on so this is just to traffic the server load On the old server we used cpanel to allow remotesql for the new servers IP
  18. Hm, it's strange because the new server changes my php host variable to matters-sales That domain is on the new server But in the php i use THE ip of the old machine :/ Thata why I'm confused
  19. Mysql I don't even have a folder called mysql It seems to be a problem with server 2 new one as we ran a ssh test on that remote SQL and it worked
  20. linux server running cpanel no file found
  21. okay, so my site is hosted on one server. we are moving the server content onto another server but keeping the database on the old server [to try releive server load of origonal server] OLD Server IP: 174.37.165.192 NEW Server IP: 94.236.52.170 --------------------------- the new server hosts a site already, we are adding this site onto it, however when i try to connect to the old server for the database, here is the error i get: it is putting mattress-sales.co.uk as the server im trying to access however in the code i am using the IP of my old server. so i thought i'd change the host to "efsas" [random lettering] and i get the error "efsas is not a valid host" which is fine! so it means it is checking what i enter in the $host variable.. here is my code: define("DB_SERVER", "174.37.165.192"); define("DB_USER", "db_user"); define("DB_PASS", "pass"); define("DB_NAME", "db_table"); have removed some values for protection.. anyway, if you visit 94.236.52.170 you will see the error.. and if you visit : 174.37.165.192 you will see what it should look like.
  22. i have cpanel so i edited the remotesql and added SERVER2 and in the php script i have this... <?php $host="174.37.172.25"; // Host name $username="db_System"; // Mysql username $password="password"; // Mysql password $db_name="table_StaceyOfficialLoginSystem"; // Database name $tbl_name="guestbook"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect server "); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name ORDER BY id DESC LIMIT 1;"; $result=mysql_query($sql); while($rows=mysql_fetch_array($result)){ ?>
  23. what IP address is that exactly, lets say we have SERVER 1 & SERVER 2 server 1 holds the data server 2 connects to server 1 for the data so whose who in that situation? sorry this part really baffles me, using localhost and keeping it all internal, no problem for me, but its vital that we get an external connection :/ thankyou"
  24. i tried googling but didnt really know how to "google it" as i cant think of a short phrase that best describes it.. but i want to chance the database setting of "localhost" in my php script to another websites database how do i acheive this?
×
×
  • 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.