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);
Link to comment
Share on other sites

[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]
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]It doesn’t even give me errors it just display's a blank page[/quote]
Of course it just displays a blank page. There are no echo() statements. What do you expect to see?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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