0% found this document useful (0 votes)
12 views37 pages

Random Code Script

The document is a discussion between users about creating a script that displays a random code to users when they visit a webpage. The conversation covers the use of cookies to ensure that each user only sees their assigned code once, and the need for server-side code to manage user accounts securely. The participants also discuss the challenges of implementing this system using different programming languages, specifically PHP and ASP.

Uploaded by

thesafishy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views37 pages

Random Code Script

The document is a discussion between users about creating a script that displays a random code to users when they visit a webpage. The conversation covers the use of cookies to ensure that each user only sees their assigned code once, and the need for server-side code to manage user accounts securely. The participants also discuss the challenges of implementing this system using different programming languages, specifically PHP and ASP.

Uploaded by

thesafishy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 37

Web Developer Menu Search Login / Sign up

Community / Bookmark

69 Comments(s)
↴ ↴
Random code script
about: ({ changelog recent_tips
version
@tims15 version tipper @phpnovice
social notes: 0
tipped
Jun 06.2005 Jun 06.2005 — #
}); },{ amount
version },{
You could set a cookie that would
legal: ({ notes: tipper
I need a script that would show a
terms: },{ tipped perform either function, but the visitor
privacy
random version
code when the page is loaded amount could clear their cookies and you
analytics notes: },{ would be back to square-one. The
(codes
}); would be preset
},{ by me). Each tipper
code can only be shownversion
to a user once tipped only other solution is to use server-
(v important). When thenotes:
page is amount side code and a database.
})... })...
refreshed, or visited at a later date by
reply?
the same person who has already
requested a code, I would need the code
to either be the same, or have a
message saying they have already
requested a code (this isn’t as
important). @tims15 author
0
Jun 07.2005 — #

A cookie would be great, as even if


Sign in to post a comment the user did clear their cookies they
wouldn't really gain anything.

reply?

Filed under: #JavaScript

@phpnovice
0
Jun 07.2005 — #

OK, you would use code similar to the


following:

var code = getCookie("code");


if (code == null) {
var code = setCode();
var expDate = new Date();
:
var oneDay = 24 * 60 * 60 * 1000;
var oneYear = 365 * oneDay;
expDate.setTime(expDate.getTime() + oneYear);
setCookie("code", code, expDate, "/");
}
alert('Your code is: ' + code);

The following are the cookie functions


to go with that:

