GetDotted Domains

Viewing Thread:
"2 ickle PHP questions..."

The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.

Fri 09/01/04 at 17:47
Regular
"Pouch Ape"
Posts: 14,499
1) Cookies
I've never got on very well with these. The JavaScript versions are just a pain, but I've heard that the PHP equivalent are much easier to manage. So, plain English please - how do I set and retrieve a simple cookie to store a username and password for a PHP forum?

2) The & operator
I should just try this out really, but can't be bothered with all that uploading! All I want to do is perform 2 "file_Exists" checks, and if they do, it sets a variable for each to "yes", and then I run an:

if(thisvariable=="yes" & thatvariable="yes")
{ action }
else
{ alternative action }

Is that the right syntax? Does PHP do this basic function?

Simple questions really, but I'd rather someone flexed their coding muscles here than elsewhere :P

Once I've got these sorted I'll have a PHP forum that's more or less the same system as SR's!
Sun 11/01/04 at 03:57
Regular
"bing bang bong"
Posts: 3,040
http://hotwired.lycos.com/webmonkey/00/05/ index2a.html?tw=programming

This is a good tutorial on authentication in PHP, from which you can glean how to set and read cookies.
Sat 10/01/04 at 12:00
Regular
"Pouch Ape"
Posts: 14,499
Excrement, cheers!
Fri 09/01/04 at 18:39
Regular
"Eff, you see, kay?"
Posts: 14,156
monkey_man wrote:
> if(thisvariable=="yes" & thatvariable="yes")
> { action }
> else
> { alternative action }

You need a double &&, or just use the word "and".

> Is that the right syntax? Does PHP do this basic function?

PHP is one of the best languages out there.

As for cookies, read php.net/setcookie
Fri 09/01/04 at 17:47
Regular
"Pouch Ape"
Posts: 14,499
1) Cookies
I've never got on very well with these. The JavaScript versions are just a pain, but I've heard that the PHP equivalent are much easier to manage. So, plain English please - how do I set and retrieve a simple cookie to store a username and password for a PHP forum?

2) The & operator
I should just try this out really, but can't be bothered with all that uploading! All I want to do is perform 2 "file_Exists" checks, and if they do, it sets a variable for each to "yes", and then I run an:

if(thisvariable=="yes" & thatvariable="yes")
{ action }
else
{ alternative action }

Is that the right syntax? Does PHP do this basic function?

Simple questions really, but I'd rather someone flexed their coding muscles here than elsewhere :P

Once I've got these sorted I'll have a PHP forum that's more or less the same system as SR's!

Freeola & GetDotted are rated 5 Stars

Check out some of our customer reviews below:

Excellent
Excellent communication, polite and courteous staff - I was dealt with professionally. 10/10
Impressive control panel
I have to say that I'm impressed with the features available having logged on... Loads of info - excellent.
Phil

View More Reviews

Need some help? Give us a call on 01376 55 60 60

Go to Support Centre

It appears you are using an old browser, as such, some parts of the Freeola and Getdotted site will not work as intended. Using the latest version of your browser, or another browser such as Google Chrome, Mozilla Firefox, or Opera will provide a better, safer browsing experience for you.