PHP - Change Bgcolor On Variable Change.
Similar TutorialsI am trying to allow the user to update a variable he chooses by radio buttons, which they will then input text into a box, and submit, to change some attributes. I really need some help here. It works just fine until I add the second layer of variables on top of it, and I can't find the answer to this question anywhere. <?PHP require('connect.php'); ?> <form action ='' method='post'> <select name="id"> <?php $extract = mysql_query("SELECT * FROM cars"); while($row=mysql_fetch_assoc($extract)){ $id = $row['id']; $make= $row['make']; $model= $row['model']; $year= $row['year']; $color= $row['color']; echo "<option value=$id>$color $year $make $model</option> ";}?> </select> Which attribute would you like to change?<br /> <input type="radio" name="getchanged" value="make"/>Make<br /> <input type="radio" name="getchanged" value="model"/>Model<br /> <input type="radio" name="getchanged" value="year" />Year<br /> <input type="radio" name="getchanged" value="color" />Color<br /><br /> <br /><input type='text' value='' name='tochange'> <input type='submit' value='Change' name='submit'> </form> //This is where I need help... <?PHP if(isset($_POST['submit'])&&($_POST['tochange'])){ mysql_query(" UPDATE cars SET '$_POST[getchanged]'='$_POST[tochange]' where id = '$_POST[id]' ");}?> I am using a htmltable() function in FPDF and while in a MySQL While() loop I need to change the variable name each time it loops through. So basically $html needs to be $html1 on the next loop, $html2 on the next, and so on. Its probably simple, but its late and I'm tired, I can't seem to figure this one out. Here is my unfinished attempt: $htmlnum = 0; $endo = mysql_query("SELECT * FROM endorse WHERE endonum = '$endonum' AND agency = '$agency' ORDER BY ID DESC LIMIT 1"); while($endofetch = mysql_fetch_array($endo)){ $endotype = $endofetch['type']; $htmlnum = $htmlnum++; $p->htmltable($html); } Hi, this is a bit of a PHP and a JQuery question, so I wasn't sure which forum to post it in, but here it is... I need a way to asynchronously change a jQuery variable with PHP when a condition becomes true, without user action. I have the following JQuery: Code: [Select] <script src="http://code.jquery.com/jquery-latest.js"></script> <script> finished = false; $(document).ready(function() { setTimeout("Refresh()", 5000); }); if (!finished) { function Refresh() { location.reload(); }; } </script> Then I have the following PHP code accessing the MySQL database every time the page refreshes... Here's that code: Code: [Select] <? $query = "SELECT * FROM TempAwaitingClients WHERE PSOID = '{$_SESSION['user_id']}'"; $result = mysql_query($query); $rowCounter = mysql_num_rows($result); if ($rowCounter > 0) { while ($row = mysql_fetch_assoc($result)) { // Condition is true, need to stop the page refreshes echo '<iframe id="audiblealert" name="audiblealert" height="0" width="0" src="telephone-ring-4.wav"></iframe>'; echo '<a href="" target="audiblealert">Mute Ringer</a>'; echo 'Phone Number: ' . $row['ClientPhoneNumber'] . '<br /> Purchased Time: ' . $row['ClientPurchasedMinutes'] . ' minutes<br />'; } } else { echo 'No Clients Yet.'; } ?> Anyone have an suggestions or help? EDIT: I forgot to mention, it's the JQuery variable "finished" that I need to set to TRUE I have a method that is returning a funny variable, it should be returning what is below and when I echo the return from inside the method it is right. Code: [Select] Software/Section but when I goto echo the from outside the class I get the following. It adds a back slash Code: [Select] Software//Section this is the method code and it works fine when I echo the returnValue the value is right Code: [Select] // Creates a dymamic case statement for making a the choice // inside and array foreach (scandir($dir) as $folderItem) { if ($folderItem != "." AND $folderItem != "..") { if (is_dir($dir.$folderItem.DIRECTORY_SEPARATOR)) { $folderItem = $folderItem ; // this allows the the dir to be placed if statements below $folderContents = $this->showPage( $dir.$folderItem ,$getPageGlobal , $subdir); $subdir = ""; // this resets so that ithe value does not get added to main links; } else { // put into if into array if($getPageGlobal== $folderItem) { $pageReturn = $dir . $folderItem; } } } } echo $pageReturn.'<br>'; return $pageReturn; This is the way I am echoing the class. This is when it decides to add the back slash Code: [Select] echo $dynamicMenu->getShowPage(); below is the script.i use it for to edit a single .html file. but now i want to edit multiple .html file by this script. so i think i have to change dynimacaly (may be a dropdown form) this line $url = "p".$page.".html"; and this line. can any body help? Code: [Select] <?php function br2nl($str) { return preg_replace('=<br */?>=i', "", $str); } $action=$_POST['action']; $textarea=$_POST['textarea']; if($_GET['p']){ $page=$_GET['p']; } // Assume your text pages are called, p1.db or p2.db, etc. $url = "p".$page.".html"; if (file_exists($url)) { // do nothing } else { $url = "p0.html"; } // where to go back to after the edit ... $return="edit.php?p=$edit"; // Get page $data = implode("", file($url)); if($action=="save"){ $newtext=stripslashes($textarea); $newtext = str_replace("<?", "", $newtext); $newtext = str_replace("?>", "", $newtext); $newtext = nl2br($newtext); //echo "page: $url<br><br>\n"; //echo $newtext; $fh = fopen($url, 'w') or die("can't open file"); fwrite($fh, $newtext); fclose($fh); header ("location:edit.php?p=$page"); } else{ ?> <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>abeer cms</title> <script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script> <script type="text/javascript"> tinyMCE.init({ // General options mode : "textareas", theme : "advanced", plugins : "safari,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,imagemanager,filemanager", // Theme options theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect", theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_statusbar_location : "bottom", theme_advanced_resizing : true, // Example content CSS (should be your site CSS) content_css : "css/example.css", // Drop lists for link/image/media/template dialogs template_external_list_url : "js/template_list.js", external_link_list_url : "js/link_list.js", external_image_list_url : "js/image_list.js", media_external_list_url : "js/media_list.js", // Replace values for the template plugin template_replace_values : { username : "Some User", staffid : "991234" } }); </script> <style> body,html{ margin:0px auto; width:700px; text-align:center; } #content{ margin:0px auto; width:700px; } #middle h1 { color: transparent; font-family:georgia; font-size:12pt; margin:0; color: #dF9100; padding:10px 0px 15px 0px; text-align:left; } </style> </head> <body> <div id='content'> <? $ta=br2nl($data); echo" <a href='$return'><-- Return to Page</a><br /><br /> Make Changes and click \"Save Changes\" at the very bottom ...<br /> <form action='edit.php' method='post'> <input type='hidden' name='action' value='save'> <input type='hidden' name='p' value='$page'> <input type='hidden' name='n' value='$n'> <textarea name='textarea' rows='25' cols='80'>$ta</textarea> <br /> <input type='submit' name='submit' value='Save Changes'> </form> <div id='middle' style='width:680px; text-align:left; padding-left:20px; border:1px solid #ccc;'> </div> </div> </body> </html> "; } ?> Okay, so, I have a script that allows a forum inside of a room in a game. If you want a forum, you mark Yes from a dropdown menu inside the editing portion of the room. It will then save that room's title into a field called `board` in the database. However, when you mark No from the dropdown, it still leaves it in there. I don't want this. I want it to change to NULL. How do I go about doing this? Here's my current coding: if (!islevel($p,$co)) newlevel($p,$co); setlevel($p,$co,"title",filter(stripslashes($title))); setlevel($p,$co,"board",filter(stripslashes($title))); } Explanations: setlevel just connects to the database and inserts these values. $title is obviously the title of the room $co = coordinates for the room Here is the editing page, where the dropdown menu is: <table width=100% style=text-align:center><tr> <td>BOARD:<br /> <select name=b> <option value=0>No</option> <option value=1 <? if ($b == 1) echo "selected" ?>>Yes</option></select><br />Was <?=$b?> </tr></table> Hello I want to be able to change the class depending on if a variable is 1 or 0. <html> <p class="note-general"> This is the general </p> <p class="note-warning"> And this is the warning </p> </html> I want the variable $adult (that can be 1 or 0) to set if the class should be a note-general or note-warning. Thank you for support This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=350095.0 I am echoing a variable that is an array. I want to change the first part of the variable but don't know how to manipulte names inside the ['brackets'] Code: [Select] echo $row['v1_name']);?> lets say I have a value called $var = v1. How do I substitute that like this: Code: [Select] echo $row[$var.'_name']);?> I know the above doesnt work, but thats what i want it to do :-) Hi, I have looked everywhere for a way to do this and would be grateful for a pointer in the right direction. I want to change the background color of the div with the id of "loggedin", depending on the status. The status currently echos text depending on the value. Code: [Select] <div class="grid_12" id="loggedin"> <div> <ul id="loggedin"> <li><?php global $current_user; get_currentuserinfo(); echo 'Status : ' . $current_user->status . "\n";?></li> <li> <?php if ($current_user->status=="RED") echo "Red info"; ?> <?php if ($current_user->status=="GREEN") echo "Green info"; ?> <?php if ($current_user->status=="BLUE") echo "Blue info"; ?> <?php if ($current_user->status=="YELLOW") echo "Yellow info"; ?> </li> </div> </div> Thanks This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=342929.0 <?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 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##'; } 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 I recently put together a form for a client - I am not a programmer (designer) but it worked really until we tried to put the name of a city. It wouldn't take abbreviations that the post office uses
I need to do one of two things - allow it to take abbreviations or take off the requirement that the field has to be filled out.
HELP
Here is the code.
<li class='field_block' id='field_3_div'><div class='col_label'> i have a basic html form with a drop down selection box with 2 options ('old' and 'new'). when you click one it swaps them round to you can click the other because it is an onchange event. <form action="<?php $_SERVER['self']; ?>" method="get"> <select name="Time" onchange="this.form.submit();"> <option value="New">New</option> <option value="Old">Old</option> </select></form> Hi,
I'm having the following problem. I want to change the row color depending on the value of a record.
i made three different td class in the style.
Then i check the value of the record "TOEGEZEGD" and connect this to $NewClass,
The i try to change the color of the background.
$NewClass takes the value i want (check by display echo $NewClass)
But the background of the row doesn't change, i tried different methodes:
<td class = "$NewClass">'.$row['TOEGEZEGD'].'</td> <td class = \"$New$Class\">'.$row['VORM'].'</td> <td><DIV CLASS="$NewClass">'.$row['PAKKET'].'</DIV></td> But non of them work please help, it's driving my crazy <?php // checking for started session function is_session_started() { if ( php_sapi_name() !== 'cli' ) { if ( version_compare(phpversion(), '5.4.0', '>=') ) { return session_status() === PHP_SESSION_ACTIVE ? TRUE : FALSE; } else { return session_id() === '' ? FALSE : TRUE; } } return FALSE; } if ( is_session_started() === FALSE ) session_start(); if(isset($_SESSION ['ingelogd']) AND $_SESSION['ingelogd'] == 1) {} else { header("location:index.php"); exit; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>**********</title> <meta name="" content=""> </head> <body> <style> textarea, input, button, a, td, span{ font-family: "Trebuchet MS", Helvetica, sans-serif; } td{ color: blue; width: 100px; background-color: #ceffce; height: 50px; text-align: center; } td.JA{ color: red; width: 100px; background-color: #00ee00; height: 50px; text-align: left; } .JA{ color: red; width: 100px; background-color: #00ee00; height: 50px; text-align: left; } td.NEE{ color: green; width: 100px; background-color: #ff0000; height: 50px; text-align: left; } td.MISSCHIEN{ color: orange; width: 100px; background-color: #f07700; height: 50px; text-align: left; } td.op{ color: black; width: 450px; background-color: #ceDDce!important; height: 50px; text-align: left; } th{ color: black; width: 40px; background-color: #cecece; height: 50px; text-align: center; } th.op{ color: black; width: 450px; background-color: #cecece; height: 50px; text-align: center; } .a{ height: 25%; cursor: pointer; } button{ width: 100%; height: 100%; margin: -5 auto -5 auto; } textarea { height: 100%; width: 100%; } .verwijder{ width: 10px; height: auto; background-color: #ffa8a8; } .space{ width: 20px; height: auto; } .invoegen{ background-color: #6dbbdc; width: 1434px; padding: 5px; margin: 5px; } .content{ background-color: #FFDD67; width: 1500px; ; padding: 0 5 0 5; margin: 0 5 0 5; } .content table{ margin-bottom: 100px; } span{ text-decoration: underline; } select{ height: 90%; } </style> <div class="content"> <?php mysql_connect("localhost", "************", "*********") or die(mysql_error()); mysql_select_db("*********"); $sql = "SELECT ID, NAAM, CONTACT, TOEGEZEGD, bestuur1, bestuur2, bestuur3, bestuur4, bestuur5, VORM, PAKKET, KANGEFACTUREERD, GEFACTUREERD, AANTAL, POST, OPMERKING FROM `sponsoren` ORDER BY $field $sort"; $result = mysql_query($sql) or die(mysql_error()); echo'<table>'; while($row = mysql_fetch_array($result)) { $BESTUUR1 = $row['bestuur1']; $BESTUUR2 = $row['bestuur2']; $BESTUUR3 = $row['bestuur3']; $BESTUUR4 = $row['bestuur4']; $BESTUUR5 = $row['bestuur5']; if ($row['TOEGEZEGD'] == 'ja') { $NewClass = "JA" ; } elseif ($row['TOEGEZEGD'] == 'nee') { $NewClass = "NEE"; } elseif ($row['TOEGEZEGD'] == 'misschien') { $NewClass = "MISSCHIEN"; } echo $NewClass; echo'<tr> <td><a href="full_table_row_results.php?ID='.$row['ID'].'">'.$row['ID'].'</a></td> <td>'.$row['NAAM'].'</td> <td>'.$row['CONTACT'].'</td> <td >'; if($BESTUUR1 == 1){ echo "<div class='item'><label>Kk</label></div>"; }; if($BESTUUR2 == 1){ echo "<div class='item'><label>Rutger</label></div>"; }; if($BESTUUR3 == 1){ echo "<div class='item'><label>Toby</label></div>"; }; if($BESTUUR4 == 1){ echo "<div class='item'><label>Meijke</label></div>"; }; if($BESTUUR5 == 1){ echo "<div class='item'><label>Boele</label></div>"; }"</td>"; echo'<td class = "$NewClass">'.$row['TOEGEZEGD'].'</td> <td class = \"$New$Class\">'.$row['VORM'].'</td> <td><DIV CLASS="$NewClass">'.$row['PAKKET'].'</DIV></td> <td>'.$row['KANGEFACTUREERD'].'</td> <td>'.$row['GEFACTUREERD'].'</td> <td>'.$row['AANTAL'].'</td> <td>'.$row['POST'].'</td> <td class = "op">'.$row['OPMERKING'].'</td>'; echo'</tr>'; } echo'</table>'; ?> </div> </body> </html> 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 |