PHP - Moved: Modification Of Slider Hyperlink
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=327718.0 Similar TutorialsThis topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=355561.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=332575.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=347224.0 This code works when theres no predefined value however I'm trying to modify it in case there IS a value from the DB which is from the " . $row2['content'] . " data. Code: [Select] echo "<select name=" . $row2['ID'] . " id=" . $row2['ID'] . " class=dropdown biofield title=" . $row2['fullName'] . " >"; echo "<option value= >None</option>"; if ($styleID == 1 || $styleID == 2 || $styleID == 6) { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID = 3 ORDER BY characters.characterName"; } else { $charactersQuery = " SELECT characters.ID, characters.characterName FROM characters WHERE characters.styleID IN (1,2,6) ORDER BY characters.characterName"; } $charactersResult = mysqli_query ( $dbc, $charactersQuery ); // Run The Query while ( $row3 = mysqli_fetch_array ($charactersResult, MYSQLI_ASSOC)) { echo "<option value=" . $row3['ID'] . ">" . $row3['characterName'] . "</option>\r"; } echo "</select>"; I normally use something like this but with the other code not sure how to modify it to work the same way. Code: [Select] while ( $champion_row = mysqli_fetch_array ( $charactersResult, MYSQL_ASSOC ) ) { print "<option value=\"".$champion_row['ID']."\" "; if($champion_row['ID'] == $row['champID']) { print " SELECTED"; } print ">".$champion_row['characterName']."</option>\r"; } Thank you for writing this script. It has been most helpful in doing a search for a website I manage. Everything is working fine but I would like some help in modifying the "$results[] = " line. For instance, I would like to show or hide the address of a business if a data value is set to 1 if set to 0 then hide. Same for the business web address. if ( $row_memberrs['WebAddress'] != NULL ) { echo <a href=\"{$row['WebAddress']}\" target=_blank>Visit our website</a>; } I am a newbie to php and would appreciate any help you can give me. Here is a link to the search page http://www.wildwoodba.org/searchsite.php If it is not too much trouble I would like to hide the check boxes and make it search the body, title or disc for the words entered. Thank you for your help. I am currently trying to build a contact form for a website. I have been given a script to use that was used on another site but it has an iff statement in it to change the strEmail according to the location and requirement. My first real attempt to mess with MySql. Keep getting a syntax error and I am quite confused. Error: Code: [Select] Parse error: syntax error, unexpected '}' in /home/a8152576/public_html/MemberSystem/install1.php on line 68 Here is my php code: Code: [Select] <!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>Untitled Document</title> </head> <body> <form id="form1" name="form1" method="post" action=""> <h2><center>Fill in the following info properly to install required databases.</center></h2> <p> <label>Host: <input type="text" name="host" id="host" /> </label> </p> <p> <label>Database User: <input type="text" name="dbUser" id="dbUser" /> </label> </p> <p> <label>Database Password: <input type="text" name="dbPass" id="dbPass" /> </label> </p> <p> <label>Desired Admin Username: <input type="text" name="adminName" id="adminName" /> </label> </p> <p> <label>Desired Admin Password: <input type="text" name="adminPass" id="adminPass" /> </label> </p> <p> <label>Email: <input type="text" name="adminEmail" id="adminEmail" /> </label> </p> <p> <input type="submit" name="submitBtn" id="submitBtn" value="Submit" /> </p> </form> <?php if(isset($_POST['submit'])){ $hostName = $_POST['host']; $dbUserName = $_POST['dbUser']; $dbPassword = $_POST['dbPass']; $adminUserName = $_POST['adminName']; $adminPassword = $_POST['adminPass']; $email = $_POST['adminEmail']; $sqlLink = mysql_connect('$hostName','$dbUserName','$dbPassword'); if(!$sqlLink){ die('Could not connect: ' .mysql_error()); mysql_close(); } else { $queryCreate = 'CREATE DATABASE member_db'; echo 'Connected successfully!'; if(mysql_query($queryCreate,$link)){ echo 'Created database!'; mysql_select_db('member_db'); $createAdminTable = "CREATE TABLE " .$adminUserName. " (`secLvl` tinyint(1) default NOT NULL,`rank` tinyint(2) default NOT NULL,`username` varChar(32) NOT NULL UNIQUE,`password` varChar(32) NOT NULL,`email` varChar(32) NOT NULL UNIQUE"; $insertAdminInfoQuery = "UPDATE " .$adminUserName. " SET `secLvl` = '5', `rank` = '10', `username` = '$adminUserName', `password` = '$adminPassword', `email` = '$email' WHERE '$adminUserName' LIMIT 1"; mysql_query($createAdminTable) or die("ERROR: " .mysql_error()); mysql_query($insertAdminInfoQuery) or die("ERROR: " .mysql_error()) } else { echo 'Error: '.mysql_error(); } } } ?> </body> </html> You can even see the error on this web page directly: http://www.ptcptc.info/MemberSystem/install1.php Thanks, Brandon I am trying to get this script to display the date like Dec 17, 2010 and have the search function work too. If I try to change the date the search malfunctions and if I take the date function away the date is 2010 12 17 I thought we had this nailed down the other day but in my excitement I neglected to test the city search. Here is the script. <?php $find = trim($_GET['find']); $field = $_GET['field']; if($find && $field) { // we have search form submitted // check for values to prevent sql injection $valid_fields = array("venue_state", "venue_city", "start_date"); if(!in_array($field, $valid_fields)) die("Error: Invalid field!"); //connect mysql_connect("localhost", "arts_cshow", "TrPh123Yuo") or die(mysql_error()); mysql_select_db("arts_shows") or die(mysql_error()); echo "<h2>Search Results for $find in $field</h2>\n"; $find = addslashes($find); $result = mysql_query("SELECT * FROM craft_shows WHERE $field LIKE '%$find%'"); if(mysql_num_rows($result) == 0) { echo "<p>0 matches found.</p>"; } else { echo "<table><tr><td class=\"shows\">"; $sql = "SELECT *, DATE_FORMAT(`start_date`, '%b %e, %Y') AS s_date FROM craft_shows"; $result = mysql_query($sql); while($row = mysql_fetch_array($result)) { echo "<a href='/show_submits/show_detail.php?id={$row['id']}'>Details</a>\n"; echo $row['venue_state'] . " {$row['s_date']} {$row['show_name']} {$row['venue_city']}<br>\n"; } echo "</td></tr></table>\n"; } } ?> thanks Hi all. I have the following function which auto-generates a form based on a database table. What I want to do is "cancel" the function if the table doesn't exist. The function as is... function build_form($table_name){ $sql="SELECT * FROM $table_name"; $result=mysql_query($sql); $num=mysql_num_rows($result); $i=0; echo "<form method=\"post\" action=\"/php/process_data.php\">"; echo "<input type=\"hidden\" name=\"selected_table\" value=\"" . $table_name . "\"/>"; echo "<table>"; echo "<tr><td colspan=\"2\" style=\"font:1em arial;font-weight:bold;text-align:center;\">Input Form: " . $table_name ."</td></tr>"; $field_names=array(); while ($i < mysql_num_fields($result)){ $fields=mysql_fetch_field($result,$i); echo "<tr><td>" . $fields->name . "</td><td><input type=\"text\" size=\"30\" name=\"" . $fields->name . "\" /></td></tr>"; $i++; }; echo "<tr><td colspan=\"2\" style=\"text-align:center;\"><input type=\"submit\" value=\"Submit Data\" style=\"width:75%\" /></td></tr>"; echo "</table>"; echo "</form>"; }; Would something like this work? (note lines 3-5) function build_form($table_name){ $sql="SELECT * FROM $table_name"; if(!$sql){ return; }; $result=mysql_query($sql); $num=mysql_num_rows($result); $i=0; echo "<form method=\"post\" action=\"/php/process_data.php\">"; echo "<input type=\"hidden\" name=\"selected_table\" value=\"" . $table_name . "\"/>"; echo "<table>"; echo "<tr><td colspan=\"2\" style=\"font:1em arial;font-weight:bold;text-align:center;\">Input Form: " . $table_name ."</td></tr>"; $field_names=array(); while ($i < mysql_num_fields($result)){ $fields=mysql_fetch_field($result,$i); echo "<tr><td>" . $fields->name . "</td><td><input type=\"text\" size=\"30\" name=\"" . $fields->name . "\" /></td></tr>"; $i++; }; echo "<tr><td colspan=\"2\" style=\"text-align:center;\"><input type=\"submit\" value=\"Submit Data\" style=\"width:75%\" /></td></tr>"; echo "</table>"; echo "</form>"; }; I have a table in my database which stores lot of file names & file path. iam currently listing the files on the basis of its uploaded date (stored in databse) but I want to list it on the basis of its file modification time. How i can do it ?? my current sql statement is Code: [Select] $sql = mysql_query("SELECT * FROM `files` WHERE `cid` = '$types' ORDER BY `uploaded` DESC LIMIT $start,$limit"); anyone can help me ?? Hi,
I have the following code which gives a fading out effect when clicking on links. I need to be able to disable it for anchor links so it is disabled when using # as the link.
Any ideas ?
/* * Function to animate leaving a page */ $.fn.leavePage = function() { this.click(function(event){ // Don't go to the next page yet. event.preventDefault(); linkLocation = this.href; // Fade out this page first. $('body').fadeOut(400, function(){ // Then go to the next page. window.location = linkLocation; }); }); };Thanks, Scott. Hello Coder Guys, I need a small help from you. I want to list all files & directories based on last file modification time of server. I want to list new files as first & old files as last. Consider "files" as the directory name which contains all files & directories. Please make the php code to display all files & directories from "files" directory based on last file modification time of server. Thanks IN Advance ! Hello Freaks! I am having problem with following code: <?php simplexml_load_string ('?xml version="1.0" encoding="utf-8"?>'); php?> This code is giving me following error Parse error: syntax error, unexpected '<' in public_html/wp-content/plugins/pluginnamehere/whatever.php on line 665 I know there is only a minor bracket problem that causing me this error. I would be helpful to you if you can modify it for me Thanks I bought a slider script and need to merge it in the website. What is the best to put the script in the header or in the footer? And where i have to put it on wich line? I tried a lot and i have almost no more hair left on my head! One time i managed to get the images below header but not in a slider, it added the images below each other. It's not loading jquery or something else i don't know... this is the slider script: <?php echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR...1-strict.dtd\"> <html xmlns=\"http://www.w3.org/1999/xhtml\"> <head> <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" /> <title>JQuery-Image-Slider</title> <link href=\"css/default.css\" rel=\"stylesheet\" type=\"text/css\" /> <script src=\"js/jquery.js\" type=\"text/javascript\"></script> <script src=\"js/yslider.js\" type=\"text/javascript\"></script> <script src=\"js/init.js\" type=\"text/javascript\"></script> </head> <body> <div id=\"content\"> <div class=\"slider\"> <div class=\"sliderContent\"> <div class=\"item\"> <img src=\"img/img1.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img2.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img3.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img4.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img5.jpg\" alt=\"\" /> </div> <div class=\"item\"> <img src=\"img/img6.jpg\" alt=\"\" /> </div> </div> </div> </div> </body> </html> "; ?> The header and footer script are atached Attached Files footer.php 3.26KB 0 downloads header.php 16.48KB 0 downloads I have an image slider i am trying to edit. Currently i can only make it display only 1 continuios line of images that disapears. What i am trying to get, is an overflow feature that allows the images to start a new line instead of only one line. here is the code. PHP Code: (function($) { $.fn.loopedCarousel = function(options) { var defaults = { container: '.container', slides: '.slides', pagination: '.pagination', autoStart: 0, // Set to positive number for auto interval and interval time slidespeed: 300, // Speed of slide animation fadespeed: 300, // Speed of fade animation items: 6, // Items show padding: 26, // Padding between items showPagination: false, // Shows pagination links vertical: false }; this.each(function() { var obj = $(this); var o = $.extend(defaults, options); var i = o.items; var m = 0; var t = 1; var s = $(o.slides,obj).children().size(); var w = $(o.slides,obj).children().outerWidth()+o.padding; var h = $(o.slides,obj).children().outerHeight()+o.padding; var c = Math.ceil($(o.slides,obj).children().size()/i); var pd = o.padding/2; var p = 0; var u = false; var n = 0; var pt = 0; var os = i*c-s; var params = {}; if (o.vertical===true) { w = h; } if(o.showPagination){ var buttons = s/i; $(obj).append('<ul class="pagination">'); $(o.slides,obj).children().each(function(){ if (n<buttons) { $(o.pagination,obj).append('<li><a rel="'+(n+1)+'" href="#" >'+(n+1)+'</a></li>'); n = n+1; } else { n = 0; return false; } $(o.pagination+' li a:eq(0)',obj).parent().addClass('active'); }); } if (o.vertical===true) { $(o.container,obj).css({height:(w*i)}); $(o.slides,obj).css({height:(s*w)}); } else { $(o.container,obj).css({width:(w*i)}); $(o.slides,obj).css({width:(s*w)}); } $(o.slides,obj).children().each(function(){ if (o.vertical===true) { $(this).css({position:'absolute',top:p+pd,display:'block'}); } else { $(this).css({position:'absolute',left:p+pd,display:'block'}); } p=p+w; }); $(o.slides,obj).children().each(function(){ pt = pt+1; if (pt<i+1) { params[o.vertical ? 'top' : 'left'] = (-w*pt)+pd-(w*os); $(o.slides,obj).children(':eq('+(s-pt)+')').css(params); } if (pt===i+2) { pt = 0; return false; } }); $('.next',obj).click(function(){ if(u===false) { animate('next',true); if(o.autoStart){clearInterval(sliderIntervalID);} } return false; }); $('.previous',obj).click(function(){ if(u===false) { animate('prev',true); if(o.autoStart){clearInterval(sliderIntervalID);} } return false; }); $(o.pagination+' li a',obj).click(function(){ if ($(this).parent().hasClass('active')) {return false;} else { t = $(this).attr('rel'); $(o.pagination+' li a',obj).parent().siblings().removeClass('active'); $(this).parent().addClass('active'); animate('fade',t); if(o.autoStart){clearInterval(sliderIntervalID);} } return false; }); if (o.autoStart) { sliderIntervalID = setInterval(function(){ if(u===false) {animate('next',true);} }, o.autoStart); } function current(t) { if(t===c+1){t=1;} if(t===0){t=c;} $(o.pagination+' li a',obj).parent().siblings().removeClass('active'); $(o.pagination+' li a[rel="' + (t) + '"]',obj).parent().addClass('active'); } function animate(dir,clicked){ u = true; switch(dir){ case 'next': t = t+1; m = (-(t*w-w)*i); current(t); params[o.vertical ? 'top' : 'left'] = m; $(o.slides,obj).animate(params, o.slidespeed,function(){ if (t===c+1) { t = 1; params[o.vertical ? 'top' : 'left'] = 0; $(o.slides,obj).css(params,function(){ $(o.slides,obj).animate(params); }); $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = (w*pt)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); params[o.vertical ? 'top' : 'left'] = -(w*(pt+os+1)-pd); $(o.slides,obj).children(':eq('+(s-(pt+1))+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===c) { $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = w*(s+pt+os)+pd; $(o.slides,obj).children(':eq('+(pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===2) { $(o.slides,obj).children().each(function(){ pt = pt+1; if (pt<i+1) { params[o.vertical ? 'top' : 'left'] = ((w*s)+pd)-(w*pt); $(o.slides,obj).children(':eq('+(s-pt)+')').css(params); } else { pt = 0; return false; } }); } u = false; }); break; case 'prev': t = t-1; m = (-(t*w-w)*i); current(t); params[o.vertical ? 'top' : 'left'] = m; $(o.slides,obj).animate(params, o.slidespeed,function(){ if (t===0) { t = c; params[o.vertical ? 'top' : 'left'] = -w*(s-i)-(w*os); $(o.slides,obj).css(params); $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = w*(s+pt+os)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); params[o.vertical ? 'top' : 'left'] = (s*w)+pd-(pt*w)-w; $(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===2) { $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = (w*pt)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if (t===1) { $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = -(w*pt)-w+pd-(w*os); $(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } u = false; }); break; case 'fade': t = [t]*1; m = (-(t*w-w)*i); current(t); $(o.slides,obj).children().fadeOut(o.fadespeed, function(){ params[o.vertical ? 'top' : 'left'] = m; $(o.slides,obj).css(params); $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = (pt*w)+pd; $(o.slides,obj).children(':eq('+pt+')').css(params); params[o.vertical ? 'top' : 'left'] = w*(s-pt)-w+pd; $(o.slides,obj).children(':eq('+((s-1)-pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); if(t===c){ $(o.slides,obj).children().each(function(){ if (pt<i) { params[o.vertical ? 'top' : 'left'] = w*(s+pt+os)+pd; $(o.slides,obj).children(':eq('+(pt)+')').css(params); } else { pt = 0; return false; } pt = pt+1; }); } if(t===1){ $(o.slides,obj).children().each(function(){ pt = pt+1; if (pt<i+1) { params[o.vertical ? 'top' : 'left'] = -(w*pt)+pd-(w*os); $(o.slides,obj).children(':eq('+(s-pt)+')').css(params); } else { pt = 0; return false; } }); } $(o.slides,obj).children().fadeIn(o.fadespeed); u = false; }); break; default: break; } } }); }; })(jQuery); CSS Code: <div class="tabs-wrap"> <h2 class="extra-title">Products</h2> <!-- tabs begin --> <ul class="tabs"> <li><a href="#tab1">Panels</a></li> <li><a href="#tab2">Keypads</a></li> <li><a href="#tab3">Devices</a></li> <li><a href="#tab3">Manuals</a></li> </ul> </div> <div class="tab_container"> <div id="tab1" class="tab_content"> <div class="loopedCarousel"> <div class="container"> <div class="slides"> <!-- slide 1 --> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Power Series</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Alexor</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>9047</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>New Panel</strong> Spring 2011 </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Power Series</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Alexor</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>9047</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>New Panel</strong> Spring 2011 </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Power Series</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>Alexor</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>9047</strong> Now Available </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> <div> <dl> <dt><a href="#"><img src="images/thumb2.jpg" alt="" /></a></dt> <dd> <strong>New Panel</strong> Spring 2011 </dd> <dd class="last"> <a href="#"><img src="images/info-icon.gif" alt="" /></a>Details </dd> </dl> </div> </div> </div> </div> </div> <div id="tab2" class="tab_content"> <div class="loopedCarousel"> <div class="container"> <div class="slides"> </div> </div> </div> </div> </div> let me know if you need any further information. thank you! Hi, A page that loads a Slider on my Word Press Page loads the slider to OFF. I want It to load to ON as default Its in a php file that resides in a Plugin inside a Shortcodes directory Ive tried to change it but it seems to do nothing when i reload the page. I even deleted the file with the code in and it didnt effect the page at all? Any help would be very mutch appriciated.
if($enableGoogle == 'yes'){ Hey guys Just a quick question: How to embed hyperlink into a database cell? Basically I echo out a table on the user interface of my site and there's an URL in one of the cells I want the user to access it by clicking on it, without copying and pasting the URL into the URL bar of the browser I tried updating the cell in phpmyadmin using <a href = http://www.example.com>http://www.example.com</a> but didn't work out, the resulting cell only had the text format Any help would be appreciated Thanks. Hi all, I have a problem I am not sure how to sort, hopefully someone here can help. I have a sliding login panel on a website that I am making. Its quite discreet. I have a stripped down version here that you can see: http://mgdesign.hostultra.com/login_test/login_test.php On the page I am making, users with a log in enter their details and will be taken to the restricted page. I would like this sliding panel to be on every page when the user is not logged in. Once they log in from the sliding panel they can still surf around all the main site pages. When they log out the session dies and it reverts to the home page. However, when they are logged in I would like the sliding login panel to disappear from the top of each page. Is there any way I can do this simply? Any help or advice would be greatly appreciated. Im turning a static slider revolution in a dynamic. Images are uploading and fetching perfect from Mysql DB but the texts (top-text) is showing only in the first slide. The rest is empty. Here is the Code
Any help would be great.
UPLOAD.php
<?php // Include the database configuration file include 'database/dbConfig.php'; $statusMsg = ''; // File upload path $targetDir = "uploads/"; $fileName = basename($_FILES["file"]["name"]); $top_text = filter_input(INPUT_POST, 'top_text'); $targetFilePath = $targetDir . $fileName; $fileType = pathinfo($targetFilePath,PATHINFO_EXTENSION); if(isset($_POST["submit"]) && !empty($_FILES["file"]["name"])){ // Allow certain file formats $allowTypes = array('jpg','png','jpeg','gif','pdf'); if(in_array($fileType, $allowTypes)){ // Upload file to server if(move_uploaded_file($_FILES["file"]["tmp_name"], $targetFilePath)){ // Insert image file name into database $insert = $db->query("INSERT into images (file_name, top_text, uploaded_on) VALUES ('".$fileName."', '".$top_text."', NOW())"); if($insert){ $statusMsg = "The file ".$fileName. " has been uploaded successfully."; }else{ $statusMsg = "File upload failed, please try again."; } }else{ $statusMsg = "Sorry, there was an error uploading your file."; } }else{ $statusMsg = 'Sorry, only JPG, JPEG, PNG, GIF, & PDF files are allowed to upload.'; } }else{ $statusMsg = 'Please select a file to upload.'; } // Display status message echo $statusMsg; ?>
SLIDER <!-- Revolution slider --> <section id="slider"> <div class="tp-banner-container "> <div class="tp-banner rev-banner-fullscreen"> <ul> <!-- SLIDE --> <?php // Include the database configuration file include 'database/dbConfig.php'; // Get images from the database $query = $db->query("SELECT * FROM images ORDER BY uploaded_on DESC"); if($query->num_rows > 0){ while($row = $query->fetch_assoc()){ $imageURL = 'uploads/'.$row["file_name"]; $top_text = $row['top_text']; ?> <!-- DYNAMIC SLIDE --> <li data-index="rs-140" data-transition="slideup" data-slotamount="default" data-easein="default" data-easeout="default" data-masterspeed="default" data-thumb="" data-rotate="0" data-saveperformance="off" data-title="1/2" data-description=""> <!-- MAIN IMAGE --> <img src="<?php echo $imageURL; ?>" alt="" style='background-color:#f4f4f4' alt="" width="482" height="800" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat" class="rev-slidebg" data-no-retina> <!-- LAYERS --> <!-- LAYERS 1.2 --> <div class="tp-caption tp-resizeme" id="slide-1-layer-2" data-x="['left','left','left','left']" data-hoffset="['102','102','67','40']" data-y="['top','top','top','top']" data-voffset="['150','150','60','60']" data-fontsize="['18','18','14','14']" data-width="['345','345','345','259']" data-height="none" data-whitespace="normal" data-transform_idle="o:1;" data-transform_in="y:50%;z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;opacity:0;s:900;e:Power4.easeInOut;" data-transform_out="x:-50%;opacity:0;s:800;e:Power2.easeInOut;s:300;e:Power2.easeInOut;" data-start="500" data-splitin="none" data-splitout="none" data-responsive_offset="on" style="z-index: 6; min-width: 345px; max-width: 345px; white-space: normal; color: #3e3e3e; font-family: 'Montserrat'; letter-spacing: 7px;"> <?php echo $top_text; ?> </div> <!-- /END DYNAMIC SLIDE --> </li> <?php } }else{?> <!-- DEFAULT SLIDE --> <li data-index="rs-140" data-transition="slideup" data-slotamount="default" data-easein="default" data-easeout="default" data-masterspeed="default" data-thumb="" data-rotate="0" data-saveperformance="off" data-title="1/2" data-description=""> <!-- MAIN IMAGE --> <img src="images/slide/slide-5-bg.jpg" style='background-color:#f4f4f4' alt="" width="482" height="800" data-bgposition="center center" data-bgfit="cover" data-bgrepeat="no-repeat" class="rev-slidebg" data-no-retina> <!-- LAYERS --> <!-- LAYERS 1.2 --> <div class="tp-caption tp-resizeme" id="slide-1-layer-2" data-x="['left','left','left','left']" data-hoffset="['102','102','67','40']" data-y="['top','top','top','top']" data-voffset="['150','150','60','60']" data-fontsize="['18','18','14','14']" data-width="['345','345','345','259']" data-height="none" data-whitespace="normal" data-transform_idle="o:1;" data-transform_in="y:50%;z:0;rX:0deg;rY:0;rZ:0;sX:1;sY:1;skX:0;skY:0;opacity:0;s:900;e:Power4.easeInOut;" data-transform_out="x:-50%;opacity:0;s:800;e:Power2.easeInOut;s:300;e:Power2.easeInOut;" data-start="500" data-splitin="none" data-splitout="none" data-responsive_offset="on" style="z-index: 6; min-width: 345px; max-width: 345px; white-space: normal; color: #3e3e3e; font-family: 'Montserrat'; letter-spacing: 7px;"> New Arrival </div> <!-- /END DEFAULT SLIDE --> <?php } ?> </li> <!-- /SLIDE 1 --> </ul> </div> <!-- /tp-banner --> </div> <!-- /tp-banner-container --> </section> <!-- /#Revolution slider -->
Hello Everyone. Im new here, but hopefully you can help me I have designed a CMS using PHP and MySQL. Its fairly basic, I'll talk you thorugh the stages: 1.) The user inputs their product information into a form and the script uploads it to the database giving it a unique ID. 2.) The user is then asked to upload a big image for that product, the image is added to a folder on the server. 3.) Now the user must choose a thumbnail and it uploads in the same manner. My problem is linking the two together... So far I have this: <?php $images = "products/"; $big = "big/"; $cols = 2; if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != ".." && $file != rtrim($big,"/")) { $files[] = $file; } } closedir($handle); } $colCtr = 0; echo '<table width="212" cellpadding="2"><tr>'; foreach($files as $file) { if($colCtr %$cols == 0) echo '</tr><tr><td colspan="2"></td></tr><tr>'; echo '<td wdith=50% align="center"><a href="' . $images . $big . $file . '"><img border="0" class="gradualfader" src="' . $images . $file . '" /></a></td>'; $colCtr++; } echo '</table>' . "\r\n"; ?> This displays a lovely list of thumbnails, which when clicked opens the larger image. What i would like to do is insert a "ID" for each image so the product data can be grabbed from the database ? I think i've explained this well enough? reply if not and illl try and add more detail. To see it in action you can go to http://design.surreylabs.co.uk/parliament/2/products.php Thanks in Advance! |