Jump to content

help with sessions and variables


martin9t9

Recommended Posts

hey guys im writing some code for my website... it goes like this

 

Page 1

<?php
/* this page is sent to page 2 */
$postid = 105;

?>

 

Page 2


<?php

session_start(); 
/* this page redirects to page 3 */
$_SESSION[$postid]='rating';

?>

 

Page 3


<?php

if($_SESSION['$rows['id'] == $rows['id']) echo 'yes'; else echo 'no';

?>

 

 

this code is on www.martin9t9.com/announcement once youve signed up join the pakenham network then go to the homepage and click on of the ticks, i wanna make it so you can only press that button once.

the part im unsure of is the $_SESSION[$postid] = 'true'; part i dont understand why i can use the variable there.

Link to comment
https://forums.phpfreaks.com/topic/238545-help-with-sessions-and-variables/
Share on other sites

I can't use that because I want more than one session depending on the variable. What I'm doing is making a website where you can make posts then you can rate them but I only want them to beable to be rated once by that person so I was gonna make a session to make that so.

Archived

This topic is now archived and is closed to further replies.

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