PHP - Adding Images Causes My Whole Php Site To Shift 20px
Hey everyone, im building a simple php portfolio website (header , index, footer)
I have 3 pages , about , contact, portfolio If I add an image to the index page then click on my about page (no images) the whole site shifts to the right about 20px. If I remove the image and click the link everything is okay. Anyone know what im doing wrong? Code below: header 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" /> <link rel="stylesheet" href="style/style.css" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="header"> <ul> <li><h2><a href="portfolio.php">PORTFOLIO</a></h2></li> <li><h2><a href="about.php">ABOUT</a></h2></li> <li><h2><a href="contact.php">WHAT WE CAN DO TOGETHER</a></h2></li> </ul> </div> index Code: [Select] <?php include 'header.php'; ?> <div id="idea_container"> <a href="portfolio.php"><img src="images/logo.jpg" width="960" height="500" /></a> </div> <?php include 'footer.php'; ?> footer Code: [Select] <div id="footer" class="footer"> <ul> <li><a href="#">TWITTER</a></li> <li><a href="contact.php">CONTACT</a></li> <li><a href="index.php">HOME</a></li> </ul> </div> </div> <!--ending div for wrapper --> </body> </html> Similar TutorialsHi I have a custom built website with 40 pages or so that I am working on. Its all PHP based. However it is not on a CMS, it was a static HTML site converted into php with a bunch of include files etc now. I am keen to add a search facility, however I have no idea how to go about this. I know there are 3rd party paid offerings from Google, but I was wondering if anyone can advise me if its easy to setup without having to pay a 3rd party? Any advice is greatly appreciated. Hello and good day to all of you I have passed my midterms project(Online Shopping) with a score of 94 in PHP ( Click here to see file ) ( Sorry if the design is too ugly, I'm just new in programming XD ) Now our finals project will be a PHP site again but now with a database in it.. So instead of making a new project/design for a site, why not just add a database to my existing midterms? I would like to ask for some help here in helping me on connecting to the database, adding a database/tables and anything that would be of help like suggesting Databases would be like, - Users ( Admin and Members ) - Upper Clothing ( Shirts, Jackets, Long Sleeves, Raglan and etc ) - Lower Clothing ( Pants, Shorts, Boxers and etc ) - Stock on a current item - Single member's Transaction History - All user's Transaction History Is there a way that I could add those database named above to my project? Thank you in advance! Hi all, I am trying to add 3 images to a file on the server. The form is posted to a php page where I am trying to put the images in to a folder named aircraft. I have tried echoing the values and they are correct. But it is not working for some reason. Any help will be appreciated. The html form is: Code: [Select] <li> <label for="image">Main Image</label> <fieldset id="image1"> <input type="file" name="image" id="image" /> </fieldset> <label for="image2">Second Image</label> <fieldset id="image 2"> <input type="file" name="image2" id="image2" /> </fieldset> <label for="image3">Third Image</label> <fieldset id="image 3"> <input type="file" name="image3" id="image3" /> </fieldset> </li> The PHP page is: <?php $destination='aircraft/'.$reg."1.jpg"; $temp_file = $_FILES['image']['tmp_name']; move_uploaded_file($temp_file,$destination); $destination2='aircraft/'.$reg."2.jpg"; $temp_file2 = $_FILES['image2']['tmp_name']; move_uploaded_file($temp_file2,$destination2); $destination3='aircraft/'.$reg."3.jpg"; $temp_file3 = $_FILES['image3']['tmp_name']; move_uploaded_file($temp_file3,$destination3); ?> This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=358003.0 Hello everyone, I have this very short script I wrote with help from a book using arrays and the rand function. Basically it changes the images randomly on browser load or refresh. However, I am trying to add an additional, not sure what to call it, a string or another caption for each images. Instead of this being a caption, it will be a link, so a link will appear under each caption that goes to another page when it is clicked on. I tried adding another caption and adding a like to it but getting syntax error. Thanks everyone! Here is the code: Code: [Select] <?php $images = array( array('file' => 'image1', 'caption' => 'Caption 1'), array('file' => 'image2', 'caption' => 'Caption 2'), ); $i = rand(0, count($images)-1); $selectedImage = "graphics/{$images[$i]['file']}.png"; $caption = $images[$i]['caption']; ?> And here is where the images are written to the page: Code: [Select] <div id="stage"> <img src="<?php echo $selectedImage; ?>" alt="Random image" /> <p id="caption"><?php echo $caption; ?></p> </div> IC As I title says; I need to have an image showed the number of times, the value of a table/field.. How can I do this? I have recently started a Wordpress Site (www.edsstudios.com). Let me say in advance I am a designer and not a coder, hence the need to come to this forum. I installed a theme which I would like to customize on the home page. I want to place three images along with text below the image slider of the theme. I have included an attachment (pic1.jpg) showing the photoshop mock of how I want the home page to look. Keep in mind I only want to add the image below the image slider. The rest of the page is already existing as part of the wordpress theme. So, I sliced up only the images from the photoshop mock(pic2.jpg) within photoshop and produced the web ready images and html code. I opened the home.php file but can't get the code to function. Below is the code for the home.php page first. Below that is the html code for the images. Can someone tell me if there is something wrong with the code for the images along with where to place it on the home.php file? Home.php CODE <!-- --><?php get_header(); ?> <div id="contenthome"> <div id="slider"> <p> <?php include(TEMPLATEPATH."/includes/slider.php");?> </p> </div> <div id="homepage"> <div class="homepageright"> <div id="subscribe" class="widget"> <h4><span><?php _e("Subscribe", 'organicthemes'); ?></span></h4> <p><?php _e("Receive news and updates from us.", 'organicthemes'); ?></p><form action="http://feedburner.google.com/fb/a/mailverify" method="post" target="popupwindow" onsubmit="window.open('http://feedburner.google.com/fb/a/mailverify?uri=<?php echo ot_option('feedburner'); ?>', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true"><input type="text" value="Enter your email address..." id="subbox" onfocus="if (this.value == 'Enter your email address...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter your email address...';}" name="email"/><input type="hidden" value="<?php echo ot_option('feedburner'); ?>" name="uri"/><input type="hidden" name="loc" value="en_US"/><input type="submit" value="Subscribe" id="subbutton" /><input type="hidden" value="eNews Subscribe" name="title"/></form> </div> <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Home Sidebar') ) : ?> <div class="widget"> <h4>Widget Area</h4> <p>This section is widgetized. To add widgets here, go to the <a href="<?php echo admin_url(); ?>widgets.php">Widgets</a> panel in your WordPress admin, and add the widgets you would like to <strong>Homepage Top Right</strong>.</p> <p><small>*This message will be overwritten after widgets have been added</small></p> </div> <?php endif; ?> </div> <div class="homepageleft"> <h3><?php echo cat_id_to_name(ot_option('hp_cat')); ?></h3> <?php $recent = new WP_Query("cat=" .ot_option('hp_cat'). "&showposts=" .ot_option('hp_num') ); while($recent->have_posts()) : $recent->the_post();?> <div class="postarea"> <div class="posttitle"> <h2><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2> <a class="commenticon" href="<?php the_permalink(); ?>#comment" title="Comments"><?php comments_number('0', '1', '%'); ?></a> </div> <div class="homecontent"> <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_post_thumbnail( 'home-thumbnail' ); ?></a> <p><?php the_excerpt(); ?></p> <p><a class="more-link" href="<?php the_permalink() ?>">Read More</a></p> </div> </div> <?php endwhile; ?> </div> </div> </div> <!-- The main column ends --> <?php get_footer(); ?> IMAGES CODE <html> <head> <title>home page icons</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> <!-- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc; } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a.indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}} } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script> </head> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/home-page-icons_05ro.png','images/home-page-icons_07ro.png','images/home-page-icons_09ro.png')"> <!-- ImageReady Slices (home page icons.psd) --> <table width="960" height="183" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01"> <tr> <td colspan="3"> <img src="images/home-page-icons_01.png" width="310" height="143" alt=""></td> <td colspan="3"> <img src="images/home-page-icons_02.png" width="332" height="143" alt=""></td> <td colspan="3"> <img src="images/home-page-icons_03.png" width="318" height="143" alt=""></td> </tr> <tr> <td> <img src="images/home-page-icons_04.png" width="223" height="39" alt=""></td> <td><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image19','','images/home-page-icons_05ro.png',1)"><img src="images/home-page-icons_05.png" name="Image19" width="66" height="39" border="0"></a></div></td> <td colspan="2"> <img src="images/home-page-icons_06.png" width="273" height="39" alt=""></td> <td><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image20','','images/home-page-icons_07ro.png',1)"><img src="images/home-page-icons_07.png" name="Image20" width="65" height="39" border="0"></a></div></td> <td colspan="2"> <img src="images/home-page-icons_08.png" width="248" height="39" alt=""></td> <td><div align="center"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','images/home-page-icons_09ro.png',1)"><img src="images/home-page-icons_09.png" name="Image21" width="62" height="39" border="0"></a></div></td> <td> <img src="images/home-page-icons_10.png" width="23" height="39" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="223" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="66" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="21" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="252" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="65" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="15" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="233" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="62" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="23" height="1" alt=""></td> </tr> </table> <!-- End ImageReady Sl Right now users log in and upload an image to the website. I want every image that is uploaded to be watermarked with a particular logo. Is this possible? Any hints or tips will be appreciated. Thank you. I'm creating a shift system where it stores into database which shift is the user in. However sometimes their shift extends over the other shift. How can I implement it better I'm currently using the time to get which shift they are on. There are two shift. 1) morning: 0800 - 1930hrs 2) night: 1930 - 0800hrs
Sometimes the shift will overrun. How do I maintain on which shift they were.
$whatshift = (int) date("Hi"); if ($whatshift > "0800" && $whatshift < "1800") { $shift = 1; } else { $shift = 2; }
I want to give a unique ID for each run of my php script. I was thinking of creating an array(1,2,3,4,5...), as I can regularly take the first value and delete. Is there any command like array_ shift to do so? array_ shift take the first item but does not permanently delete it; thus, it will be the first item again in the next run. Or do you have a subtle idea for assigning unique ID to each run? Hello everyone, hopeing this is the correct place to place this, if not I apologize. I dont have a script, but here is what I hope to accomplish. There are 4 crew working, each works two days, then two nights then gets 4 off. Ex.. A platoon works 17th day, 18th day 19th night, 20th night then gets 4 off B platoon works 19th day, 20th day, 21st night, 22nd nght then gets 4 off C platoon works 21st day, 22nd day, 23rd night, 24th night then gets 4 off D platoon works 23rd day, 24th day, 25th night, 26th night then gets 4 off A platoon works 25th day, 26th day...... This schedule revolves like that for the entire year. (if A is working days, then D is working nights etc) I wanted to know if anyone could help me create a script that displays which crew is currently working, a script example that knows it is the 23rd and outputs "D platoon is on Duty" If anyone understands this and can help, please let me know. Thanks I am having some problems getting a query correct. Basically I have two tables, one with listings and another with categories. In the listings table I have a column called shortdescription. I am trying to pull the shortdescription from the listings table with the query $shortdesc = array_shift(mysql_fetch_row(mysql_query("select shortdescription from links where category = '".$scat->id."' "))); The shortdecription display properly on the pages display the listings, however I am getting the following error on any pages that only display the parent categories Warning: array_shift() [function.array-shift]: The argument should be an array in /home/...path/file.php on line 1462 The listings id numbers begin at 75+ because the initial parent category id ends at 74. The query seems to be searching for listing ids below 75 and spitting out an error because it is not finding them. Any ideas on how to eliminate this error and/or stop the query from looking for non-existant data? I have several "sites" located in my html directory, and each has a "general" access point and an "administrator" access point:
/var/www/html/site1/index.php /var/www/html/site1/administrator/index.php /var/www/html/site2/index.php /var/www/html/site2/administrator/index.php /var/www/html/site3/index.php /var/www/html/site3/administrator/index.phpAll sites are similar except that data will be specific to site1, site2, or site3, etc. Users who log onto /var/www/html/siteX/index.php are totally unrelated to those who logon to /var/www/html/siteX/administrator/index.php, will have different logon credentials, are stored in different DB tables, and each should have their own session. If a user logs off of either the general or administrator site, it should not effect the other site even if they were previously logged on to both on the same PC (and of course not effect other sites). When a user logs off, I would like to destroy their previous cookie and associated session. Users for either will only use https. I am using Apache to rewrite https://www.mysite.com/ to https://mysite.com/. While I named the administrator site "administrator" above, the administrator user has the ability to change the directory name. I am thinking I need to use session_set_cookie_params to specify where I wish the session cookie to be stored since /var/www/html/siteX/administrator/index.php is a sub-directory to /var/www/html/siteX/index.php, but am not really sure. Sorry for the cryptic post, but I am not very well versed in this subject. How would you recommend setting up cookies/sessions for this scenario? Thank you Hi, My first post here is a cry for help I have a Windows 2003 server running IIS6/PHP5, the server hosts multiple web sites. The problem is include files that are for site A are showing on site B (each site having its own includes as part of the site files in its own site folder), though not every time, its very random, sometimes the correct includes show, sometimes ones from another site on the same server. This only occurs where the include files for both sites have the same name, such as 'inc-header.php' for example. I can only assume PHP is caching includes and because they have the same name is showing the wrong one on other sites sometimes, if I rename them to something unique then the problem goes away, but its not a practical solution to rename all include files to unique names so I find myself looking for a 'real' fix. I have a feeling its to do with the include_path in the php.ini, but right now its disabled with a semi-colon, and I don't want to set one as I have no global includes, all includes are site specific. Any help would be very much appreciated! Phil now i use this code to show where the visitors came from to my site. <?php $referer=$_SERVER['HTTP_REFERER']; echo $referer; ?> now, i want to show the 5 latest vistors referer's site url on my site ? Not sure if I'm trying to achieve something totally crazy here, or if this is something pretty standard. Didn't have much luck with searching as I'm not fully down with all the terms. (A) I have one site providing an RSS feed. (B) I have one site I want to search, once for each of the items in the feed A. (C) I want the results of the search in (B) to be displayed on page (C). So for example, the feed on (A) says; apples bananas oranges cheese I want site (B) to search for each of those terms (by passing the item in the feed (A) to the ?search= part of the URL of that page) and then show the results from THAT search on page C. Bit of a complex one, let me know if you need me to clarify. Thanks for any help! Transferring data from sub-domain.site.com Reading sub-domain.site.com What is this all about? I'm going to put all .. images into a separate sub-domain eg: images.site.com. This would create a folder inside my public_HTML called "images" Now when sites have that Transferring data, and Reading... is this .. something relating to what I want. Facebook also does it, and they get their images for the site from a sub domain, how is it all done? I'm not sure if its entirely PHP, but I hope someone can help. Thanks I'm currently running a classified ads site and planning to display my own content from database combined with and external site rss. So here is what i got right now after the db query for the jobs ads (procedural php),
while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<div class="media margin-none"> <a class="pull-left bg-inverse innerAll text-center" href="#"><img src="'.$foto.'" share_alt="" width="100" height="100"></a> <div class="media-body innerAll"> <h4 class="media-heading innerT"> <a href="' . $row['title'] .'-da' . $row['id_ad'] . '" class="text-inverse">'. $remuneracion .' ' . substr(ucfirst(strtolower($row['title'])), 0, 53) . '</a> <small class="pull-right label label-default"><i class="fa fa-fw fa-calendar-o"></i> ' . $row['date_created'] . '</small></h4> <p>' . substr(ucfirst(strtolower($row['description'])), 0, 80) . ' ...</p>'; echo '</div> </div> <div class="col-separator-h"></div>'; } echo pagination($statement,$per_page,$page, $url_filtros, $filtros); ?>it is the while loop that i use to display ads from my database, what could be the best way to display (in this same loop?) other site's rss feed so i can show my content combined with the external rss? Thanks Hi I made a new design for my website and I made some changes. I want to use layout for my second site.
I'll like to know if my site is easier to browse through now and if you like the design better?. I test my site on internet explorer, chrome, and firefox. It is best to use site on better browsers like firefox and chrome to get a better experience of site. Thanks.
http://adjade.com
I have this script from http://lampload.com/...,view.download/ (I am not using a database) I can upload images fine, I can view files, but I want to delete them. When I press the delete button, nothing happens
http://www.jayg.co.u...oad_gallery.php
<form>
<?php $dir = dirname(__FILENAME__)."/images/gallery" ; $files1 = scandir($dir); foreach($files1 as $file){ if(strlen($file) >=3){ $foil = strstr($file, 'jpg'); // As of PHP 5.3.0 $foil = $file; $pos = strpos($file, 'css'); if ($foil==true){ echo '<input type="checkbox" name="filenames[]" value="'.$foil.'" />'; echo "<img width='130' height='38' src='images/gallery/$file' /><br/>"; // for live host //echo "<img width='130' height='38' src='/ABOOK/SORTING/gallery-dynamic/images/gallery/ $file' /><br/>"; } } }?> <input type="submit" name="mysubmit2" value="Delete"> </form>
any ideas please?
thanks
|