how to get value on next page with out HTTP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

how to get value on next page with out HTTP

Post by itsmani1 »

Hello Every One.......

i want to get the info against all titles that are present on my page in the shape of links. can any body help me how to get the value of the title on next page with out using the HTTP Get or Post Methods.
Here is code of link ..........................

Code: Select all

<?php

while($row = mysql_fetch_assoc($res)) { 
            extract($row); 
echo "<a href="news_home.php"target="mainFrame">$title</a>";

?>
Regards
User avatar
devork
Forum Contributor
Posts: 213
Joined: Fri Aug 08, 2003 6:44 am
Location: p(h) developer's network

Post by devork »

use the session to keep track of arrays from page to page
$links= array();

Code: Select all

<?php 
session_start();
while($row = mysql_fetch_assoc($res)) { 
            extract($row); 
$lin="<a href="news_home.php"target="mainFrame">$title</a>";
$links[]=$lin;
echo $lin; }
session_register("links");
?>

now on the next page

Code: Select all

<?
session_start();
$mylinks=$_SESSION['links'];

this will give you all your links now use them  in array format ....
better read about array functions for more functionality

?>
Post Reply