PHP - Moved: How To Ensure Images Load?
This topic has been moved to Third Party PHP Scripts.
http://www.phpfreaks.com/forums/index.php?topic=357633.0 Similar TutorialsHi, I am frustrated with getting db to store just unique entries, b/c every time I refresh the browser, the script runs and re-inserts the SAME INSERT query (but with different primary key of course which I don't want). My ques is is there a way upon the first insertion to tell it that this will be only instance of this record entered for the specified db table. So I don't want to have to encapsulate each INSERT statement in an if block to make sure that only one record exists so now I am doing it incorrectly with exit statement. please see code below: Code: [Select] <?php $_filePath="C:\\\dir\\\email.xml"; $node=basename($_filePath); $dom=new DOMDocument(); $dom->load($node); $labelPath=array(); $connection=mysql_connect("localhost","root"); mysql_select_db("dummydpev999"); $isXdocExist=mysql_query("SELECT file_Path,file_Name FROM xdocument WHERE file_Path='$_filePath' AND file_Name='$node'"); $docId=0; if(mysql_num_rows($isXdocExist)==1) { print "Entry already exists!"; $docId=mysql_next_id("xdocument")-1; print "<br />".$docId; exit; } else { mysql_query("INSERT INTO xdocument (file_Path,file_Name) VALUES ('$_filePath','$node')"); $docId=mysql_next_id("xdocument")-1; print "<br />".$docId; } writeXMLtoDBViaDOM($dom->documentElement,$labelPath,$docId); ?> Sorry I should elaborate, I think my problem is that I have tables with foreign keys rather than all tables with just primary keys, I am unsure... Any help much appreciated. So I have a page that has profile images basically, but these images cache and when someone clicks on anything, like rotate image, since my script rotates the image and saves it correctly, I can hit Ctrl+F5 and the image then shows up correct, but the page loading itself after running my script using a get method and then using the header coming back to the same page the image looks like it wasn't reloaded. Noones gonna hit Ctrl+F5, so how do I get this to cache the image completely when the page reloads? I've tried <meta http-equiv="pragma" content="no-cache" /> But this doesn't work, well nothing seems to work really. Hi. I'm using SimpleImage.php to do some basic image manipulation. The code is here http://www.white-hat-web-design.co.uk/articles/php-image-resizing.php, but I don't think all the details are important. Basically, I'm trying to read and image and save it with a different name. I'm really new with this stuff, so it's probably something simple. Anyway, here is the code throwing the error, $image_info = getimagesize($filename); where $filename is a string containing the path to the image I want to load, e.g. $filename="images/picture.jpg"; It's throwing a "Read Error!" I know that the path is correct. In fact I first check if the file is there using is_file($filename); and it returns true. I'm guessing that maybe php does not have "permission" to read this file. The permissions for the file are -rw-r--r-- 1 www-data www-data 80211 2011-04-20 16:19 picture.jpg Looks like everyone has "read" permission, so I don't see what the problem is. Also, the permissions of the folder and all parent folders are 777. Not sure what the problem is. I might be way off by guessing that it is a permissions problem. Any help would be great. Thanks. Also, I was wondering if there is a way for this forum to email me whenever there is a reply to my posts. I can't seem to find the option anywhere. This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=320482.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=305885.0 This topic has been moved to PHP Installation & Configuration. http://www.phpfreaks.com/forums/index.php?topic=326567.0 This topic has been moved to Ajax Help. http://www.phpfreaks.com/forums/index.php?topic=349871.0 This topic has been moved to Application Design. http://www.phpfreaks.com/forums/index.php?topic=346417.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=332698.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=322814.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=342341.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=314527.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=317486.0 This topic has been moved to Third Party PHP Scripts. http://www.phpfreaks.com/forums/index.php?topic=358003.0 I'm having a problem and need an answer to why its happening and how to prevent it. Scenario: I begin load my home page which starts with a session_start(); .... Before it FULLY completes loading I try to navigate to another page and BOOM, that page will not load and any other page that begins with session_start(); will not load unless I close and restart the entire browser or wait about 10 minutes.... I will note my website makes ajax calls every 5 seconds or so, but I use setTimeout for them. Any help??? Thanks ahead! This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=333585.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=321319.0 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
<?php $URL1 = file_get_contents('http://www.yahoo.com'); $URL2 = file_get_contents('http://www.google.com'); ?> How would I make PHP load URL1 and URL2 at the same time.. I would add more than 2 urls also, Im tyring to test something with my website, load up to 50 links at once, how would I do this? Thanks I'm pretty new to php. But the below script should get news articles from google news rss. It is failing to load the simplexml and returns false. Any idea why? Code: [Select] $url = "http://news.google.com/news?geo=90210"; if ($xml = @simplexml_load_file($url)) { for ($i=0; $i<4; $i++) { $item= $xml->channel->item[$i]; $link= '<a href = "'.(string) $item->link.'", target= "_blank">'.(string) substr($item->title, 0, 50).'...</a><br />'; $news[]= $link; } } |