function getCookie(name) {
var arg = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var i = 0;
while (i < clen) {
var j = i + alen;
if (document.cookie.substring(i, j) == arg)
return getCookieVal (j);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return null;
}
function getCookieVal(offset) {
var endstr = document.cookie.indexOf (";", offs
if (endstr == -1)
endstr = document.cookie.length;
return unescape(document.cookie.substring(offse
}
function setCookie(name, value) {
var argv = setCookie.arguments;
var argc = setCookie.arguments.length;
var expires = (argc > 2) ? argv[2] : null;
var path = (argc > 3) ? argv[3] : null;
var domain = (argc > 4) ? argv[4] : null;
var secure = (argc > 5) ? argv[5] : false;
document.cookie = name + "=" + escape (value) +
((expires == null) ? "" : ("; expires=" + expir
((path == null) ? "" : ("; path=" + path)) + <
((domain == null) ? "" : ("; domain=" + domain)
((secure == true) ? "; secure" : "");
}
function delCookie(name) {
exp = new Date();
exp.setTime(exp.getTime() - (24*60*60*1000));
var cval = getCookie(name);
cval = (cval == null) ? "" : cval;
document.cookie = name + "=" + cval + "; expire
}

reply?

@tims15 author
0
Jun 08.2005 — #

Thanks for that


:
Each code could only be shown to one
user ie if there were user a, b and c,
and codes 1 and 2, then user A could
go and get code 2, then user B get
code 1, then user C go and get
nothing, for example. Each code could
only be shown to one user. (this
doesn't have to be secure or anything)

Is this like this for the above code?


Sorry for not saying this clearer in the
original post. It looked obvious for me,
but of course wouldn't for other
people.

reply?

@phpnovice
0
Jun 08.2005 — #

In the code I posted, I provided a


function call, [B]setCode()[/B], where
such things would be determined. In
reality, this code determination needs
to be made via server-side code. The
client doesn't know anything about
other clients. Only the server can
know this. The indicated function call
could be used for invoking the
XmlHttpRequest object to obtain such
a code from the server. The function
call could also be replaced by a string
where server-side code makes a
variable replacement at request time -
- such as the following replacement
line to the code originally posted:

var code = "<%=SetCode()%>";

Then again, if you're making the


determination via server-side code,
then you don't need a cookie at all.
:
The alert I originally provided, as a
demo, could just as easily be coded
as follows:

alert("<%=SetCode()%>");

reply?

@tims15 author
0
Jun 13.2005 — #

So what would the code be that I need


to put in the web page (I know nothing
about JavaScript!)

reply?

@phpnovice
0
Jun 13.2005 — #

Well, the server-side code I showed is


ASP. Do you have the availability of a
server-side language?

reply?

@tims15 author
0
Jun 13.2005 — #

Just shows how much I know!

Unfortuantely I can't use ASP, only


PHP, CGI and SSI.

reply?
:
@phpnovice
0
Jun 13.2005 — #

This, in ASP:

alert("<%=SetCode()%>");

is this, in PHP:

alert("<?=SetCode()?>");

reply?

@tims15 author
0
Jun 13.2005 — #

But where should I put that in the


code?

reply?

@phpnovice
0
Jun 13.2005 — #

Well, the other part of the question


is... How are you determining the
code to give the visitor?

reply?

@tims15 author
0
Jun 14.2005 — #

It'll just be about cve different codes


of about four words. They'll need to
preset by me

reply?
:
@phpnovice
0
Jun 14.2005 — #

OK, how do you identify the user?

reply?

@tims15 author
0
Jun 14.2005 — #

What it is is that a user will submit


their sign up details via a form and it
will be emailed to me. I then have an
autoresponder that will tell them the
usual stuff, and to go to a page. They
will go there and receive a random but
preset log in details, (the code), to be
able to log in. That is why it is
important that I can choose the codes
(log in details), and that each user
doesn't get more than one. It isn't a
very sophisticated system, but works
cne for what I want to achieve

reply?

@phpnovice
0
Jun 14.2005 — #

After you get the email and tell them


to go to a certain page... When they
go to that page, how does that page
know who they are? Also, when they
come back to that page, how does
that page know they are the same
person?

reply?
:
@tims15 author
0
Jun 14.2005 — #

It doesn't matter what code they get,


as I'll create 5 (or example) accounts
on my system. I'll then put the log in
details into the script (which is on the
page that they get directed to from
the sign up email). When the users
gets the code, they can log in.

The script will need a cookie or


something to recognise a user to
make sure that if they go back to the
page they either get a message telling
them that they have received their
code, or the same code displayed to
them as the one they were orignally
given. This doesn't have to be secure
or unbreakable as they won't gain
anything from getting two codes.

reply?

@phpnovice
0
Jun 14.2005 — #

Well, you haven't given me enough


information to give you a decnitive
answer. You're just going to have to
cgure this out for yourself. All I can
tell you is that the following will create
a cookie on their system:

<i>
</i>Response.Buffer = True
Response.Cookie("private_code") = private_code
Response.Cookie("private_code").Expires = DateA
Response.Cookie("private_code").Path = "/"
:
and the following will test for the
cookie when they return:

<i>
</i>If Len(Request.Cookie("private_code") &gt;
Response.Write "&lt;p&gt;Your code is: " &amp;
Else
Response.Write "&lt;p&gt;Your code is: " &amp;
End If

reply?

@tims15 author
0
Jun 15.2005 — #

What other information do you need?

reply?

@phpnovice
0
Jun 15.2005 — #

Is the code I've given you not enough


for you to cgure this out?

reply?

@tims15 author
0
Jun 15.2005 — #

Not really. Any scripting apart from


html and css is past me... ?

reply?

0
:
0
@phpnovice
Jun 15.2005 — #

Oops... I went back and read the


entire thread -- to understand where
we're going -- and found that you said
you couldn't use ASP. Well, the code I
posted above is ASP. But, before I
post any code in PHP...

I still don't have a clear idea of how


the server-side script is supposed to
know which code to initially give to
which visitor.

reply?

@tims15 author
0
Jun 15.2005 — #

The code intially given to the user


doesn't matter, as long as it is one
that I have preset.

What I want to do is open cve


accounts on my website. When the
user signs up, the autoresponder
sends an email to the user, telling
them to go to a page (just to make it
clearer, I'll call it username page).
They then go to the username page,
and get a random username and
password (obviously password has a
relationship with the username, they
aren't randomly put together). They
then can log in. The user details they
get can't be given to a different user,
for obvious reasons. If the user
returns to the username page they
need to either get given the code they
got on their crst visit, or an error
message.

Hope this helps, and isn't too


:
confusing. I've read through it loads of
times, and although obvious to me,
will probably make no sense to
someone else! ?

reply?

@phpnovice
0
Jun 15.2005 — #

I don't understand the mechansim,


yet. But, here's a question... What is
the relationship between the "code"
and the user name and password?
What is the "code" for?

reply?

@tims15 author
0
Jun 15.2005 — #

The code is the username and


password. I just used it before instead
of saying username and password
each time

reply?

@phpnovice
0
Jun 15.2005 — #

Vinny Barbarino: "I'm so confused!" ?

(Welcome Back, Kotter!)

reply?
:
@tims15 author
0
Jun 16.2005 — #

What do you mean? What on?

reply?

@phpnovice
0
Jun 16.2005 — #

Next question... If you're assigning the


user name and password, why do you
want to display it to the visitor? Why
can't they just be required to sign in
with the user name and password that
you've given them?

reply?

@tims15 author
0
Jun 17.2005 — #

Yeah, they'll sign in with the password


that I have given them, but to cnd
what the user details are they have to
go to the page which will have the
script on (username page)

reply?

@phpnovice
0
Jun 17.2005 — #

[I]Vinny Barbarino: "I'm so confused!"


[/I] ?

So, you give them one password so


:
that they can go to a certain page and
get both a user id and another
password? ?

reply?

@tims15 author
0
Jun 17.2005 — #

No, they get an email sending them to


a page where they get the user
details. There is no password to get to
the page.

reply?

@phpnovice
0
Jun 17.2005 — #

OK, so all they have to go on is the


URL of a web page. Correct? So, my
original question still remains... ?
When they go to that URL for the very
crst time, how does the page at that
URL know who they are -- so that the
correct user id and password
information may be given to them and
stored in a cookie?

reply?

@tims15 author
0
Jun 18.2005 — #

It doesn't matter what user details


they get, just as long as no-one else
gets the same one. The cookie is so
that they don't go back to the page
:
and get another user details, and so
log into someone elses account.

reply?

@phpnovice
0
Jun 18.2005 — #

OK, once a user id and password has


been given to one person, how is the
code supposed to prevent giving that
same user id and password to
someone else?

reply?

@tims15 author
0
Jun 18.2005 — #

Thats the thing, the script needs


something to stop that from
happening. I haven't a clue what... ?

reply?

@phpnovice
0
Jun 18.2005 — #

OK, I can handle that part... But,


another question... If two people ask
for user id and password at the same
time, how is the code supposed to
know which one to give which user id
and password?

reply?
:
@tims15 author
0
Jun 19.2005 — #

What do you mean? It doesn't matter


who gets what user details, as long as
the same set of details aren't given to
the same person.

reply?

@phpnovice
0
Jun 19.2005 — #

OK, here ya go:

[code=php]
<?php
$html = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTM
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Language" content="en
<meta http-equiv="Content-Type" content="text/h
<title>User Details</title>
</head>
<body>

';
//
$file = 'user_details.csv'; // master path & fi
$copy = 'user_details.old'; // temporary path &
//
$cookie = 'user_details'; // cookie name
$expire = time() + (365*24*60*60); // cookie ex
//
function fputcsv($fp, $array, $delimiter=',')
{
$line = '';
foreach($array as $val):
$val = str_replace("rn", "n", $val);
if(is_numeric($val)):
$line .= $val . $delimiter;
else:
$line .= '"' . str_replace('"', '""', $val) . '
endif;
endforeach;
$line = substr($line, 0, (strlen($delimiter) *
return fwrite($fp, $line);
}
//
if(isset($_COOKIE[$cookie])):
$html .= '<p>' . $_COOKIE[$cookie] . "</p>n";
else:
if(!file_exists($file)):
$html .= '<p>User details file not found.</p>'
else:
@unlink($copy);
// search user file for available details
:
$fp = fopen($file, "r");
while($user = fgetcsv($fp, 35)):
if(!isset($user[2])
|| $user[2] == 0):
break;
endif;
endwhile;
fclose($fp);
//
endif;
//
if(!isset($user[0])
|| !isset($user[1])
|| (isset($user[2]) && $user[2] != 0)):
$html .= '<p>Sorry, no user details available.<
else:
if(!rename($file, $copy)):
$html .= '<p>Unable to rename user details file
else:
$delcopy = true;
// update file to flag user details as taken
$fc = fopen($copy, "r");
$fp = fopen($file, "w");
while($data = fgetcsv($fc, 32)):
if($data[0] == $user[0]
&& $data[1] == $user[1]):
$data[2] = 1;
endif;
if(!fputcsv($fp, $data)):
$html .= '<p>User details update failed.</p>' .
$delcopy = false;
break;
endif;
endwhile;
fclose($fp);
fclose($fc);
//
if($delcopy):
$str = "User name: {$user[0]}, password: {$user
setcookie($cookie, $str, $expire, '/');
$html .= '<p>' . $str . "</p>n";
unlink($copy);
endif;
endif;
endif;
endif;
//
$html .= '
</body>
</html>
';
echo $html;
?>
[/code]

This code is tested and works


perfectly on my site. You just need to
supply a well-behaved CSV cle format
where each cle line contains at least a
user name and password delimited by
a comma. The code takes care of the
rest.

reply?
:
@tims15 author
0
Jun 19.2005 — #

Thanks very much for that. What do i


need in the CSV cle, and... um... how
do I make it?

reply?

@phpnovice
0
Jun 19.2005 — #

Surely you know how to create and


edit a text cle. As for content...

username1,password1

username2,password2

username3,password3

etc.

Maximum of 12 characters for user


name and 12 characters for password
-- or some combination thereof.

NOTE: I just increased the record


length in the code above so that you
can have up to 12 characters each.

reply?

@tims15 author
0
Jun 19.2005 — #

Yeah, sorry I do. Thet heat must be


getting to me...
:
I take it it needs to be called
'user_details.csv' and just uploaded to
my server?

reply?

@phpnovice
0
Jun 19.2005 — #

You can call the cle anything you like.


Just make sure the [b]$?le[/b]
variable is set to the matching path
and cle name. ? Otherwise, yes, just
create it and upload it to your server in
a place where the script can cnd it. To
add more to the cle, be sure to
download it crst -- since the script
does place updates into the cle.

reply?

@tims15 author
0
Jun 20.2005 — #

where/how should I put the path?

ie, where it says [B]$?le [/B] does it


need to say something like
'maindirectory/subdirectory/user_details.csv'?

reply?

@phpnovice
0
Jun 20.2005 — #

Yes, that is correct -- except there is


not normally a name for the site root
:
directory (as far as the server is
concerned). Thus, you'd be looking
more at something like:

$cle =
'/subdirectory/user_details.csv';

The starting slash normally signices


the root folder.

reply?

@tims15 author
0
Jun 20.2005 — #

Thanks, that parts working now.

The only other problem I have ? is that


it has an error saying

Parse error: parse error, unexpected


T_VARIABLE in
/home/tims15/public_html/userid.php
on line 15

Line 15 is

$copy = 'user_details.old' // temporary


path & cle name

I have changed the path and cle name


around a bit but it doesn't work. What
cle name and path needs to go there?

reply?

@phpnovice
0
Jun 20.2005 — #

Notice the difference between what


you posted and the original line in
:
what I posted.

Otherwise, the value of that variable


should be the same as the [b]$?le[/b]
variable

except to change the [b].csv[/b] cle


extension to a [b].old[/b] cle
extension.

reply?

@tims15 author
0
Jun 20.2005 — #

I've done that but the error message


still comes up. Does a
user_details.old cle need to be
created?

reply?

@phpnovice
0
Jun 20.2005 — #

Notice the difference between what


you posted and the original line in
what I posted.

reply?

@tims15 author
0
Jun 21.2005 — #

I thought I did, but on looking closer


saw the fatal error!

Thanks very much for your help and


:
for doing the code, its exactly what I
wanted!

reply?

@phpnovice
0
Jun 21.2005 — #

Yep, those semi-colons will getcha


every time. ?

reply?

@tims15 author
0
Jun 22.2005 — #

lol ?

reply?

@tims15 author
0
Jul 03.2005 — #

Would you be able to modify the


above code, to give someone who
visits the page a number code,
(something like 4536), and work
exactly the same way?

If its to much bother don't worry, but


thanks anyway!

reply?

0
:
0
@phpnovice
Jul 03.2005 — #

Do you mean instead of this CSV cle


content:

username1,password1

username2,password2

username3,password3

etc.

accept this CSV cle content instead?

usercode1

usercode2

usercode3

etc.

reply?

@tims15 author
0
Jul 03.2005 — #

Is that all thats needs to be changed,


the path and cle name of the CSV and
the contents of the CSV?

reply?

@phpnovice
0
Jul 03.2005 — #

No, I was just asking if that is the


format you're wanting to use?

reply?
:
@tims15 author
0
Jul 04.2005 — #

Oh. Yes it is!

reply?

@phpnovice
0
Jul 04.2005 — #

First, remove all references to


[b]$user[1][/b] and [b]$data[1][/b]

Then, change all references to


[b]$user[2][/b] and [b]$data[2][/b]

to be references to [b]$user[1][/b] and


[b]$data[1][/b]

reply?

@tims15 author
0
Jul 04.2005 — #

I think I did what you said, bu I got the


error message

Parse error: parse error,


unexpected T_VARIABLE in
/home/tims15/public_html/untitled.php
on line 67
[/QUOTE]

The code I had was


:
<?php

$html = '<!DOCTYPE HTML


PUBLIC "-//W3C//DTD HTML 4.01
Strict//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<meta http-equiv="Content-
Language" content="en-us">

<meta http-equiv="Content-Type"
content="text/html; charset=iso-
8859-1">

<title>User Details</title>

</head>

<body>

';

//

$cle = 'user_details.csv'; // master


path & cle name

$copy = 'user_details.old'; //
temporary path & cle name

//

$cookie = 'user_details'; // cookie


name

$expire = time() + (365*24*60*60);


// cookie expiration

//
:
function fputcsv($fp, $array,
$delimiter=',')

$line = '';

foreach($array as $val):

$val = str_replace("rn", "n", $val);

if(is_numeric($val)):

$line .= $val . $delimiter;

else:

$line .= '"' . str_replace('"', '""', $val) .


'"' . $delimiter;

endif;

endforeach;

$line = substr($line, 0,
(strlen($delimiter) * -1)) . "n";

return fwrite($fp, $line);

//

if(isset($_COOKIE[$cookie])):

$html .= '<p>' . $_COOKIE[$cookie]


. "</p>n";

else:

if(!cle_exists($cle)):

$html .= '<p>User details cle not


found.</p>' . "n";

else:
:
@unlink($copy);

// search user cle for available


details

$fp = fopen($cle, "r");

while($user = fgetcsv($fp, 35)):

if(!isset($user[1])

|| $user[2] == 0):

break;

endif;

endwhile;

fclose($fp);

//

endif;

//

if(!isset($user[0])

|| (isset($user[1]) && $user[1] !=


0)):

$html .= '<p>Sorry, no user details


available.</p>' . "n";

else:

if(!rename($cle, $copy)):

$html .= '<p>Unable to rename


user details cle.</p>' . "n";

else:

$delcopy = true;
:
// update cle to zag user details
as taken

$fc = fopen($copy, "r");

$fp = fopen($cle, "w");

while($data = fgetcsv($fc, 32)):

if($data[0] == $user[0]

$data[1] = 1;

endif;

if(!fputcsv($fp, $data)):

$html .= '<p>User details update


failed.</p>' . "n";

$delcopy = false;

break;

endif;

endwhile;

fclose($fp);

fclose($fc);

//

if($delcopy):

$str = "User name: {$user[0]},


password: {$user[1]}";

setcookie($cookie, $str, $expire,


'/');

$html .= '<p>' . $str . "</p>n";

unlink($copy);
:
endif;

endif;

endif;

endif;

//

$html .= '

</body>

</html>

';

echo $html;

?>
[/QUOTE]

reply?

@phpnovice
0
Jul 04.2005 — #

You made an error when deleting a


line. You didn't move the closing
parenthesis and colon up to the prior
line. Thus, this:

[code=php]if($data[0] == $user[0]
$data[1] = 1;
endif;[/code]

should be this:

[code=php]if($data[0] == $user[0]):
$data[1] = 1;
endif;[/code]
:
Otherwise, you'll also want to change
this line:

$str = "User name: {$user[0]},


password: {$user[1]}";

to this:

$str = "User code: {$user[0]}";

reply?

@tims15 author
0
Jul 05.2005 — #

I no Im being a pain the bum, but do


need to do both things?

If so, this is the code I got but it still


doesn't work.

<?php

$html = '<!DOCTYPE HTML


PUBLIC "-//W3C//DTD HTML 4.01
Strict//EN"

"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<meta http-equiv="Content-
Language" content="en-us">

<meta http-equiv="Content-Type"
content="text/html; charset=iso-
8859-1">

<title>User Details</title>
:
</head>

<body>

';

//

$cle = 'user_details.csv'; // master


path & cle name

$copy = 'user_details.old'; //
temporary path & cle name

//

$cookie = 'user_details'; // cookie


name

$expire = time() + (365*24*60*60);


// cookie expiration

//

function fputcsv($fp, $array,


$delimiter=',')

$line = '';

foreach($array as $val):

$val = str_replace("rn", "n", $val);

if(is_numeric($val)):

$line .= $val . $delimiter;

else:

$line .= '"' . str_replace('"', '""', $val) .


'"' . $delimiter;

endif;
:
endforeach;

$line = substr($line, 0,
(strlen($delimiter) * -1)) . "n";

return fwrite($fp, $line);

//

if(isset($_COOKIE[$cookie])):

$html .= '<p>' . $_COOKIE[$cookie]


. "</p>n";

else:

if(!cle_exists($cle)):

$html .= '<p>User details cle not


found.</p>' . "n";

else:

@unlink($copy);

// search user cle for available


details

$fp = fopen($cle, "r");

while($user = fgetcsv($fp, 35)):

if(!isset($user[1])

|| $user[2] == 0):

break;

endif;

endwhile;

fclose($fp);
:
//

endif;

//

if(!isset($user[0])

|| (isset($user[1]) && $user[1] !=


0)):

$html .= '<p>Sorry, no user details


available.</p>' . "n";

else:

if(!rename($cle, $copy)):

$html .= '<p>Unable to rename


user details cle.</p>' . "n";

else:

$delcopy = true;

// update cle to zag user details


as taken

$fc = fopen($copy, "r");

$fp = fopen($cle, "w");

while($data = fgetcsv($fc, 32)):

if($data[0] == $user[0]):

$data[1] = 1;

endif;

if(!fputcsv($fp, $data)):

$html .= '<p>User details update


failed.</p>' . "n";

$delcopy = false;
:
break;

endif;

endwhile;

fclose($fp);

fclose($fc);

//

if($delcopy):

$str = "User code: {$user[0]}";

setcookie($cookie, $str, $expire,


'/');

$html .= '<p>' . $str . "</p>n";

unlink($copy);

endif;

endif;

endif;

endif;

//

$html .= '

</body>

</html>

';

echo $html;

?>
[/QUOTE]
:
reply?

@phpnovice
0
Jul 05.2005 — #

Yes, you need to do both things.


Describe, "still doesn't work."

reply?

@tims15 author
0
Jul 06.2005 — #

I still get the error

Parse error: parse error,


unexpected T_VARIABLE in
/home/tims15/public_html/untitled.php
on line 67[/QUOTE]

line 67 is

$data[1] = 1;
[/QUOTE]

reply?

@phpnovice
0
Jul 06.2005 — #

Sorry, but I don't see how it is possible


to get that error if you have
[U]actually[/U] coded the following in
:
the page that is [U]actually[/U]
published to your server and you are
[U]actually[/U] trying to execute the
[U]correct[/U] copy of this page:

[code=php]
if($data[0] == $user[0]):
$data[1] = 1;
endif;
[/code]

reply?

@tims15 author
0
Jul 06.2005 — #

What do you suggest? I think I've done


it right. The page its currently on is
[URL=www.bigwowwebhosting.com/untitled.php]here[/URL

reply?

@phpnovice
0
Jul 06.2005 — #

Go post your code in the PHP forum


and ask, there, why it is getting that
error.

reply?

@tims15 author
0
Jul 09.2005 — #

I've worked out why I was getting that


error.

Thanks very much for your help again,


it has been invaluable.
:
reply?

@phpnovice
0
Jul 09.2005 — #

Care to share the solution?

reply?

@tims15 author
0
Jul 10.2005 — #

I don't know what it was- I went


through the original script changing
everything you said to really carefully,
and it worked...

reply?

@phpnovice
0
Jul 10.2005 — #

Cheers.

reply?

@tims15 author
0
Jul 10.2005 — #

reply?
:
Also in #JavaScript

Indexing Question ?

Prompt

Ajax works on one domain; not on another? (perpetual waitmessage)

The web is an endless sea


of information. Don't miss
the boat... Subscribe!

type_your@email.here
:
:

You might also like