Jump to content

wright67uk

Members
  • Posts

    454
  • Joined

  • Last visited

Everything posted by wright67uk

  1. Thankyou for the advice. I went with ipage, a 5th of the price, twice the speed and php mail() is working! I'm working on phpmailer to make things even more reliable.
  2. <?php $to = 'website@mysite.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: website@mysite.com' . "\r\n" . 'Reply-To: website@mysite.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> All of my websites contact forms have stopped working, so I decided to use the above file as a test. ...no email is sent. Although godaddy will not admit it there is an issue with my hosting account. Is there a way I can bypass godaddy and use a third part service to send my emails until this server issue has been resolved? Can you recommend any hosting providers that are more reliable?
  3. Godaddy.... where do I start? I have been having call after call from various clients of mine saying their webforms have stopped working. All of the contact forms are using the php mail() function. My server is running php 5.3 (which Godaddy fully support). The helpdesk has been unable to help me at all and in fact the conversation basically said we can migrate your 80 sites and 50 daabases at $99 an item.... $4000 !!! and then everything will work as it should. I've decided to look for another hosting provider. This is a two pronged question - 1) Which hosting providers do you recommend? at the moment i'm using 2gb space and 5gb bandwidth, php and mysql. 2) are there any contact form handlers that I can use for the time being that can handle my clients contact forms until I have got to the bottom of what is going on?
  4. Thankyou. I have added return db, and now im getting Fatal error: Call to undefined method mysqli_stmt::bind() <?php function db_connect() { $config = parse_ini_file('config.ini'); $db = new mysqli($config['host'],$config['username'],$config['password'],$config['dbname']); return $db; } if ( isset($_POST['description']) && isset($_POST['name']) ) { $description = $_POST['description']; $name = $_POST['name']; $sql = "UPDATE shrubs SET description=? WHERE name=? "; $stmt = db_connect()->prepare( $sql ) or die( "could not prepare statement"); $stmt->bind("ss",$description,$name) or die( "could not bind parameters"); if ( $stmt->execute() ) { echo "Description Added Successfully" ; } else { echo "Error in query: " . $stmt->error; } } ?>
  5. It's been a while since I have written any php so please excuse me if this code isn't very well constructed. I get an error- Fatal error: Call to a member function prepare() on a non-object in insert2.php on line 12 <?php function db_connect() { $config = parse_ini_file('config.ini'); $db = new mysqli($config['host'],$config['username'],$config['password'],$config['dbname']); } if ( isset($_POST['description']) && isset($_POST['name']) ) { $description = $_POST['description']; $name = $_POST['name']; $sql = "UPDATE shrubs SET description=? WHERE name=? "; $stmt = db_connect()->prepare( $sql ) or die( "could not prepare statement"); $stmt->bind("ss",$description,$name) or die( "could not bind parameters"); if ( $stmt->execute() ) { echo "Description Added Successfully" ; } else { echo "Error in query: " . $stmt->error; } } ?> Where am I going wrong and how can I rectify this problem?
  6. I am trying to find out how I can eliminate the black flash that I see when viewing blackdogDOTlondon in safari on a Mac. I have tested it in v7.2 and v8. The black flash appears when the .swf file is served, and does not appear when the mp4 is served in Chrome for example. I have gone through similar threads and have seen that adding poster images has solved this issue for some people and hiding the video until it has unloaded working for others. I have tried these steps but still have the same issue. Is there anything else that I could try and what steps should I take to find out what causes this rather off-putting black flash? <script> var isMobile = window.matchMedia("(max-width: 760px)").matches; if (!isMobile) { var myvideo = jQuery('<video id="my_video" controls="controls" autoplay="autoplay" poster="/sites/default/files/landingstill.jpg" />').append('<source src="/sites/default/files/walking.mp4" type="video/mp4">\ <source src="/sites/default/files/walking.mpg" type="video/mpeg">\ <source src="/sites/default/files/walking.ogv" type="video/ogg">\ <source src="/sites/default/files/walking.mov" type="video/mov">\ <source src="/sites/default/files/walking.3gp" type="video/3gpp">\ <source src="/sites/default/files/walking.webm" type="video/webm">\ <object width="100%" height="100%" type="application/x-shockwave-flash" data="/sites/default/files/walking.swf">\ <param name="movie" value="/sites/default/files/walking.swf" />\ <param name="loop" value="false" />\ <param name="width" value="100%" />\ <param name="height" value="100%" />\ <param name="wmode" value="opaque">\ <param name="flashvars" value="autostart=true&controlbar=over&image=/sites/default/files/landingstill.jpg&file=/sites/default/files/walking.mp4" />\ <img src="/sites/default/files/landingstill.jpg" alt="walking" title="Your browser does not support the video tag and flash."/>\ </object>'); jQuery('#videoclip').prepend(myvideo); } else { jQuery('#videoclip').css('background-image','url("/sites/default/files/landingstill.jpg")'); jQuery('#videoclip').css('background-repeat','no-repeat'); jQuery('#videoclip').css('background-attachment','fixed'); jQuery('#videoclip').css('height','492px'); jQuery('#videoclip').css('background-position','center top'); jQuery('#videoclip').css('background-size','760px 400px'); jQuery('#space').slideUp("slow"); jQuery('.navbar').slideDown("slow"); } jQuery(document).ready(function() { document.getElementById('my_video').style.visibility = "visible"; setTimeout(function() { var h = jQuery(window).scrollTop(); resize_home_page_image_divs(); setTimeout(function() { resize_home_page_image_divs()}, 200); if (!isMobile && h > 100) { var h1 = jQuery('#space').height(); var nh = h>h1?h-h1-100:h-50; jQuery('#space').hide(); jQuery('body').scrollTo(nh); jQuery('.navbar').slideDown("slow"); } else { jQuery('#space').delay(4000).slideUp("slow"); jQuery('.navbar').delay(4000).slideDown("slow"); setTimeout(function() { var h = jQuery(window).scrollTop(); jQuery('body').scrollTo(h+5).scrollTo(h); },4500); } },100); jQuery(window).on('beforeunload', function() { jQuery("video").hide(); }); }); </script>
  7. Ok great that would actually make a lot of sense for me to do that. Can you reccommend a good referance for when I come to make some new rules? Eg mod rewrite for beginners.
  8. Ok thankyou, I understand how this works now. Can I change this so that instead of http://www.1pw.co.uk/C_Shrubs I can have http://www.1pw.co.uk/shrubs And instead of http://www.1pw.co.uk/P_AMELANCHIER%20CANADENSIS I can have http://www.1pw.co.uk/amalanchier_canadensis ? Thanks for your help on this :-)
  9. Can I change the file so that I can achieve this?
  10. I'm using an .htaccess file but it has no effect. I'm using godaddy for my hosting. #mod_rewrite #RewriteBase / #Fix Rewrite Options -Multiviews RewriteEngine on RewriteBase / Options +FollowSymLinks RewriteRule ^C_(.*)$ cat.php?type=$1 [L] RewriteRule ^P_(.*)$ product_info.php?name=$1 [L] Im trying to make it so if anyone were for an example to click on a link: 1pw.co.uk/product_info.php?name=namehere it would display in the browser as 1pw.co.uk/P_namehere at the moment everything is as it were before i even added the file. Where am i going wrong?
  11. http://php.net/manual/en/features.remote-files.php
  12. I'm using the below code to display plant names with their accompanying images. The images are hot-linked (with the permission of the owner). The issue is sometimes an image doesn't exist, has been moved or the file name has been changed. When this happens, I want to display an image named sorry_lg.jpg instead. How do I go about doing this? I was thinking about giving the containing div a pre-defined background image, and then covering the background with the hot linked image. But surely there is a cleaner way of doing this? $result = db_query("SELECT * FROM `shrubs` WHERE `type` = '$cat' order by `name` "); if($result === false) { echo "something went wrong with this query"; } else { // Fetch all the rows in an array $rows = array(); while ($row = mysqli_fetch_assoc($result)) { // $rows[] = $row; $name = $row["name"]; $salesprice = $row["salesprice"]; // $image = str_replace(' ', '-', $name); $image = preg_replace('/[\s-]+/', '-', $name); $imagelow = strtolower($image); echo ' <div class="product"> <div style="float:left; width:170px"><img src="http://www.old-hall.com/uploads/images/osb/'.$imagelow.'_lg.jpg" width="150px" height="150px" /></div> <div style="float:right"><div style="margin-left:auto; margin-right:auto"><a href="http://www.1pw.co.uk/product_info.php?name='.$name.'"></div>'.$name.' - £'.$salesprice.'</a></div> </div> '; } }
  13. Below, I have set .navbar to animate after 4 seconds but I have a bit of a problem. I want the navbar to slide down into view. It seems that it's not animating from the top of the page. It 'appears' and then animates on the last few pixels. see: http://black-dog-dev.sites.ac <style type="text/css"> .navbar { display:none; min-height:auto; } video{ width:100%!important; height:auto!important; visibility:hidden; position:fixed; z-index:-20; } #videoclip{ width:100%; position:fixed; z-index:-20; } #space{ width:100%; height:640px; opacity:1.0; filter:alpha(opacity=100); } #opacity{ width:100%; height:450px; color:#fff; opacity:1.0; filter:alpha(opacity=100); } .parallax-main-banner { height:auto; } @media (max-width: 990px){ #opacity{ height:288px; } .parallax-main-banner { min-height: 310px; } video#my_video { width: 130%!important; } } @media (max-width: 760px){ #opacity{ height:168px; } .parallax-main-banner { min-height: 310px; } } </style> <script type='text/javascript'> var resize_home_page_image_divs = function() { jQuery('.field-name-field-landing-page-image img').each( function(i, el) { var el1 = jQuery(el); var h = parseInt(el1.height()*2/3)+'px'; el1.parent().parent().parent().css('height', h).css('overflow','hidden'); } ); } jQuery(document).ready(function(){ jQuery(window).resize( function() { resize_home_page_image_divs(); } ); jQuery(window).scroll( function(ev) { var h = jQuery(window).scrollTop(); var wh = jQuery(window).height(); jQuery('.field-name-field-landing-page-image img').each( function(i, el) { var el1 = jQuery(el); var h1 = parseInt(el1.height()); var off1 = el1.offset(); var mt = 0; if (wh>off1.top-h) { mt = parseInt(h1/3)-parseInt(h1/3*(off1.top-h+h1)/(h1+wh)); } if (off1.top+h1-h<0) { mt = parseInt(h1/3); } mt = -mt; el1.css('margin-top', mt+'px'); } ); } ); jQuery('#space').delay(4000).slideUp("slow"); jQuery('.navbar').delay(4000).slideDown("slow"); setTimeout(function() { jQuery('body').scrollTo(10).scrollTo(0); resize_home_page_image_divs(); },4500); }); </script> can anyone explain where i'm going wrong? I can supply source code, but its a rather big file. Many thanks.
  14. I'm not sure what properties .float-shadow contains, but you could just null the values in a new declaration Eg. /*-------------------[320px]------------------*/ @media only screen and ( max-width: 479px ) { .float-shadow {display:none; } display: none will make it hidden and not affect the flow of the layout.
  15. I'm sure this is a really basic question, but for some reason this form below isn't sending any emails to the address specified in the 'To' field. Is this down to my code? <?php // define variables and set to empty values $name = $email = $gender = $comment = $website = ""; if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = test_input($_POST["name"]); $email = test_input($_POST["email"]); $comment = test_input($_POST["comment"]); } function test_input($data) { $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); return $data; } $to = "myemail@outlook.com"; $subject = "Website Contact Form"; $message = " <html> <head> <title>HTML email</title> </head> <body> <p>This email contains HTML Tags!</p> <table> <th>Name:".$name." </th> </tr> <tr> <td>Email".$email." </td> <td>Comment".$comment." </td> </tr> </table> </body> </html> "; // Always set content-type when sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= 'From: <website@beta.treework.net>' . "\r\n"; mail($to,$subject,$message,$headers); ?>
  16. You could try; Width: 100vw; instead of 100%
  17. I'm trying to get my video to fill the whole of the viewable screen. All I want to be able to see when my site loads is the video and the h1 tag which sits over the bottom of the video - (welcome to website). How can I achieve this please? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style type="text/css"> #logo { position: fixed; top: 10px; left:50px; width:140px; height:50px; background-image: url("paper.gif"); z-index:3; } #opacity { width: 100%; height:460px; color: #fff; opacity: 1.0; filter: alpha(opacity=100); /* For IE8 and earlier */ position: absolute: top:225px; } #content { width: 100%; height:800px; background-color:white; color: #black important!; } .low { border: 0 none; display: inline-block; font-size: 80px; padding: 0 20px; line-height: 100px; margin-bottom: 0; margin-top: 15px; text-transform: uppercase; } h1{font-family: Arial, Helvetica, sans-serif;} #space { width:100%; height:355px; } .red {color:red;} html, body { margin:0; padding:0; } #nav { height:70px; width:100%; display: none; position: fixed; background-color:#fff; z-index: 2; } video { width: 100% !important; height: auto !important; visibility:hidden; } #videoclip { position: fixed; z-index: -1; } </style> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> <script type='text/javascript'>//<![CDATA[ $(window).load(function(){ $(window).bind("scroll", function() { if ($(this).scrollTop() > 50) { $("#nav").fadeIn(); } else { $("#nav").stop().fadeOut(); } }); });//]]> </script> <script type='text/javascript'> jQuery(document).ready(function(){ /* stop the black video loading box */ delayShow(); }); function delayShow() { var secs = 400; setTimeout('jQuery("video").css("visibility","visible");', secs); } </script> </head> <body> <div id="logo"><img src="http://www.blackdog.london/sites/default/files/bdlogo.png" width="100%" height="100%" alt="Home"></a></div> <div id="nav"></div> <div id="videoclip"> <video autoplay loop> <source src="walking.mp4" type="video/mp4"> <source src="walking.ogg" type="video/ogg"> <source src="walking.mov" type="video/mov"> <img src="frame1.png"/> Your browser does not support the video tag. </video> </div> <div id="opacity"> <div id="space"></div> <h1 class="low">welcome to website</h1> </div> <div id="content"><h1 class="low">content <span class="red">here<span></h1></div> </body> </html>
  18. I have a dynamic php page, that provides users with new daily content. How involved is it to offer this is a web based app? (ie. the user would access the page via an icon that they have downloaded from an app store) How involved is it to do and do you know of any tutorials? I have followed the tutorial here; https://developer.chrome.com/apps/first_app but it only works for html pages.
  19. email@gmail.comemail@hotmail.co.ukemail@hotmail.comemail@hotmail.co.ukemail@hotmail.comemail@outlook.comemail@hotmail.co.uk // ....and on and on {"status":"success","tc":"0: ","tb":"0: "} no spaces or characters between email addresses.
  20. Sure, where should I echo $to? If I echo it just before the php closing tag I get; {"status":"success","tc":"0: ","tb":"0: "}1emailaddress@gmail.com PS. thank you for such a quick reply :-)
  21. Hello, I've had someone write me a script that queries a MySQL table and sends the results to each of my members email addresses (I have roughly 200 members). The only thing is that for some reason it doesn't seem to actually send any emails. The coder says it is an issue with my hosting account, can anyone spare a few minutes to tell me if the code makes sense? <?php ini_set('memory_limit', '-1'); //ini_set('meemory_limit', '96M'); //ini_set('post_max_size', '64M'); //ini_set('upload_max_filesize', '64M'); set_time_limit(0); //get tips by id include 'connection.php'; $curentDate = $_POST['date']; if ($mysqli->connect_error) { die('Connect Error: ' . $mysqli->connect_error); } $query = "SELECT placed, win, id, date, horse, course, odds1, odds2, sp, place, time, tip, description, booky, date_added, time_added FROM toptips WHERE userid = 54 AND `date` ='" . $curentDate . "' order by date desc"; $result = $mysqli->query($query); while ($row = $result->fetch_array()) { $title = '(' . date("d/m/y", strtotime($row['date'])) . ") " . $row['time'] . " " . $row['course'] . " - " . $row['horse'] . " " . $row['odds1'] . "/" . $row['odds2'] . $row['sp'] . "-" . $row['place']; $des = $rows['description']; $title = nl2br($title); $des = nl2br($des); $rows[] = '<b>' . $title . '</b><br>' . $des; } $sendmailbody = ''; if (count($rows) > 0) { $sendmailbody = implode('<hr>', $rows); } // get all users from phpbb_user $queryUser = "select username,user_email from phpbb_users where user_email !=''"; $resultUser = $mysqli->query($queryUser); $rowsUser = array(); $toEmail = ''; while ($rowU = $resultUser->fetch_array()) { if (trim($rowU['user_email']) != '') { $rowsUser[] = array('user_email' => $rowU['user_email'], 'name' => $rowU['username']); } } $toEmail .= "test@test.com"; $to = ''; if (count($rowsUser) > 0) { /* config mail */ require '/home/content/w/o/o/###/html/###/mailer/PHPMailerAutoload.php'; //end $tc = 0; $tb = 0; $mtc = ''; $mtb = ''; foreach ($rowsUser as $_user) { $to = $_user['user_email']; if ($to != '' && $sendmailbody != '') { //Create a new PHPMailer instance $mail = new PHPMailer(); $mail->CharSet = "UTF-8"; //Set PHPMailer to use the sendmail transport $mail->isSendmail(); //Set who the message is to be sent from $mail->setFrom('TodaysTips@thenovicetipster.com', 'TodaysTips'); //Set an alternative reply-to address $mail->addReplyTo('TodaysTips@thenovicetipster.com', 'TodaysTips'); //Set who the message is to be sent to $mail->addAddress($to, $_user['name']); $subject = 'Send all tips'; $subject = nl2br($subject); $sendmailbody = nl2br($sendmailbody); //Set the subject line $mail->Subject = $subject; //Read an HTML message body from an external file, convert referenced images to embedded, //convert HTML into a basic plain-text alternative body $mail->msgHTML($sendmailbody); //Replace the plain text body with one created manually $mail->AltBody = 'This is a plain-text message body'; $sendmail = $mail->send(); if ($sendmail) { $mtc .= $to . ','; $tc = $tc + 1; sleep(5); } else { $tb = $tb + 1; $mtb .= $to . ','; } } } echo json_encode(array( 'status' => 'success', 'tc' => $tc . ": " . $mtc, 'tb' => $tb . ": " . $mtb )); } ?> PhpMailerAutoload.php function PHPMailerAutoload($classname) { //Can't use __DIR__ as it's only in PHP 5.3+ $filename = dirname(__FILE__).DIRECTORY_SEPARATOR.'class.'.strtolower($classname).'.php'; if (is_readable($filename)) { require $filename; } } if (version_compare(PHP_VERSION, '5.1.2', '>=')) { //SPL autoloading was introduced in PHP 5.1.2 if (version_compare(PHP_VERSION, '5.3.0', '>=')) { spl_autoload_register('PHPMailerAutoload', true, true); } else { spl_autoload_register('PHPMailerAutoload'); } } else { /** * Fall back to traditional autoload for old PHP versions * @param string $classname The name of the class to load */ function __autoload($classname) { PHPMailerAutoload($classname); } }
  22. I've decided to use blogger as my blog platform, and after following the blogger instructions (adding a couple of CNAMES) my blog now appears at my sub domain IE. blog.mydomain.com I have no folder called 'blog', but here is my question; given these circumstances how can I use .htaccess to get my blog to appear at mydomain.com/blog opposed to blog.mydomain.com ?
  23. How can I echo server name without the tld? I need to do this for multiple domains, all of which end in .co.uk
×
×
  • 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.