www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > PHP

    PHP Discussion and technical support for using and deploying PHP based websites.

    Reply
     
    Thread Tools Rate Thread Display Modes
      #1  
    Old 02-09-2010, 01:20 AM
    malthus23 malthus23 is offline
    Registered User
     
    Join Date: Feb 2010
    Posts: 17
    Auto create new page?

    Hi,
    I'm quite new at php and I'm trying to create a script that will save me a lot of time when creating my website.
    I'm gonna try to explain what I'm looking for by taking a simple example.

    I have a page 'Portfolio'. On this page I have thumbnails of my work. 'OnMouseOver' will have the bigger version of the image appear on the screen (no need for a click).
    The images are named 1001, 1002, 1003, etc.
    The thumbs are named 1001_th, 1002_th, etc.

    When I click on one of the thumbnails, I want the page "Details" to open, on which only the picture and the description is different for every project. The rest of the content will be the same every time.

    What I am trying to do is avoid having to create a page "Details" for each one of my projects (up to 100 and growing). I figure there must be a simple solution to 'take' the number of the picture and put it in a standard "Details" page.

    Any help on this will be much appreciated!
    Thanks,
    M.
    Reply With Quote
      #2  
    Old 02-09-2010, 10:48 AM
    xcsresources xcsresources is offline
    Registered User
     
    Join Date: Jun 2009
    Posts: 11
    So the idea is that each image & description would be wrapped in between the specified header and footer onclick :/ I havent tested it but it uses a combination of javascript, php and xhtml If its not what your looking for apologies i tried ^_^

    Code:
    <a href="{file_row.file_col.FILEURL}" onclick="window.open('http://domain.com/index.php','_self');"><img id="" name="" src="{file_row.file_col.TBFILEURL}" style="" border="0" height="" width="" /></a>
    Code:
    <?
    	include_once("header.php");
    
    image and description
    
        	include_once ("footer.php");    
                                                                          
    ?>
    Reply With Quote
      #3  
    Old 02-09-2010, 11:14 AM
    ehime's Avatar
    ehime ehime is offline
    Screw Coding....
     
    Join Date: Oct 2008
    Location: Seattle, Wa
    Posts: 490
    ^ I have no idea what you did there..... this can all be done by php....

    And, if you've already included you're header/footer you're going to drop an error.....
    Which is what it looks like you're trying to do for each image?
    PHP Code:
    <?php
    if(!@file_exists('./header.php') ) {
        echo
    'can not include';
    } else {
       include(
    './header.php');
    }
    ?>

    Last edited by ehime; 02-09-2010 at 11:17 AM.
    Reply With Quote
      #4  
    Old 02-09-2010, 11:24 AM
    xcsresources xcsresources is offline
    Registered User
     
    Join Date: Jun 2009
    Posts: 11
    lol I should have your sig I wish I had 1/3 of the talent I cant program for squat
    Reply With Quote
      #5  
    Old 02-09-2010, 11:32 AM
    ehime's Avatar
    ehime ehime is offline
    Screw Coding....
     
    Join Date: Oct 2008
    Location: Seattle, Wa
    Posts: 490
    PHP Code:
    <?
    function pager( $pathToImages ) {

      
    $dir = opendir( $pathToImages );

    echo
    "<div>\n"; # Binder
      
    while (false !== ($fname = readdir( $dir ))) {
       
    $count[] = $fname;

        
    $info = pathinfo($pathToImages . $fname);
        if (
    strtolower($info['extension']) == 'jpg' )
        {
                foreach(
    $count as $info) {
                
    $t = 1; $t .= str_pad( $i, 3, "0", STR_PAD_LEFT ); # CAT 1 + 00 + NUM?
            
                
    echo "<a href='http://$info.jpg'><img src='http://$info_th.jpg'>" . "<br />\n";
            
                }

        }
        
    echo
    "</div>\n"; # Close Binder

    } // pager();
    ?>

    <?PHP pager('http://whatever.com/my_thumbs_here/'); ?>
    That should be better, the count might be messed up though I dunno, I gotta
    get back to work.

    Last edited by ehime; 02-09-2010 at 11:42 AM.
    Reply With Quote
      #6  
    Old 02-09-2010, 08:28 PM
    malthus23 malthus23 is offline
    Registered User
     
    Join Date: Feb 2010
    Posts: 17
    Thanks guys for your time, I'll try with the above and see where it gets me...
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is Off
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 01:13 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.