Get support from Xavier Media
It is currently Sun Dec 08, 2013 3:35 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: session
PostPosted: Sun Oct 29, 2006 6:23 pm 

Points:
hii...

ah ah session don't work with me i don't know why
i am make all the sttings
Code:
session.save_handler = files
session.auto_start = 1
session.use_cookies = 1

and all the another settings and this the code for the page i am make test in it
session.php
Code:
<?
session_start();
session_register("zx");
session_register("co");
$zx=10;
$co++;
echo "welcome";
echo "<br>";
echo "you visit this page=".$co ;
echo "<br>";
print $zx;
echo '<a href=" php2.php ">second page</a>';
?>


Code:
<?
session_start();
echo $PHPSESSID ."<br>";
echo "<br>";
echo $zx;
?>


plz any one can help[/php]


Report this post
Top
  
Reply with quote  
 Post subject: sessions
PostPosted: Mon Oct 30, 2006 12:17 am 

Points:
Ok, here is the fixed code. Remeber to create your variables before you set them.

Page 1
[php]<?php
session_start();

$zx = 10;
$co = 0;
$co++;

session_register("zx");
session_register("co");


echo "Welcome To the Session Test Page 1<br>";
print '$zx is = '. $zx. '<br>';
echo '<a href="page2.php">second page</a>';
?> [/php]


Page 2:
[php]<?php
session_start();
echo $PHPSESSID ."<br><br>";
echo $zx ."<br><br>";
echo $co ."<br><br>";
?> [/php]


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 11:41 am 

Points:
firts thankx for ur fixed but at last

nothing happen the same thing the number of visit for the page still (1) and in the next page (page2.php) not write print (10) i think that mean nothing happen

can give me more help plz david :)


Report this post
Top
  
Reply with quote  
 Post subject: Sessions
PostPosted: Mon Oct 30, 2006 1:15 pm 

Points:
Sessions are set to work in PHP by default. If you made any changes in the php.ini file you may have dissabled them. Fix your setting to reflect these:

http://us3.php.net/session



Code:
vsession.save_path              ""   
session.name                    "PHPSESSID"   
session.save_handler            "files"   
session.auto_start              "0"
session.gc_probability          "1"
session.gc_maxlifetime          "1440"


Make sure you don't have sessions set for databases....


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 4:10 pm 

Points:
nothing happen :(
didn't work i am make all the settings
:( :( :( :(


Report this post
Top
  
Reply with quote  
 Post subject: sessions reply
PostPosted: Mon Oct 30, 2006 11:26 pm 

Points:
dragon tears wrote:
nothing happen :(
didn't work i am make all the settings


Who is your host? They might not allow Sessions :?...
Have you called them or is this on your own server.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 9:56 pm 

Points:
haa

ok when i am make the settings on my pc nothing happen but when i am upload it to my website some of that code work and some not like

the $zx has been write at the next page number(10) but the number of the visit for fist page not go up still (1) so ... i don't know

:(:(:(


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 01, 2006 12:22 am 

Points:
dragon tears wrote:
the $zx has been write at the next page number(10) but the number of the visit for fist page not go up still (1) so ... i don't know


The "$co" variable will never go up because every time you go to page 1 it sets $co equal to "0" and then adds "1" to it. So it will always stay one. What you need to do is this if you want it to increase:

[php]<?php
session_start();
if (!isset($_SESSION['co'])) {
$_SESSION['co'] = 0;
} else {
$_SESSION['co']++;
}

echo $_SESSION['co'];

?>[/php]


Last edited by Guest on Wed Nov 01, 2006 3:14 pm, edited 1 time in total.

Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: Wed Nov 01, 2006 11:26 am 

Points:
ah thankx it's work anyway
that example i wrote it it's from arabic e-book for learn php

sooooooo i don't know what to say anyway thankx for u very much and i want another help put in another topic i will put it :)


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Registered users: No registered users


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Portal » Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
[
SEO MOD © 2007 StarTrekGuide ]