PHP - Php To Change On Timing..
Hi guys,
I'm trying to create a script which changes on curtain times, heres a example: 3pm - Dance Session 4pm - Indie Session 5pm - RnB Session What i want the desired outcome to be is Display current time with whats playing (say its 3pm) 3pm - Dance Session Then at 4 i want it to remove the 3pm and display the 4pm - Indie Session Is it possible? If so how? Many thanks for you time guys! J Similar Tutorials#1 my function to find out if my store is closed function determineTime() { $hour = date("H"); if (($hour < '09' || $hour >= '21')) { return true; } else { return false; } } #2 my case switch to find out if the "trip" departs in less then <24 hours or <48 hours etc..... $myDiff = dateDiff(date("m/d/Y H:i:s"), "$dep_date 05:00:00"); list($myHour, $myMinute) = split(',', $myDiff); //echo $myHour.'<br/>'; //echo $myMinute; if(!isset($myHour)) $myHour = 0; $nowTime = date("H:i:s"); $futureTime = date("H:i:s", strtotime("$nowTime + 2 hours")); //echo '<h1>*'.$nowTime.'*</h1>'; //echo '<h1>*'.$futureTime.'*</h1>'; //$departures = $db->query("$dep_query $dep_where $dep_order"); // NO TIME RESTRICTIONS switch($myHour){ default: case "": break; case ($myHour <= 24): $_SESSION['addToTotal'] = $passengers*5; if(determineTime()){ //we are closed //if the store is closed and it is TODAY do not allow the users to book a trip before 9am $departures = $db->query("$dep_query $dep_where AND trips.times > '09:00:00' $dep_order"); //run query }else{ //we are open //if open allow the user to book, but only for trips that are for 2 HOURS out and GREATER $departures = $db->query("$dep_query $dep_where AND (trips.times > '$futureTime' OR trips.times > '09:00:00') $dep_order"); //run query } break; case ($myHour > 24 && $myHour < 48): $_SESSION['addToTotal'] = $passengers*5; $departures = $db->query("$dep_query $dep_where $dep_order"); //run query break; } All my times are in H:i:s format. Somewhere for some reason that when we are closed users can still book trips that are for 5am. I'm trying to run 5 php scripts that all run about ~200 MySQL commands each. The basic framwork is: 1.) Fetch a list of names from a table 2.) Names are put in an array, Loop starts 3.) For each name that is retrieved, it is matched with a name on a website (Echo for each name retrieved for logging purposes) 4.) the information retrieved from the website is stored in the table (using UPDATE) 5.) repeated for each name, until the end of the list is reached. And it works, but seldom. When I run these in a web browser, some of the scripts that fetch a larger list of names from the table times out, whereas the shorter lists will succeed in a full update. I've also tried setting these up as a Cron job (I'm using Hosting24 as my host), but the output is no better. The log shows that it runs about 8-9 names before stopping. No error, no nothing. Just end of log. I've tried using set_time_limit(); and have set it to 0 for unlimited, and even tried setting it really high (anywhere between 100 and 900 seconds), but to no avail. Is there anything else I can do? Folks, I am running Linux Commands in PHP. I am looping through the Domain list and using the below line in my Script: exec('cp -r '.$source.' '.$destination); I am using this in a Foreach Statment, so only the last Even in the loop getting executed, because, the loop is running too fast so the Linux command does not even get initiated, only the last even in loop goes through. What i have done is, i have added a line after exec(); sleep(30); This gives enough time for Linux command to get executed, but is it efficient way to handle timing liek this? Do i need to use time_limit() or something like that? Cheers Natasha I have a quick question about a script I wrote that searches all .jpg images in a directory (and it's sub-directories) and makes thumbnails of them. The problem I am having is that I am getting an internal server error after about 15 seconds. I have included my script, the class it requires, and my php.ini file that resides in the root of my site. I have searched for a couple of hours online and haven't been able to come up with an answer as to why I am getting that error. The thumbnail file... Code: [Select] <?php set_time_limit(0); require_once('classes/Create_Thumbnail.php'); $filter = '.jpg'; $directory = 'media'; // Do not include a trailing slash $it = new RecursiveDirectoryIterator("$directory"); foreach(new RecursiveIteratorIterator($it) as $file) { if (!((strpos(strtolower($file), $filter)) === false) || empty($filter)) { $items[] = preg_replace("#\\\#", "/", $file); } } foreach ($items as $item) { $photo = new Create_Thumbnail($item); $photo->createThumbnail(); } ?> The Create_Thumbnail class... Code: [Select] <?php class Create_Thumbnail { private $_photo; private $_photoBasename; private $_photoWidth; private $_photoHeight; private $_photoType; private $_resizedPhoto; private $_thumbFolder; private $_thumbWidth = 125; private $_thumbHeight = 125; private $_thumbSuffix = '_thumb'; private $_thumbnail; /** * Constructor retrieves photo's basename, extension, width, and height. */ public function __construct($photo) { $this->_photo = $photo; $this->_photoBasename = pathinfo($this->_photo, PATHINFO_FILENAME); $this->_extension = pathinfo($this->_photo, PATHINFO_EXTENSION); $this->_thumbFolder = dirname($photo) . '/'; list($this->_photoWidth, $this->_photoHeight, $this->_photoType) = getimagesize($this->_photo); } /** * Method to resize the original image to a size that is much closer to the desired thumbnail size. */ public function resize() { $photoRatio = $this->calculatePhotoRatio(); if ($photoRatio != 1) { $this->_resizedWidth = round($this->_photoWidth * $photoRatio); $this->_resizedHeight = round($this->_photoHeight * $photoRatio); } else { $this->_resizedWidth = $this->_thumbWidth; $this->_resizedHeight = $this->_thumbHeight; } $resource = $this->createResource($this->_photoType, $this->_photo); $resized = imagecreatetruecolor($this->_resizedWidth, $this->_resizedHeight); imagecopyresampled($resized, $resource, 0, 0, 0, 0, $this->_resizedWidth, $this->_resizedHeight, $this->_photoWidth, $this->_photoHeight); $this->_resizedPhoto = $this->_thumbFolder . $this->_photoBasename . '_resized.' . $this->_extension; $this->createNewImage($this->_photoType, $resized, $this->_resizedPhoto); imagedestroy($resource); imagedestroy($resized); return $this->_resizedPhoto; } /** * Method to create the thumbnail. */ public function createThumbnail() { $source = $this->resize(); list($width_original, $height_original, $type) = getimagesize($source); $base_name = pathinfo($source, PATHINFO_FILENAME); $base_name = str_replace('_resized', '', $base_name); $extension = pathinfo($source, PATHINFO_EXTENSION); $source_x = ($width_original / 2) - ($this->_thumbWidth / 2); $source_y = ($height_original / 2) - ($this->_thumbHeight / 2); $resource = $this->createResource($type, $source); $thumb = imagecreatetruecolor($this->_thumbWidth, $this->_thumbHeight); imagecopyresampled($thumb, $resource, 0, 0, $source_x, $source_y, $this->_thumbWidth, $this->_thumbHeight, $this->_thumbWidth, $this->_thumbHeight); $this->_thumbnail = $this->_thumbFolder . $base_name . $this->_thumbSuffix . '.' . $extension; $this->createNewImage($type, $thumb, $this->_thumbnail); unlink($source); return $this->_thumbnail; } /** * Method to create an image resource. */ public function createResource($type, $source) { switch ($type) { case 1: $resource = imagecreatefromgif($source); break; case 2: $resource = imagecreatefromjpeg($source); break; case 3: $resource = imagecreatefrompng($source); break; } return $resource; } /** * Method to calculate the photo ratio. */ public function calculatePhotoRatio() { if ($this->_photoWidth > $this->_photoHeight) { $maximumHeight = $this->_thumbHeight; $photoRatio = $maximumHeight / $this->_photoHeight; } elseif ($this->_photoWidth < $this->_photoHeight) { $maximumWidth = $this->_thumbWidth; $photoRatio = $maximumWidth / $this->_photoWidth; } else { $photoRatio = 1; } return $photoRatio; } /** * Method to create a new image. */ public function createNewImage($type, $source, $destination) { switch ($type) { case 1: if (function_exists('imagegif')) { imagegif($source, $destination); } else { imagejpeg($source, $destination, 50); } break; case 2: imagejpeg($source, $destination, 100); break; case 3: imagepng($source, $destination); break; } } } The php.ini file... Code: [Select] file_uploads on upload_max_filesize = 150M post_max_size = 150M max_input_time = -1 max_execution_time = 0 memory_limit = 150M register_argc_argv = false Can someone propose a solution to resolve the following: I have a PHP script that runs just fine when processing small amounts of data (opening and reading CSV file and performing afew validation checks before saving to db). Issue: when attempting to process a large file, I have found the execution time exceeds the "timeout" value currently set on the server which is 60 seconds. Note: I do not want to increase this time interval as that's a security risk so need to figure out a way to break up the data - being read from the CSV file - into chunks and some way create mini-processes (I guess) to execute chunks of that data at a time until the entire file is read. Any suggestions? For a while now I've been getting intermittent problems with PHP either slowing down or very occasionally timing out for no apparent reason. For the first time it's happened a number of times today and there is an error message in the logs: PHP Fatal error: Maximum execution time of 30 seconds exceeded in functions.php on line 4, referer:search.php The odd thing is that line 4 of functions.php only contains: $sess = session_id(); I've never had a problem with PHP that digging around in this forum hasn't solved but this one has me stumped. Anyone got any ideas? TIA I have a ptc site in php I want that all my ads will refresh at midnight in Pakistani time but server based in USA please let me know how it will happen I have a file name titulos.php and this is code please help me thanks. <tr> <td bgcolor="<?=$highlight?>"> <? require('config.php'); $sqle = "SELECT * FROM tb_ads WHERE user='$last' and ident='$id'"; $resulte = mysql_query($sqle); $myrow = mysql_fetch_array($resulte); mysql_close($con); $time=$myrow['visitime']; $crok1 = date(time()); $crok2 = date($time + (24 * 60 * 60)); if($crok1 >= $crok2) { ?><?=$bold?><a href="view.php?ad=<?=$id?>" target="_blank"><?=$description?></a><?=$boldc?><? } else { ?><del><?=$description?><del><? } ?> </td> <tD bgcolor="<?=$highlight?>"> <?=$members?> </td> <td bgcolor="<?=$highlight?>"> <?=$outside?> </td> <td bgcolor="<?=$highlight?>"> <?=$total?> </td> </tr> This topic has been moved to Linux. http://www.phpfreaks.com/forums/index.php?topic=317079.0 Hi guys , my script works perfectly in Gmail however i now need it to work in Outlook , when the form is submitted i get this error.
2014-10-25 18:49:00 SMTP ERROR: Failed to connect to server: Connection timed out (110) 2014-10-25 18:49:00 SMTP connect() failed. Mailer Error: SMTP connect() failed.
<?php require("../lib/phpmailer/PHPMailerAutoload.php"); if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) { echo "No arguments Provided!"; return false; } $m = new PHPMailer(); $m->IsSMTP(); $m->SMTPAuth = true; $m->SMTPDebug = 2; $m->Host = "smtp.live.com"; $m->Username = "test@outlook.com"; $m->Password = "pass"; $m->SMTPSecure = 'tls'; $m->Port = 465; // ive also tried 587 $m->From = "test@outlook.com"; $m->FromName = "test@outlook.com"; $m->addReplyTo('test@outlook.com ','Reply Address'); $m->addAddress('test@outlook.com', 'Some Guy'); $name = $_POST['name']; $email_address = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; $m->Subject = $subject; $m->Body = "You have received a new message. <br><br>". " Here are the details:<br> Name: $name <br> Phone Number: $phone <br>". "Email: $email_address<br> Message <br> $message"; $m->AltBody = "You have received a new message. <br><br>". " Here are the details:<br> Name: $name <br> Phone Number: $phone <br>". "Email: $email_address<br> Message <br> $message"; if(!$m->Send()) { echo "Mailer Error: " . $m->ErrorInfo; } else { echo "Message sent!"; return true; } ?> Hi all I'm new to PHP so i might ask easy stuff Here is my Scenario I click a button .. this work fine But in the php code that runs after the button is clicked i need to change the Website uri (link) to something like this after button postback index?name=value How am i gonna do this . I tried header function but it did not work well Any suggestion please Sir, i know that we can change the user agent via cURL. i want to know is possible to change ip ? Need to change the value in an XML string tried the following but no luck, any suggestions?
$_xml_string = '<Order> <EmbeddedDoc DocumentName="TestDoc" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> <EmbeddedDoc DocumentName="TestDoc1" DocumentFormat="PDF">jdsahfdhflhfsdlfhdslhsdflsdfhflkdslkfsdhkfhskldhkl</EmbeddedDoc> </Order>'; foreach($_xml_string->Order->EmbeddedDoc as $document) { $document ='##FILE_CONTENT##'; } <?php require_once('config/config.php'); include ("files/viator/api.php"); $page = new PhpCode(); $current_page = $page->curPageURL(); $_SESSION['last_page'] = $current_page ; function seoUrl($string) { //Lower case everything $string = strtolower($string); //Make alphanumeric (removes all other characters) $string = preg_replace("/[^a-z0-9_\s-]/", "", $string); //Clean up multiple dashes or whitespaces $string = preg_replace("/[\s-]+/", " ", $string); //Convert whitespaces and underscore to dash $string = preg_replace("/[\s_]/", "-", $string); return $string; } if(isset($_GET['submit']) && !empty($_GET['submit'])) { $lookupId = $_GET['lookupId']; $dest_code = $_GET['dest_code']; $currency_code = $_GET['currency_code']; $sortOrder = $_GET['sortOrder']; $catId = $_GET['catId']; $subcategoryId = $_GET['subcategoryId']; $country_name = $_GET['country_name']; $state_name = $_GET['state_name']; $country_dest_id= $_GET['country_dest_id']; $check_in = $_GET['check_in']; $check_out = $_GET['check_out']; if($dest_code =='' && $country_dest_id != '') { $dest_code = $country_dest_id; } } else if(isset($_GET['search_submit']) && !empty($_GET['search_submit'])){ $dest_code = $_GET['dest_code']; $currency_code = $_GET['currency_code']; $sortOrder = $_GET['sortOrder']; $catId = $_GET['catId']; $subcategoryId = $_GET['subcategoryId']; $country_name = $_GET['country_name']; $state_name = $_GET['state_name']; $country_dest_id= $_GET['country_dest_id']; $check_in = $_GET['check_in']; $check_out = $_GET['check_out']; $lookupId = $_GET['lookupId']; if($dest_code =='' && $country_dest_id != '') { $dest_code = $country_dest_id; } } else { $lookupId = $_GET['lookupId']; $dest_code = $_GET['dest_code']; $currency_code = $_GET['currency_code']; $sortOrder = $_GET['sortOrder']; $catId = $_GET['catId']; $subcategoryId = $_GET['subcategoryId']; $country_name = $_GET['country_name']; $state_name = $_GET['state_name']; $country_dest_id= $_GET['country_dest_id']; $check_in = $_GET['check_in']; $check_out = $_GET['check_out']; if($dest_code =='' && $country_dest_id != '') { $dest_code = $country_dest_id; } } $getdataarr = getAdventureSearch($dest_code,$currency_code,$sortOrder,$check_in,$check_out); $adventure_data_arr = $getdataarr['data']; $image = '' ; $part = new Body(); $title = "Things to do in "; if($state_name !="") { $title .= $state_name.' ' ;} if ($country_name=="United States of America") { $title .= 'USA ' ; $breadcrumb = 'USA';} elseif ($country_name=="United Arab Emirates") { $title .= 'UAE ' ; $breadcrumb = 'UAE'; } elseif ($country_name!="") { $title .= $country_name; } $title .= " | Compare & Choose"; $meta = '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="' .$state_name. ' Attractions & Things to do in ' .$country_name. '. Find your adventure in ' .$country_name. ' Today." /><link rel="canonical" href="//www.compareandchoose.com.au/adventure_list"/> <!-- MICROFORMATS FOR GPLUS --> <link href="https://plus.google.com/+CompareandchooseAuTravel/posts" rel="publisher" /> <meta itemprop="name" content="' .$title. '"> <meta itemprop="description" content="' .$state_name. ' Attractions & Things to do in ' .$country_name. '. Find your adventure in ' .$country_name. ' Today."> <meta property="og:locale" content="en_US" /> <meta property="og:type" content="website" /> <meta property="og:title" content="' .$title. '" /> <meta property="og:description" content="' .$state_name. ' Attractions & Things to do in ' .$country_name. '. Find your adventure in ' .$country_name. ' Today." /> <meta property="og:url" content="http://www.compareandchoose.com.au/" /> <meta property="og:site_name" content="Compare and Choose" /> <meta property="article:publisher" content="https://www.facebook.com/compareandchoose" /> <meta property="fb:app_id" content="1386609318277530" /> <meta property="og:image" content="http://www.compareandchoose.com.au/images/Compare-and-Choose-logo.png" /> <meta property="og:image:width" content="313" /> <meta property="og:image:height" content="75" />'; $head = $part->getHead($title,$meta); $header = $part->getHeader('Adventure'); $footer = $part->getFooter(); echo $head; echo $header; ?> <script> function sort() { $('.overlay_wrap').fadeIn(); $('.loader_hotel_page').fadeIn(); } </script> <div class="overlay_wrap" style="display: none;"></div> <div class="loader_hotel_page" style="display: none;"><img src="<?php echo SITE_URL; ?>images/search-loader.gif" alt="searching-records"/></div> <!-----Adventure Listing-----> <div class="container"> <div class="listing"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3"> <div class="refine-search travel"> <?php require_once('files/keyword_search.php'); ?> <div class="block"> <div class="block-content"> <div class="block-title">Top Selling Tours & Activities</div> <div class="block-inner"> <div class="top-rated-pic"> <!--<img src="images/small-pic1.png" alt="" />--> </div> <div class="top-topics-sec"> <?php $getcatdataarr = getCategoryDestination($dest_code); $category_arr = $getcatdataarr['data']; $i=1; if($category_arr !="") { foreach ($category_arr as $categoryList) { if($catId == $categoryList['id']) { $image = $categoryList['thumbnailURL']; $groupName = $categoryList['groupName']; ?> <p onclick="sort()"> <strong><?php echo $i;?>.</strong><a href="adventure_list.php?currency_code=<?php echo $currency_code; ?>&dest_code=<?php echo $dest_code;?>&sortOrder=<?php echo $sortOrder;?>&catId=<?php echo $categoryList['id'];?>&country_name=<?php echo $country_name;?>&state_name=<?php echo $state_name;?>&country_dest_id=<?php echo $country_dest_id; ?>&lookupId=<?php echo $lookupId;?>&check_in=<?php echo $check_in;?>&check_out=<?php echo $check_out;?>"><?php echo stripslashes($categoryList['groupName']);?></a> <?php $subcategories_arr = $categoryList['subcategories']; foreach($subcategories_arr as $subcatList) { echo '<br>'; ?> <a href="adventure_list.php?currency_code=<?php echo $currency_code; ?>&dest_code=<?php echo $dest_code;?>&sortOrder=<?php echo $sortOrder;?>&catId=<?php echo $categoryList['id'];?>&subcategoryId=<?php echo $subcatList['subcategoryId'];?>&country_name=<?php echo $country_name;?>&state_name=<?php echo $state_name;?>&country_dest_id=<?php echo $country_dest_id; ?>&lookupId=<?php echo $lookupId;?>&check_in=<?php echo $check_in;?>&check_out=<?php echo $check_out;?>"><?php echo stripslashes($subcatList['subcategoryName']); ?></a> <?php } ?> </p> <?php } else{ ?> <p onclick="sort()"><strong><?php echo $i;?>.</strong><a href="adventure_list.php?currency_code=<?php echo $currency_code; ?>&dest_code=<?php echo $dest_code;?>&sortOrder=<?php echo $sortOrder;?>&catId=<?php echo $categoryList['id'];?>&country_name=<?php echo $country_name;?>&state_name=<?php echo $state_name;?>&country_dest_id=<?php echo $country_dest_id; ?>&lookupId=<?php echo $lookupId;?>&check_in=<?php echo $check_in;?>&check_out=<?php echo $check_out;?>"><?php echo stripslashes($categoryList['groupName']);?></a></p> <?php }$i++;} } ?> </div></div></div></div></div></div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-main"> <div class="row"> <?php if($image !='') { //$image = 'images/travel-pic.png'; ?> <div class="col-xs-12 col-md-4 col-lg-4"> <!--<img src="<?php echo $image;?>" alt="" />--> </div> <?php } ?> <div class="col-xs-12"> <h1>Things to do in <?php echo stripslashes($country_name);?></h1> <?php if($state_name == '') { $search_name = $country_name; } else{ $search_name = $state_name; } ?> <p>Compare and choose things to do in <?php echo stripslashes($search_name);?></p> <a href="#"><?php echo strtoupper(stripslashes($search_name));?> >></a> <?php if($groupName != '') { echo '<p>'.$groupName.'</p>'; } ?> <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="GET"> <div class="filtering"> <select onchange="this.form.submit();" name="sortOrder"> <option value="TOP_SELLERS" <?php if($sortOrder == 'TOP_SELLERS'){echo 'selected';}?>>Most Popular</option> <option value="REVIEW_AVG_RATING_D" <?php if($sortOrder == 'REVIEW_AVG_RATING_D'){echo 'selected';}?>>Top Rated</option> <option value="PRICE_FROM_A" <?php if($sortOrder == 'PRICE_FROM_A'){echo 'selected';}?>>Price(Low - High)</option> <option value="PRICE_FROM_D" <?php if($sortOrder == 'PRICE_FROM_D'){echo 'selected';}?>>Price(High - Low)</option> </select> <input type="hidden" name="currency_code" value="<?php echo $currency_code;?>" id="currency_code"> <input type="hidden" name="lookupId" value="<?php echo $lookupId;?>" id="lookupId"> <input type="hidden" name="dest_code" value="<?php echo $dest_code;?>" id="dest_code"> <input type="hidden" name="catId" value="<?php echo $catId;?>" id="catId"> <input type="hidden" name="subcategoryId" value="<?php echo $subcategoryId;?>" id="subcategoryId"> <input type="hidden" name="country_name" value="<?php echo $country_name; ?>" id="country_name" > <input type="hidden" name="state_name" value="<?php echo $state_name;?>" id="state_name"> <input type="hidden" name="country_dest_id" value="<?php echo $country_dest_id;?>" id="country_dest_id"> </div> </form> </div><div class="c1"></div></div></div> <?php if($adventure_data_arr != ""){ foreach($adventure_data_arr as $adventureList) { $url = seoUrl($adventureList['title']); if($catId == '') { ?> <div class="travel-list-sec"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3 spacal-img"> <?php if($adventureList['specialOfferAvailable'] == 1) {?> <div class="spacal-tag"> <img src="images/specila-tag.png" alt="" /> </div> <?php } ?> <img src="<?php echo $adventureList['thumbnailHiResURL'];?>" alt="" width="166" height="160" /> </div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-det"> <h2 style="text-transform: uppercase; font: 400 15px 'Open Sans', sans-serif; text-decoration: none;"><a style="color: rgb(103, 191, 54);" href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>&lookupId=<?php echo $lookupId;?>&dest_code=<?php echo $dest_code; ?>"><?php echo stripslashes($adventureList['title']);?></a></h2> <p><?php echo stripslashes($adventureList['shortDescription']);?></p> <div class="rating-box"> <div class="ratings"> <?php $rate = $adventureList['rating']; $f= floor($rate); $c = ceil($rate); $cnt = 0; if($rate!="" && $rate!=0) { for($in = 1; $in<=$rate ;$in++) { $cnt++; ?> <img src="images/rating_full.png"> <?php } if($f != $c) { $cnt++; ?> <img src="images/rating_half.png"> <?php } } if($cnt<5) { while($cnt<5) { $cnt++; ?> <img src="images/rating_blank.png"> <?php } } ?> <!--<span class="stars"><?php echo $adventureList['rating']; ?></span>--> </div> <div class="rating-txt"> based on <?php echo $adventureList['reviewCount']; ?> reviews </div> <div class="c1"></div> </div> <div class="price-box"><a href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>&lookupId=<?php echo $lookupId;?>&dest_code=<?php echo $dest_code; ?>"> <span style="float: right; margin-right: 1%; padding: 6px 20px; color: white; background-color: rgb(108, 191, 61); text-align: center; font-size:16px; font-weight:400; ">See Details →</span></a> <span class="new_price">Duration :<?php echo stripslashes($adventureList['duration']);?></span><br /> <span class="new_price">From <?php echo stripslashes($adventureList['currencyCode']);?> <?php echo stripslashes($adventureList['priceFormatted']);?></span> <?php if($adventureList['specialOfferAvailable'] == 1) { ?> <div class="original"> <p>Original Price : <?php echo stripslashes($adventureList['rrpformatted']);?></p> </div> <div class="save-price"> <p>Saving Amount : <?php echo stripslashes($adventureList['savingAmountFormated']);?></p> </div> <?php } ?> </div></div></div><div class="c1"></div></div></div> <?php } else { if($subcategoryId == '') { $catgory_arr = $adventureList['catIds']; if(in_array($catId, $catgory_arr)) { ?> <div class="travel-list-sec"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3"> <img src="<?php echo $adventureList['thumbnailHiResURL'];?>" alt="" width="166" height="160" /> </div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-det"> <h1><a href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>"><?php echo stripslashes($adventureList['title']);?></a></h1> <p><?php echo stripslashes($adventureList['shortDescription']);?></p> <div class="rating-box"> <span class="stars"><?php echo $adventureList['rating']; ?></span> <div class="rating-txt"> based on <?php echo $adventureList['reviewCount']; ?> reviews </div> <div class="c1"></div> </div> <div class="price-box"> <div class="price">Duration :<?php echo stripslashes($adventureList['duration']);?></div> <div class="price">From <?php echo stripslashes($adventureList['currencyCode']);?> <?php echo stripslashes($adventureList['priceFormatted']);?></div> <?php if($adventureList['specialOfferAvailable'] == 1) { ?> <h3>Special Offer </h3> <p>Original Price : <?php echo stripslashes($adventureList['rrpformatted']);?></p> <p>Saving Amount : <?php echo stripslashes($adventureList['savingAmountFormated']);?></p> <?php } ?> </div></div></div><div class="c1"></div></div></div> <?php } } else{ $sub_catgory_arr = $adventureList['subCatIds']; if(in_array($subcategoryId, $sub_catgory_arr)) { ?> <div class="travel-list-sec"> <div class="row"> <div class="col-xs-12 col-md-3 col-lg-3"> <img src="<?php echo $adventureList['thumbnailHiResURL'];?>" alt="" width="166" height="160" /> </div> <div class="col-xs-12 col-md-9 col-lg-9"> <div class="travel-det"> <h1><a href="adventure_details.php?name=<?php echo $url;?>&code=<?php echo $adventureList['code'];?>¤cyCode=<?php echo $adventureList['currencyCode'];?>"><?php echo stripslashes($adventureList['title']);?></a></h1> <p><?php echo stripslashes($adventureList['shortDescription']);?></p> <div class="rating-box"> <span class="stars"><?php echo $adventureList['rating']; ?></span> <div class="rating-txt"> based on <?php echo $adventureList['reviewCount']; ?> reviews </div> <div class="c1"></div> </div> <div class="price-box"> <div class="price">Duration :<?php echo stripslashes($adventureList['duration']);?></div> <div class="price">From <?php echo stripslashes($adventureList['currencyCode']);?> <?php echo stripslashes($adventureList['priceFormatted']);?></div> <?php if($adventureList['specialOfferAvailable'] == 1) { ?> <h3>Special Offer </h3> <p>Original Price : <?php echo stripslashes($adventureList['rrpformatted']);?></p> <p>Saving Amount : <?php echo stripslashes($adventureList['savingAmountFormated']);?></p> <?php } ?> </div></div></div><div class="c1"></div></div></div> <?php } } } } } ?> </div><div class="breadcrumb-new"> <ul> <li><div itemscope itemtype="http://data-vocabulary.org/Breadcrumb"> <a href="<?php echo SITE_URL;?>" itemprop="url"><span itemprop="title">Home</span></a><span>></span> </div></li> <li><strong>Adventures & Activities in <?php echo $state_name. ',' .$country_name; ?></strong></li> </ul> </div><div class="c1"></div></div></div></div> <?php echo $footer ;?> </body> </html>Hi All I am trying to change my website from http to https and I have ran into a problem with one of the scripts producing a none secure http problem Basically when I check this it shows a none secure error ERROR insecure url = http://cache.graphic...m/etcetcetc.jpg which needs to be https://cache.graphi...m/etcetcetc.jpg I thinks it is something to do with the array $adventureList array on line 285(not exactly sure, as I didn't write the code and I am not an expert) So my question is how do I change this to https url please find attached my page code thanks in advance all Alan Hellow every one; i need little help to change code in my script version as i have older version codes and em using new version script so i need to change codes on my version script. iam using latest script which codes are these Quote if ($CURUSER['control_panel'] == 'yes' && $privacylevel == 'strong') print('<td class="f-border comment-details" align="left" width="15%"><center><strong>'.$postername.'</strong><br /><i>'.$title.'</i><br /><img width="80" height="80" src="'.$avatar.'"><br /><br />Uploaded: ---<br />Downloaded: ---<br />Ratio: ---<br /><br /><a href="account-details.php?id='.$row["user"].'"><img src="themes/'.$THEME.'/forums/icon_profile.gif"></a> <a href="mailbox.php?compose&id='.$row["user"].'"><img src="themes/'.$THEME.'/forums/icon_pm.gif" ></a></center></td>'); and Quote else print('<td class="f-border comment-details" align="left" width="15%"><center><strong>'.$postername.'</strong><br /><i>'.$title.'</i><br /><img width="80" height="80" src="'.$avatar.'"><br /><br />Uploaded: '.$useruploaded.'<br />Downloaded: '.$userdownloaded.'<br />Ratio: '.$userratio.'<br /><br /><a href="account-details.php?id='.$row["user"].'"><img src="themes/'.$THEME.'/forums/icon_profile.gif"></a> <a href="mailbox.php?compose&id='.$row["user"].'"><img src="themes/'.$THEME.'/forums/icon_pm.gif" ></a></center></td>'); and i want to change them under Quote if ($row["class"] == 3 || $row["donated"] > 0) { if ($site_config["donatedstar"] || $site_config["vipstar"]) { $star = "<img src=images/star.gif border=0>"; } else { $star = ""; } } if ($privacylevel != "strong" || ($CURUSER["control_panel"] == "yes")) { print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername $star</b><br><i>$title</i></center><br>Uploaded: $useruploaded<br>Downloaded: $userdownloaded<br>Ratio: $userratio<br><br><center><img width=80 height=80 src=$avatar></center><br></td>"); and Quote }else{ print("<tr><td valign=top width=150 align=left class=table_col2><center><b>$postername $star</b><br><i>$title</i></center><br>Uploaded: ---<br>Downloaded: ---<br>Ratio: ---<br><br><center><img width=80 height=80 src=$avatar></center><br></td>"); } and one more thing i have two different images for both classes as in older codes version only one image specify for both class but em using two images for "Donated" = start.gif and for "VIP" = vip.gif so i want both images for both class so pls help me how to do them. Thanks, Regards. Hi all, I am dealing with an html page in which a dynamically created PNG image is shown with: <img src="createchart.php"> The problem arises when users try to download the image since the default name that appears is just "createchart.php". Is there any way to make the browser suggest something like "chart.png"? Than you guys for your help, Mam How would I change the current timezone used within a php script? The method I usually use, date_default_timezone_set() is undefined on my webhost, so I am trying to find another way. Hello PHPFreaks, Im looking to make a script that can find sertend text or numbers in mysql database and can change it. The only problem is that the database also contains same text and numbers that dont need to be changed. So only for example within [39,10] the , has to be changed into a . and only between the [ ] Anyone got script for this or can help me make one cause im new to php. Can someone tell me why this code will not work? It's supposed to update the quantity in a shopping cart by taking the user input and changing the value of the array. I can add items by clicking the 'add to cart' button, but as you know that only works one at a time. Once you make a selection you have the opportunity to go to the cart and modify the quantity by entering in a numeric value; so instead of clicking 10 times you can just type 1, 0 to get to 10. Is there any other info I can provide to convey what I'm trying to do? I'm new to php so I don't know why it's not working, this looks right according to php.net but something is wrong. if(isset($_POST['submit'])) { foreach($_POST['quantity'] as $key => $value) { if($value==0) { unset($_SESSION['cart'][$key]); }else{ $_SESSION['cart']['$key']['quantity']=$value; } } } errors below: Invalid argument supplied for foreach() illegal string offset 'cart' Edited by somerandom, 22 October 2014 - 06:04 PM. I have a website on wordpress, at first it was on a friends server, but he switched it so its on bluehost. The website URL is an IP address with a slash and a name. However, I registered a domain name at godaddy. I was able to change the nameservers so that the URL of the index page of my website was changed to the domain name, however, when I click onto any other page from that page, it goes back to the IP address URL. What can I do? Thanks. |