Jump to content

drums

Members
  • Posts

    32
  • Joined

  • Last visited

    Never

Posts posted by drums

  1. I asked a question in another thread about making this script work in multiple instances but now I can't even get it to work!

    <?php 
    $cpics = array (
           "images/sidebar/party1.jpg",
           "images/sidebar/party2.jpg",
           "images/sidebar/party3.jpg"
    );
    $index = rand(0, 2);
    $cbanner = $cpics[$index];
    ?>
    

     

    And in the http://do-rightweb.com/1-test.php test page

    <img src="$cbanner">

     

    Thanks very much for your help.

  2. I have an old script that I do not recall where I got it but would like to enhance it. I thought of creating multiple ones and just give them different names but that seems redundant and certainly less elegant than doing it in one script.

     

    I have 5 images running down each side of a wordpress site (left & right sidebar) though the platform is not relevant in this application, I don't think... I want to be able to randomize each of those 10 images on each page so that each time a user visits the page or refreshes all the images change.

     

    Is there a way to randomize all those images without special casing each one like the code I have and my lack of PHP knowledge would dictate?

     

    $cpics = array (
           "images/pic1.jpg",
           "images/pic2.jpg",
           "images/pic3.jpg"
    );
    $index = rand(0, 2);
    $cbanner = $cpics[$index];
    

    And then on the page I put

    <img src="$cbanner">

    So with my lack of PHP programming skills I would create an array for each location giving each array a different name so that my sidebar code would look like this:

    <li><img src="$1banner"></li>
    <img src="$2banner">
    <img src="$3banner">
    <img src="$4banner">
    <img src="$5banner">
    

    Thanks very much for your help.

     

  3. What would the code be to display server side code like the date and time to display in html pages? I have the date code for copyrights that I want to display

    <?php echo date(Y); ?>

    and I think I need to create an .htaccess file to put it in but not sure what to put.

    Thanks,

  4. Sorry, but I do not know what else to say :confused:. I provided the code and the images are not displaying. I still have not published the site but looking at the code is moot since it's PHP but if you want to see it go here http://do-rightweb.com/fertility/

     

    And on line 39 you will see the code:

    <div id="top-main">
    <img src='<?php echo $hbanner; ?>' width='723' height='306' alt='Center 4 IVF' border='0'>
            <p class="top-main">:: (201) 666-4200 ::</p>
    

    I get the alt tag and a broken image marker when I use

    <img src='<?php echo $hbanner; ?>' width='723' height='306' alt='Center 4 IVF' border='0'>

    Thanks very much for your help/response.

  5. I have a script I haven't used in a couple years that I want to use on a new site but can't seem to get it working. I have the code below before the </head> tag:

    <? 
    $hpics  = array (
            "images/top-main.gif",
            "images/top-main2.gif",
            "images/top-main3.gif",
            "images/top-main4.gif",
            "images/top-main5.gif",
    );
    $index = rand(0, 4);
    $hbanner = $hpics[$index];
    ?>
    

    And then in the body I put:

    <img src='$hbanner' width='723' height='306' alt='Center 4 IVF' border='0'>

    to try to get it to work but no show. So I thought maybe I need to make sure the server is parsing PHP therough html with .hataccess but still, no show.

     

    Ultimately I want it to go in as a background image and think this should work but would appreciate anyone pointing out any possible issues:

    <div id="top-main" style="background:url($hbanner) no-repeat">

     

    So hopefully someone can sniff this out and tell me what I'm forgetting/doing wrong.

     

    Thanks very much for your help!

  6. I have basic level expertise in database creation and querying, basically a noob. I have a number of sites I will be moving in a week. I have some really simple databases and then some Wordpress ones which I'm not too worried about because I think WP has a plug in or steps. With my simple ones, I really want to avoid having to recreate them. I can see an export feature in phpMyAdmin 2.6.3-pl1 but not sure what to do with it.

     

    I can export to a csv but how do I import it and also create the tables/database in the new location? Or do I have to recreate these tables/dB's?

     

    Thanks very much for your time!

×
×
  • 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.