Hi all,
i am trying to do a img search application using PHP and mysql. Basically it goes like this, on the index.php a user will key in some keywords to search and it will return results on the image search
Then i will try store the array of results in a $_SESSION.
index.php
display_results .php
is that the correct way to do it?
i am trying to do a img search application using PHP and mysql. Basically it goes like this, on the index.php a user will key in some keywords to search and it will return results on the image search
Then i will try store the array of results in a $_SESSION.
index.php
Code:
$_SESSION['imgfile'] = array();
do { ?>
<li><img src="img/<?php echo $row_rstImages['image_filename']; ?>" alt="<?php echo $row_rstImages['image_title']; ?>" name="search" width="200" height="150" id="search
<?php echo $row_rstImages['image_id']; ?>" /img>
<br /><a class="<?php echo $row_rstImages['image_title']; ?>" href="displayactual.php" /a>
<?php echo $row_rstImages['image_title']; ?>
<?php $_SESSION['imgfile'][]=$row_rstImages['image_filename']; echo $row_rstImages['image_filename']; var_dump($_SESSION['imgfile']); ?> </li>
<?php } while ($row_rstImages = mysql_fetch_assoc($rstImages)); }
Code:
<?php echo '<img src="img/'.$imgfile.'" width="200" height="150">'; var_dump($_SESSION['imgfile']); ?> </p>
Comment