Help with php on my site

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

illwillsites
New php-forum User
New php-forum User
Posts: 1
Joined: Fri May 23, 2014 11:33 am

Help with php on my site

Postby illwillsites » Fri May 23, 2014 3:25 pm

I'm using the PHPmotion script, with a use-a-credit-to-view-a-video mod. When the user logs out, the viewed video should not be available again to view, until he logs back in and chooses it, via a credit. But it is still available when he logs back in. I could use some help in trying to determine what file may be responsible for what I guess you could call 'clearing the session upon log out'?
Any guidance will be appreciated, thanks

developerahusain
New php-forum User
New php-forum User
Posts: 44
Joined: Tue May 28, 2013 10:04 pm
Location: India,Lucknow

Re: Help with php on my site

Postby developerahusain » Sat May 24, 2014 7:03 am

You do it like this.

When you choose credit mode. You generate a session like this.

<? //php ?>
if ($_POST ['b_submit'])
{
$_SESSION ['credit']="Yes";
}
?>

<? //form,do as you want,just a example ?>
<form name="asdf" method="post"><input type="submit" class="style_form" name="b_submit" value="Credit"></form>

Now,you write this query to show video only if session credit is there.

if ($_SESSION ['credit'])
{
?>
your video file<param></param>
<?
}
?>

For unsetting credit session.Use this query.

session_start ();
if(isset($_SESSION['credit']))
unset($_SESSION['credit']);

the session credit will go off. and video will not be visible until you submit that form again.Any advanced help,i will create a whole page and give it you. No problem dude.

Developerahusain


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron