Jump to content

Ive got the () and ,, in the wrong places Please Help


web2000

Recommended Posts

Hello,

I am trying to create a script that basically looks for a session, if it is there it will write the session value in to a text box, if it isnt it will create one using a mixture of time and ip address.

It doesnt work and im not to sure why, i am not a great PHP developer

Please can someone help me out here

Thank you very much


if (CCGetSession("username");
$shoppingcart->username->SetValue($username);
else;
$stamp = strtotime ("now");
$username = "$stamp$REMOTE_ADDR";
$username = str_replace(".", "", "$username");
$shoppingcart->username->SetValue($username);
CCSetSession("username", $username);
[code]<?php
if (CCGetSession("username")) {
    $shoppingcart->username->SetValue($username);
} else {
    $stamp = strtotime("now");
    $username = $stamp.$REMOTE_ADDR;
    $username = str_replace(".", "", "$username");
    $shoppingcart->username->SetValue($username);
    CCSetSession("username", $username);
}
?>[/code]
Are you experienced in another coding/scripting language then? Because OOP is [i]not[/i] a basic coding practice.

A good idea when troubleshooting is to print selected variables to the screen so that you can see what data is being passed around.

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.