PHP - Help Creating Onrollover Slideshow Effect
I want to link to a movie but I'd like to create an onrollover slideshow effect so that when the image that links to the movie is mouseover, it slowly slideshows each of the 4 images that I specify.
Similar TutorialsThere are two effects that I have seen on website and keep wondering how they have been achieved. The first is when you go on Facebook and you type a link into your status bar. Then Facebook will automatically get some information about that article. The second effect is something I have seen on twitter and other websites. If you scroll down to the bottom of the page it will detect this and then load more content. If anyone could link me to any article or tutorials explain how these effects have been done that would be great. Thanks for any help. Okay, Earlier on I asked someone if they could show me a shorter way of making letters one higher, Like A becomes B and B becomes C in a string. I was wondering if using this code: for($i=0, $n=strlen($text); $i<$n; ++$i) { $val = ord($text[$i]); if(($val>=65 && $val<=90) || ($val>=97 && $val<=122)) { $base = ($val<=90) ? 65 : 97; $text[$i] = chr($base + ($val-$base+1)%26); } } I could reverse it's effect and make A become Z and B become A in a string. Thanks in advance! Why do I get the following results (specifically the second example)? I thought it would be documented under https://www.php.net/manual/en/language.types.string.php, however, the word "ampersand" doesn't appear. Also, looked at logical operators, but found nothing. Thanks function test(string $string){ printf('%s %s %s 0'.PHP_EOL, gettype($string), $string, $string==0?'==':'!='); } test('123'); test('@123'); test('1@23'); test('123@');Quote
string 123 != 0
Hi, I have this script which does what it is meant to do. I have assigned session_id() to the variable $sid so I can use it when logging in to a users account, however I get this error. How do I get around this? Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively. in Unknown on line 0 As this is going to be installed on many servers, I do not want to have to edit the php.ini file on each one so as not to get this error. Is there an alternative way to assign the session_id() as so $sid = session_id(); so this doesnt happen? Code: [Select] <div id="pageNav"> <div id="sectionLinks"> <a href="admin.php?cmd=manage1&username=admin">Manage</a> <a href="admin.php?cmd=dashboard&username=admin">Dashboard</a> <a href="admin.php?cmd=msgcenter&username=admin">Message Center </a> <a href="admin.php?cmd=manage&username=logins">Logins</a> </div> </div> <div id="content"> <div class="page"> <table width="100%" border="1" align="center"> <td bgcolor="#99FF66"><div align="center"><span class="style3">Login</span></div></td> <td bgcolor="#99FF66"><div align="center"><span class="style3">Name</span></div></td> <td bgcolor="#99FF66"><div align="center"><span class="style3">Registration Date </span></div></td> <td bgcolor="#99FF66"><div align="center"><span class="style3">Approved </span></div></td> <td bgcolor="#99FF66"><div align="center"><span class="style3">Reset Password </span></div></td> <td bgcolor="#99FF66"><div align="center"><span class="style3">Delete</span></div></td> </tr> <?php session_start(); $sid = session_id(); session_register('sid'); include_once("data/mysql.php"); $mysqlPassword = (base64_decode($mysqlpword)); $db = mysql_connect("$localhost", "$mysqlusername", "$mysqlPassword") or die ("Error connecting to database"); mysql_select_db("$dbname", $db) or die ("An error occured when connecting to database"); $result = mysql_query("SELECT * FROM members"); while($row = mysql_fetch_assoc($result)){ echo "<tr><td><a href=templates/members/home.php?username=".$row['username']."&sid=$sid>".$row['username']."</a></td> <td>".$row['firstname']." ".$row['lastname']."</td> <td>".$row['registration_date']."</td> <td><a href=admin.php?cmd=approval&username=".$row['username']."&approved=".$row['approved'].">".$row['approved']."</a></td> <td><a href=templates/members/changepw.php?username=".$row['username']."&sid=$sid>Change Password</a></td> <td><a href=templates/members/delete.php?username=".$row['username']."&sid=$sid>Delete</a></td></tr>"; } ?> </div> </div> </div> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </div> </div> </div> Many Thanks Paul This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=359215.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=357878.0 Hello all, Hi, I have an old code from 2004 and I would like to update it to use new Session object. That means instead of session_register using the $_SESSION super global variable. The main reason for this change is that wheneve I logged out from the software I get: Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0 Spo I replace my old code: <?php session_name("MySite"); session_start(); reset ($_GET); session_register("ADMIN"); session_register("ADMINNAME"); session_register("MAIL") ; $USERCOOKIE_FOR_TRACKING = array(); //to get all session variables foreach ($_SESSION as $key => $value) { $value=stripslashes(trim($value)); $$key=$value; } ?> with this new code: <?php session_name("MySite"); session_start(); reset ($_GET); $_SESSION['ADMIN']=""; $_SESSION['ADMINNAME']=""; $_SESSION['MAIL']=""; $USERCOOKIE_FOR_TRACKING = array(); //to get all session variables foreach ($_SESSION as $key => $value) { $value=stripslashes(trim($value)); $$key=$value; } ?> BUT now I cannot login to the software any more. looks like I am doing something wrong here. please tell me how do I upgrade my code. Thank you. Hi all My code give this: <b>Warning</b>: file_exists(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/home/clients/........ I get the tmp folder and check for its existanse and whether it is writeable
$t=sys_get_temp_dir(); Both gives no which is fine, I can process that. I do it to avoid the output above, but I still get that. How should I check for allowed paths? This runs on several systems where I cannot access php.ini or other system stuff.
Code: http://jsfiddle.net/3yN8a/126/
I am looking to keep the div including the text ("testing") static, so it does not fade with the background image.
Any ideas of where to start?
Thanks!
Alex
I have a page on my site which displays a picture that I have stored on my server. The loaction of that picture is stored in mysql. All the images are .jpg format. My question is, if I allow a user to upload 5 pictures instead of just 1, is there a simple script that would show each picture for about 2-3 seconds, the go to the next? Basically like an auto slideshow. Each picture has an ID that associates with the name of the category, so I could just call that ID and have the slideshow only show those pictures. So I'm just wondering about the slideshow script. I was told that you guys could probably help me with this, so heres my situation. I use this program called Activeworlds, and me and my buddies are makeing a "tv show" if you will within the program. To do so, you take screenshots, save the screenshots, and add the image files into a directory on your domain. You need a .php script to present them as a slideshow. Now the problem is, ive searched for scripts already made from other sites, but the thing is, they are all fancy slideshow viewers, meaning they come with control buttons to cycle through the pictures and all kinds of other banners and flashy looking things. The only script im needing, is a simple script that will display and cycle through the raw images, and nothing else, within the web browser, in a slideshow format. Id also like to have a value I can edit that will change how fast the pictures cycle through, 15 seconds or so would be perfect however. If someone could refer me to this code or even make it for me, it would be soo appreciated. I know im probably asking for alot, but it would help me soo much. I wish I knew a little more about .php files to do it myself, or else I would. If you do link me to a script, please give me simple instructions on what to do with it lol because like I said, I dont know anything about the world of .php yet. Thank you all for your time. Slideshow programs created with Slideshow Maker. The html version works but opens in a new window. I want it to open in the content window same as all other programs. menu2.php (partial) <li> <a href="#">Slideshows</a> <ul> <li> <a href="index.php?page=slideshow_shed">Shed construction</a> </li> <li> <a href="content/pages/slideshow_shed.html">Shed Construction</a> </li> </ul> slideshow_shed.html <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>Shed Pictures</title> </head> <body bgcolor="#FFFFFF"> <p> <p> <style type="text/css"> <!-- .style1 { color: #006633; font-weight: bold; } --> </style> <!-- saved from url=(0013)about:internet --> <table align="center" border="0" cellpadding=0 cellspacing=0> <tr> <td align="center">Shed Pictures</td> </tr> <tr><td align="center"><br /></td></tr> <tr> <td align="center"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="768" height="576" id="tech" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="slideshow_shed.swf" /> <param name="quality" value="high" /> <embed src="slideshow_shed.swf" quality="high" width="768" height="576" name="tech" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </td> </tr> <tr> <td align="center" ><br /> Created by <a href="http://www.flash-slideshow-maker.com/index.php?srcid=glc" target="_blank">Flash Slideshow Maker</a> </td> </tr> <tr> <td align="center" valign="middle" bgcolor="#FFCC99"><br /> <a href="http://www.flash-slideshow-maker.com/buynow.php?srcid=glc" target="_blank"><strong>Order the full version now to remove the software logo at the end of slideshow</strong></a> </td> </tr> </table> </body> </html> slideshow_shed.php <?php ?> <style type="text/css"> <!-- .style1 { color: #006633; font-weight: bold; } --> </style> <table align="center" border="0" cellpadding=0 cellspacing=0> <tr> <td align="center">Shed Pictures</td> </tr> <tr><td align="center"><br /></td></tr> <tr> <td align="center"> <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="768" height="576" id="tech" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="slideshow_shed.swf" /> <param name="quality" value="high" /> <embed src="slideshow_shed.swf" quality="high" width="768" height="576" name="tech" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object> </td> </tr> <tr> <td align="center" ><br /> Created by <a href="http://www.flash-slideshow-maker.com/index.php?srcid=glc" target="_blank">Flash Slideshow Maker</a> </td> </tr> <tr> <td align="center" valign="middle" bgcolor="#FFCC99"><br /> <a href="http://www.flash-slideshow-maker.com/buynow.php?srcid=glc" target="_blank"><strong>Order the full version now to remove the software logo at the end of slideshow</strong></a> </td> </tr> </table> I don't get any errors, just the title "Shed Pictures" displays. Hi, I'm trying to make a simple slideshow with forward and back buttons that change the image inside a div in php. When I press the "further" button, it jumps from index[0] to index[1] and never shows the first image. Then when I click more it doesn't go forward. When I click back, it goes back to a black screen div. Any help getting this to work is GREATLY appreciated because I've been trying for 2 days with tutorials and can't get it. Thanks. Derek Here are the php parts that are relevant, my page was too large and confusing to include. first, the $background array where I store my images. Code: [Select] $background = array ( "<img src='sundragon_environments/ocean/ocean1_FRAME.jpg'/>", "<img src='sundragon_environments/ocean/ocean1_FRAME2.jpg'/>" ); then the code to move the images forward and backwards if the buttons are pressed. Code: [Select] if(!empty($_POST['further'])) { $currentBackground=next($background); } elseif(!empty($_POST['back'])) { $currentBackground=prev($background); } and now to echo out the images inside the div. Code: [Select] <div id="background"><?php echo $currentBackground;?></div> Hi, You may noticed that i've posted before and closed them. It was too hard. I've been searching around for something else and i found it. But it's not quite perfect. What i want to do is make thumbnails smaller (i can do that on my own) but displaying the bigger picture above the thumbnails. And aligning the thumbnails next to each other. So how do i do that? The current code: <?php $result = mysql_query("SELECT reference FROM user_photos WHERE`profile_id`='".$row['id']."'"); while ($row2 = mysql_fetch_array($result, MYSQL_ASSOC)) { echo "<a href=\"".$_GET['username']."/pics/".$row2['reference']."\"> <img src=\"".$_GET['username']."/pics/thumbs/".$row2['reference']."\"></a><br/><br/>"; } } ?> The files are refering to the mysql in reference but are actually in a subfolder with the username on the server. I hope somebody wants to help me, Best regards, Martijn (the netherlands) Hi, I have made picture slideshow and included many pictures for the slideshow but i also added a video, how to make it apear as it is not appearing. code: <?php //index.php $connect = mysqli_connect("dbhost", "dbuser", "dbpassword", "dbname"); function make_query($connect) { $query = "SELECT * FROM banner ORDER BY banner_id ASC"; $result = mysqli_query($connect, $query); return $result; } function make_slide_indicators($connect) { $output = ''; $count = 0; $result = make_query($connect); while($row = mysqli_fetch_array($result)) { if($count == 0) { $output .= ' <li data-target="#dynamic_slide_show" data-slide-to="'.$count.'" class="active"></li> '; } else { $output .= ' <li data-target="#dynamic_slide_show" data-slide-to="'.$count.'"></li> '; } $count = $count + 1; } return $output; } function make_slides($connect) { $output = ''; $count = 0; $result = make_query($connect); while($row = mysqli_fetch_array($result)) { if($count == 0) { $output .= '<div class="item active">'; } else { $output .= '<div class="item">'; } $output .= ' <img src="banner/'.$row["banner_image"].'" alt="'.$row["banner_title"].'" /> <div class="carousel-caption"> <h3>'.$row["banner_title"].'</h3> </div> </div> '; $count = $count + 1; } return $output; } ?> <!DOCTYPE html> <html> <head> <title>How to Make Dynamic Bootstrap Carousel with PHP</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" /> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> </head> <body> <br /> <div class="container"> <h2 align="center">How to Make Dynamic Bootstrap Carousel with PHP</h2> <br /> <div id="dynamic_slide_show" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <?php echo make_slide_indicators($connect); ?> </ol> <div class="carousel-inner"> <?php echo make_slides($connect); ?> </div> <a class="left carousel-control" href="#dynamic_slide_show" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left"></span> <span class="sr-only">Previous</span> </a> <a class="right carousel-control" href="#dynamic_slide_show" data-slide="next"> <span class="glyphicon glyphicon-chevron-right"></span> <span class="sr-only">Next</span> </a> </div> </div> </body> </html> in the database i have the names of the photos from 1 to 5 then a video. The photos are shown but the video is not showing. Is there a way to include it in the slideshow? If not, is it possible to have a video player instead.
Thanks. I've been working on developing a CMS blog and now I'm trying to create a slideshow wit Bootstrap Carousel on the homepage to present the dynamic content (images + text) using the data from table 'posts'. I tested this code, and it only presents one post. I mean, It's not possible to go to the next slide. I want to show all the posts on the slides. *The DB connection is already on the includes. The connection was written on a small file called DB.php Home.php <header> <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li> <li data-target="#carouselExampleIndicators" data-slide-to="1"></li> <li data-target="#carouselExampleIndicators" data-slide-to="2"></li> </ol> <div class="carousel-inner" role="listbox"> <?php // The default SQL query $sql = "SELECT * FROM posts ORDER BY id desc"; $stmt = $ConnectingDB->query($sql); while ($DataRows = $stmt->fetch()) { $Id = $DataRows["id"]; $PostTitle = $DataRows["title"]; $Image = $DataRows["image"]; $PostText = $DataRows["post"]; ?> <!-- Slide --> <div class="carousel-item active" style="background-image: url('uploads/<?php echo $Image; ?>')"> <div class="carousel-caption"> <div class="card-body black"> <h3 class="large-mistral-white"><?php echo $PostTitle; ?></h3> <p class="small-times-white"><?php echo $PostText; ?></p> </div> </div> </div> <?php } ?> </div> <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div> </header> DB.php <?php $DSN='mysql:host = localhost; dbname=everybody_blog'; $ConnectingDB = new PDO($DSN,'root',''); ?>
Ok I am designing a php upload that will take a image file from a form and change the name of the file to the productnumber also recieved from the form. I had it working the otherday now it says Warning: copy() [function.copy]: open_basedir restriction in effect File() is not within the allowed path(s): (/home:/tmp:/usr) addpro.php on line 51. my files are attached.... note that $pnum is the product number gotten from my form and image is the image being uploaded gotten from the form also. The thing is it worked the other day but now it don't is it a change to the server ( I dont run the server) or did I mess up my code since then? I really need a code that will do this two time over once for a small image being put into a folder called small and once for a folder called large both images being uploaded and being changed to $pnum.ext so they will both be displayed when being called out by the product number. but I can work on that after I get this one working. line 51 is $copied = copy($_FILES['image']['tmp_name'], $newname); |