Jump to content

bill-lancaster

Members
  • Posts

    16
  • Joined

  • Last visited

bill-lancaster's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm getting errors reported as well. Thanks again.
  2. How stupid of me, I assumed that php-mysql was installed - it wasn't. sudo apt-get install php5-mysql Results in a successful connection. Sorry to have wasted your time - at least I learned to use PDO! Thanks again.
  3. Yes, it shows /etc/php5/apache2/php.ini as the loaded config file
  4. Thanks, have set /etc/php5/apache2/php.ini as sugested then restarted apache I added this to a simple index.php file $db = new PDO('mysql:host=localhost;dbname=gwl', 'root', 'alex23'); echo "after"; Still no error reported and no echo after the call to PDO
  5. I'm very new php. Have been using mysql for many years but only on a pc (ie not networked). I have set up a pc on my lan as a server and can access it from the local network. I'm having trouble connecting to the mysql db installed on the server pc. The following simple code echos 'start' as in first php line, nothing is output after that. Not even 'Connection failed:' <!DOCTYPE html> <html> <body> <h1>test php</h1> <?php echo "start"; $servername = "localhost"; $username = "username"; $password = "password"; // Create connection $conn = mysql_connect($servername, $username, $password); echo "after"; // Check connection if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } echo "Connected successfully";?> </body> </html> The server is running Kubuntu 14.04 mysql V14.14 php V5.5.9-1ubuntu4.11 Hope someone has some ideas.
  6. I was being facetious also. This is where I am. I have several hundred scanned photos stored offline and managed by a mysql database. All the photos have associated thumbnails and descriptive info is held in the database. This is the sort of thing I've been doing for a long time but there came the need to share the info online. Hence my first venture into php, html etc. I already have a login page that manages user id & password through mysql and I can import info from my local db. The next step is to present the thumbnails on the web in a presentable manner PLUS a caption underneath. As you observe, just the photo name (which in my case is unique) will do. After that I was I hoping to use the 'onhover' to display the full information and then click to display a larger image.
  7. I'll let you know when (if) I get that far.
  8. Glad you're making an exception. The captions could just be the file name (as mentioned, I have the code to extract that) or possibly either from a database or a comment tag in the file.
  9. This didn't work:- <html> <body> <h1 align="center">Family Photos</h1> <?php $dirname = "img/"; $images = glob($dirname."*.png"); foreach($images as $img) { <div> echo '<img src= "'.$img.'" />'; echo "XXX" </div> } ?> Its possible that div is html and not php, found a post that suggests using echo "<div>"; But that doesn't work either
  10. Thanks for that. I want them horizontal actually. Still can't get the text underneath the picture though.
  11. Except that when I pasted the photos, they were in a horizontal line!
  12. Thanks, but the text appears alongside the image, not underneath. Here's what I'd like to see! 2390736357.jpg (100 x 67 pixels) image/jpeg 2390735019.jpg (100 x 67 pixels) image/jpeg 2390370487.jpg (79 x 80 pixels) image/jpeg 2390737530.jpg (100 x 67 pixels) image/jpeg 2397734534.jpg (100 x 56 pixels) image/jpeg This is from http://www.the-art-of-web.com/php/dirlist/1/ but I can't follow the html stylesheet stuff.
  13. My earlier post resulted in some good advice on showing photos from a folder. This works very well:- <html> <body> <h1 align="center">Family Photos</h1> <?php $dirname = "img/"; $images = glob($dirname."*.png"); foreach($images as $image) { Echo '<img src="'.$image.'"/>'; } ?> But how can I also show the file name under the picture? I have the code to extract the file name from the complete path.
  14. Thanks for the informed replies. I tried the first reply and found that I needed the full path to 'Gallery' and discovered getcwd() Then realised the second suggestion anticipated this issue! Thanks again - problem solved.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.