> He was showing you a neatly formatted query, the example applies to
> inserts too:
>
> $sql = "
> INSERT INTO
>tablename
>(
> field1,
> field2,
> field3
>)
> VALUES
> (
> '$blah',
> $here
ok query is fixed for the second one now... now to work on the
if(!empty.. tests
i have to check and make sure every one of those arrays isnt empty.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"MINE:
$sql = "
SELECT
name
, age
, height
, etc
FROM user
WHERE
name = '$name'
AND height = '5'";"
um...im not doing selects im doing inserts with variable names... i
understand the idea with
"two things i would recommend before disecting your code.
1. write readable queries.
GOOD:
$sql = "
SELECT
name
, age
, height
, etc
FROM user
WHERE
name = '$name'
AND height = '5'";
2. alway
hi...
i have 2 mysql queries
first one:
//the extra { at the beginning and the extra , at the end of
//each variable should be an '...
"insert into $EventsTable values(NULL, '{$_SESSION[add][type]}',
'{$_SESSION[add][start_date]}', '{$_SESSION[add][end_date]}',
'{$_SESSION[add][name]}', '{$
i have something like this:
if(!empty($_SESSION['add']['start_date']) &&
!empty($_SESSION['add']['end_date'])..)){
and i get the unexpected error:
notice:use of undefined constant: add-assumed 'add' in (filename).
dont quite understand why that is since i used other code that i have
"date() expects a UNIX timestamp. MMDDHHMMSS is NOT a UNIX timestamp.
So,
instead of converting the UNIX timestamp to MMDDHHMMSS in your function,
why not leave it a UNIX timestamp? Then you can send it through date()
whenever you want it formatted.
"
yea...it works now...hmmm... dont know
>
> Replace the above two lines with
>
> $time = date('YmdHis', mktime(0,0,0,$month,$day,$year);
>
ok the function works now because when i echo the output of
$_SESSION['add']['start_date'] it shows the right 14 digit timestamp for the
date i wanted to create... now the problem is getting it to ec
i have the function i made:
function CreateDate($day, $month, $year) {
if(!empty($day) && !empty($month) && !empty($year)){
//convert $day, $month, and $year into a valid timestamp
$time= strtotime($day, mktime(0,0,0,$month,1,$year));
$time=date("YmdHis", $time);
return $time; }
else {
return false
how would you assign NULL to a variable if its original value is ""? otherwise leave
it with its value...
the form im working on has a date field called "date" on the form itself. that "date"
will get turned into $_SESSION[add][date] on the next page...
i want it so if the person filling out the
> $sql = "INSERT INTO x VALUES ({$_SESSION['add']['name']} ";
>
> oh, and unless add & name are actually constants you should always wrap
> them in single quotes. (php will covert the non-exstent constant into a
> string a issue an E_NOTICE + its overhead)
well that got me on the right track..
hi...
i cant cut and paste my exact mysql query because it takes the '' stuff out doubles
the $'s and the ,'s in the whole thing (dont know why but anyways...)...
i have a query that goes something like this:
mysql_query("insert into $GuestbookTable values(NULL, '$_SESSION[add][date]',
'$_SESSIO
if you need to turn the result of mktime() into a valid mysql timestamp
format then put these 2 lines in your code when needed:
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"On my personal machine the return value is:
1081026000"
interesting... i got 1081054800 from mine with the code:
even on cli it gives the same thing
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"There are two problems there. First, your session data is not getting
cleared. Second, it is not getting reset with the new values.
For the former, in guestbook_save.php you can simply do a session_unset
(if you really want to clear all of them). However this does not
handle an abnormals equen
"Okay, start showing some code so we can see wtf is going on. Constantly
posting back "nope", "doesn't work" is just going to have us grasping at
straws again and again.
Is register globals on or off?
"
register_globals=off
here is the code that gives me problems:
files are attached (if allowed)
"When someone pulls up a form and fills it out, they subsequently submit
that
form. When submitting a form your browser creates a one on one connection
with the server where the server inputs the data from your form before or
after the next person without mixing the two. (no matter if the two
sub
"Use the session_* functions then.."
still does nothing at all or it does the same as session_destroy. and that
forces a user back to the login screen right in the middle of an sql
insert/update
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub
"Umm.. Use $_SESSION for that.."
wish i could but it wont work for the server that its going to run
onthey still use php4.0.4pl1 believe it or not
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
"$HTTP_SESSION_VARS = array();"
doesnt work... it kills the session and forces me to login as soon as the
array is empty
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
how would you empty all the contents of $HTTP_SESSION_VARS when you dont need them
anymore but still keep the current session running? the problem seems to be that when
i try to fill them with something else (dont need the original values anymore) but
need new ones without destroying the session
> > is there any way to keep multiple users using the same form from mixing
up
> > variables
>>I have no idea what you mean here.
if user #1 logs in and starts using a form and then user #2 logs in and
starts using the same one as user #1, say by chance they submit it at the
same time... is there
"htmlentities(), also.
Other wise the value could have a double quote within it and a malicious
user could effectively "end" your input text box and inject their own HTML."
is there any way to keep multiple users using the same form from mixing up
variables
--
PHP General Mailing List (http://
tnx that works now
- Original Message -
From: "Mark" <[EMAIL PROTECTED]>
To: "Andy B" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, April 04, 2004 11:32 AM
Subject: Re: [PHP] php as default "value" in html
>
> --- Andy
hi...
i have the following html line:
accesskey="d"
id="id-referred">
the php variable $old['Referred'] was pulled from a mysql table. the full string that
this variable holds is "I work for you..." but when used as a default value in an
input text field for html the only part that shows up in
hi...
i have a combo box that is filled with a query from an sql table...
this is its logic:
if $_SESSION['guestbook'] doesnt exist
then query database, fill $_SESSION['guestbook'] with its values from the db, turn the
"value" part of the into the values from $_SESSION['guestbook']['Number'] an
hi...
i have the following code and i need to check to see if $_SESSION['guestbook'] has
been assigned to the session yet. if it has then use its values to create the combo
box...if it hasnt then run the sql query and assign it to the session as well as fill
the combo box with it... any ideas h
hi...
i know this is a little ot but in an attempt to keep viruses off the list (i think)
somebody/something is forging an email in my name to the php mailing list as well as
mysql mailing list along with a few others. i get a message something like this:
"your message titled: submit your authe
is it ok practice to put code like the code to put results from an mysql query into a
combo box into an include file and then just include it wherever its needed? the code
i can see would have to be used at least 5 times in the same page
figured out how to do the $_SESSION multi dim arry thing...
"$_SESSION['guesbook'] = $arr;"
is it safe to say that i can do this:
while($_SESSION['guestbook']=mysql_fetch_array($query)) to get the same
thing as $_SESSION[guestbook]=$R??
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hi...
i need to assign an array to $_SESSION. the reason for this is that i have a page that
gets data from 2 different tables from the same mysql db all at the same time... there
is guestbook (for the guestbook) and events (for the events section). i guess i would
need to know 2 things:
1. can
"$HTTP_* aren't superglobals and are not available inside functions"
that i know of i didnt use them inside functions unless checking them with
if(!empty($HTTP_SESSION['username'])){. is illegal...? if that is so
then no wonder why it didnt work
--
PHP General Mailing List (http://www.ph
"Note: Superglobal arrays, like $_POST and $_GET, became available in PHP
4.1.0"
so i remembered... had to try and port it backwards to fit the $HTTP_POST
and $HTTP_SESSION vars but still didnt work... for some reason they arent
going from page to page but got something else worked out for now in
hi
I created a login script and originally was using php4.3.3 to write the script with.
Then I found out that it had to be rewritten for php4.0.4pl1. I think when rewriting
it for the older version it got messed up somehow and cant quite spot the
error/problem in it. can anybody help here??
the
rking correctly.
Andy
-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 31, 2004 10:55 AM
To: Andrew Hauger; [EMAIL PROTECTED]
Subject: Re: [PHP] File Download link not working in PHP 4.3.4
Check the comments on this page:
http://us2.php.net/manu
===
This message is for the benefit of new
subscribers and those new to PHP. Please
feel free to add more points and send to the
list.
===
1. If you have any queries/problems about PHP
try
http://www.php.net/manual/en
first. Y
"I don't use colour in emails to this (or any) list, sorry. I would
have hoped the screen reader said "asterisk asterisk highlighted""
all i heard it say was *** on the line that said something like
"***highlighted..." but thats whas only when you referrenced to you
highlighted the stuff... an
"I **highlighted** the relevant part for you :)"
i know what you mean... if you highlighted the part you were talking about
with color then would explain why i didnt get what part you were talking
about... my screen reader doesnt pay much attention to color highlights so
probably missed it...
sor
"$count = mysql_result($rows, 0, 'count');"
i guess that would work too if all you need is the # of rows in a table...
if you need it in an array then...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Hi...
Is there any way to find say the third monday of the month (all months of the year)
for any year (up to 2038) and show them in a combo box as exact dates? Have been
trying to get something of the sort to work and havent quite figured out how thats
supposed to work yet. I tried strtotime
how would you go about making a selected item in a combo box??
Jan
Feb
Mar
for example on the combo box above how would i make the default select item mar
instead of jan??
"Hmmm, have you ever actually tried it? And got the result you wanted?"
my screwup...forgot some code here... heres the whole thing that actually
works...(thats what you get for being in tons of different windows at the
same time)...
--
PHP General Mailing List (http://www.php.net/)
To unsubscr
"select count(*) from tablename"
actually i would do:
$rows=mysql_query("select count(*) from tablename");
echo $rows;
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
im lost i keep getting messages from a [EMAIL PROTECTED] saying none of my messages
can be sent because they time out?? but its usually 12 hours or more after my post was
already sent to the list that i get those...im confused..anybody know whats going on??
just a short one here... what would be the best type of field for a combo box that
looks like this:
---pick a month---
January
February
and the same thing with the year...
was thinking either int(2) for the month and int(4) for the year but would enum(1, 2,
3, 4...12) be better for the
"Define "better"."
1. check the file size. if it is larger than a certain size then rename the
current log and roll over to a new filename
2. if something fatal happens during normal program use shutdown the
program/website section and display a page that says unavaliable or
something of that sort
is it better overall to write a custom file wrapper (write my own log functions) or
use the error_log/syslog that php already gives??
hi...
just wondering if anybody had problems with messages to the list timing out and
getting sent back to them?? i seem to be getting this problem lately (last 2-3 days)
and have about 20 copies of the same message being sent back to me by postmaster...
permenant failure: message timed out
"Absolutely fascinating, I have never seen a MySQL server behave like
this. Could you post which version of MySQL you're using and perhaps
the MySQL part of phpinfo()? There must be something *somewhere* that
controls this behaviour."
PHP Version 4.0.4pl1
Linux noir.propagation.net 2.0.36 #5 Wed D
valid and that is all it's checking."
hmmm interesting... in your example of usernames here, when i type andy for
username and mysql for password it says "valid user". now say i type andy
for a username and junk for a password it will now say "error?" because in
mysql
"Do you actually need to bring back the user data? What I mean is,
you're selecting * from the users table and doing nothing with it other than
worrying if the query was successful or not."
ops!! I forgot to mention that the username is used elsewhere in a different
file somewhere (to verify the s
So, just for the sake of me getting this right, it would be better code if i
had the code like this:
forgive the odd severely long redundant example names but... im sure that is
better than what i had before...
let me know if i got the right idea...
and $UserExists in this example is either tr
[snip]
please note this will only catch invalid queries. To catch the event
of the query being perfectly fine, but nothing coming back, just check
the values of num_rows or affected_rows (depending on the query).
[/snip]
um?? this way doesnt work for some strange reason... testing
affected_ro
hi!!
tnx for the help with that huge problem... got it running and this is how...
the query ...username='...' and pwd=md5(...) was in "" and i guess when you have
something like that putting '' in an index name is illegal?? can somebody explain why?
and on the line: if(.) {...
num_of_rows(
ok now this is really messed up something strange (maybe my server is
haunted with a ghost or something??). I changed the variables to have the ''
in the indexes and stuff (got rid of the notices problem) but when i totally
removed the header(""); lines and put echo "test login worked" and echo
"te
>What happens if you give a the correct ones?
doesnt make any difference... will take the display_errors thing and turn it
on...
do i have to pay any attention to something of this sort:
[notice] undefined variable in ../login.php: $_SESSION[username] is
undefined
but i defined it alrea
>What do mean by "keeps getting stuck"? Where? What? Any error
>messages?
0 errors and 0 messages of any kind and what i meant by getting stuck was
every time the login.html is filled out and submitted i either get the
login.html page again (expected if user gave wrong pwd and stuff) or browser
wi
hi...
still having login problems..
i tried just about everything i can think of to get this to work but for some strange
reason it keeps getting stuck...
[code]
Login failed";
header("location: login.html"); }
else {
$_SESSION[username]=$username;
header("location: deletepost.php"); }
?>
[/code
hi...
trying to figure out what is wrong here... the code is supposed to check an md5'd
password from a form and compare it against an md5'd password in a mysql table... for
some strange reason when i run the code below on my dev server (apache 2.0.47,
php4.3.3 and mysql 4.1-A) it works. when i
tnx for the ideas... that helped some for now anyways... i will get to
writing the spec outline for what i want/need to do and post it (might be a
few hours) or a day or so since i have to create it (and it could be quite
large)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vi
[snip]
in either case, are there any specific questions you have? it's possible
that there aren't any login system tutorials that meet your requirements
and that's why there haven't been many responses yet. but what do i
[/snip]
questions...hmmm... cant think of any questions at the minute but i d
[snip]
also, were you looking for code or general guidelines?
[/snip]
more importantly is the code so i can see how it is physically written but
both code and guidelines wouldnt hurt at all...
tnx for the link in last msg will check it out
--
PHP General Mailing List (http://www.php.net/)
To un
hi...
dont mean to bring up the subject again...but does anybody know of a real good login
system tutorial that uses sessions/php4/sessions?? looked at google and found some but
dont know how good they really are (the comments on some of them are really bad)...
tnx
[snip]
Then do what I did, the script below is only an example..
--snip--
[/snip]
will test it and play with it a little but will it let the admin go from a
login required part of the site to a public/free access part of the site
i.e. jump out of the session without losing any currently open ses
[snip]
session_start();
$_SESSION = "user";
$_SESSION = "pass";
This doesn't work of course, but as I said I'm unsure of how the $_SESSION
superglobal is used, and the info I've found about it didn't shed much
light... I hope I'm just tired today 8-)
Another semi-related question is, is it common
[snip]
You can use the HTTP Authentication instead for username and password.
[/snip]
no i cant this time because the people want the login form to follow their
color setup and stuff and with www-authenticate: box you cant do that...so
for this project its out of the question...
--
PHP General M
[snip]
There is no way to inject any kind of data to the super-global Arrays at all
[snip]
duhhh...how come i didnt think of that... well..guess its long nights
without coffee.. tnx...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
hi
in an attempt to create a login system for site administrators on a website i come
into the following problem that bothers me because i cant find any way to fix it.
problem:
most login scripts/systems i look at for examples on how to make a login section from
sessions (allow the administrato
> although that'll generally "work", why not use
>
> if(empty($name) || empty($comments))
> { dosomething(); }
>
> --
> ---John Holmes...
because for some odd reason on any of the versions of php i am writing for
(4.0.6-4.1.3) it always fails
--
PHP General Mailing List (http://www.php.net/)
T
was just wondering if the statement:
if(!$name || !$comments){
/*whatever here*/ }
would be interpreted as : if either $name or $comments doesn't exist then
or how would the if statement be?? i need to check if the $name and $comments are
empty/null because both $name and $comments are requi
you've already got that unique identifier. it's the username. the
username will stay unique visit to visit, therefore you don't need to go
against the design of the session id. the session id is not meant to
keep uniqueness across multiple visits, only the current visit.
are we/me misunderstanding
What are the chances of two people getting the same session number in a
thousends of day operation?
When you down the size of that to a couple hundeed a day...
WHy do we need to have a session name for that?
because eventually i want to take the user name (session name/variables/user
info) and cre
as long as your usernames are unique you should never have a problem.
(assuming everything else works as planned.)
it should...
i want to use sessions for a login system and stuff too but i want it to
check to see if the person is logged in before going to the login section...
if the session isnt
[snip]
If you give the session a custom name, then, yes, you'll have to use that
name on every page. $name can be something that in an include file or a
constant, etc, though. Again, you don't _have_ to give a name, though.
There's no real advantage to using another name, though, as it's going to b
>From what I understand about sessions you can give a session a particular name like
>doing:
session_start("SessionName");
So in practicle means I can do this:
now my question is this: will i have to declare session_start($name); at the top of
every file that needs to use that session name? o
> remember: best way is how its above (using sessions or forms) , because
> will work in most php installations.
tnx will try sessions and see what they do... (havent quite played with them
before but will figure it out)...
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, vi
hi
was needing to know how to create a confirm page.
I have a form that needs to be submitted to a confirm page before it is dropped into a
mysql db. was not sure how to do this without losing the content of the form
variables...
was just wondering if php will work inside a CSS level 2 style sheet?? for example:
input#name {
display: none }
input#name {
font-family: Arial, serif;
font-size: 12pt;
color: blue;
background-color: transparent;
. }
register_globals = On
-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 13, 2004 10:18 AM
To: Andy Lewis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] multipart/form-data and Array POST
Andy Lewis wrote:
>Hello All,
>
>I'm ha
I am running:
$my_array = unserialize(base64_decode($my_array));
on the array once it's POSTed.
-Original Message-
From: Raditha Dissanayake [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 13, 2004 10:18 AM
To: Andy Lewis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] multipart/form
I'm trying to pass an array of values. Then retrieve it on the next
page.
-Original Message-
From: Brian V Bonini [mailto:[EMAIL PROTECTED]
Sent: Saturday, March 13, 2004 9:58 AM
To: Andy Lewis
Cc: PHP Lists
Subject: Re: [PHP] multipart/form-data and Array POST
On Sat, 2004-03-13
Hello All,
I'm having a problem including an array in a hidden field for file
upload.
My first question is, can this be done? Can I actually include an array
in a hidden field on a POSTed PHP upload field?
If so do I have to encode the array. I use array's on my site and am
aware that I have
and just how do i run the attached file ?? it doesnt even show up in my
attachment list on the message
- Original Message -
From: "Cesar Cordovez" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 1:55 PM
Subject: Re: [PHP] Notify about yo
strtotime('third saturday', strtotime('1 jan 2005'));
strtotime('third saturday', mktime(12, 0, 0, 1, 1, 2005));
yea thanks... now i can figure out most of the other stuff i need (at least
for now anyways)
will probably use the mktime way since i can always use variables from a
combo bo
You'd want something more like this for the format:
echo date("l F j Y", $time);
but for me, this caused the following output
Saturday June 27 2009
doesn't seem right somehow :/
i know i wonder if i have the strtotime("third saturday january 2005");
written all wrong or something.
makes me t
hi.
i found strtotime and it seems to work but not quite sure if i know how to use it
right...
here is my code:
i wanted it to take the third saturday of next year (2005) and say do this: saturday
january 24?? 2005 for the output. All I get for the output though is
sat/june/20092009?? I'm sor
Hi.
I am creating a section of a site (events system) that will post different events in
the area. Part of the form has the date the events starts. The fields in question are:
day of month the event starts, the month the event starts, day of the month the event
ends and month event ends. the pr
just checking to see if i got on the list right...you can ignore
This might help:
http://pear.php.net/package/Image_IPTC
Andy
> -Original Message-
> From: Paul Furman [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 12, 2004 7:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: IPTC image comments utility
>
> OK this looks l
.
Regards,
Andy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
0.05
I would have expected to get an answer of 0 i.e. no remainder. It works fine
for whole numbers.
Can any one shed any light on this please?
Thank you.
Regards,
Andy
P.S. I tried using the following function but I get the same results:
function fmodAddOn($x,$y)
{
$i = floor($x/$y);
x27;], 20);;
if ($add == 'Hello')
do something
where clean() is a function defined in an include as follows:
function clean($input, $maxlength)
{
$input = substr($input, 0, $maxlength);
$input = EscapeShellCmd($input);
return ($input);
}
Hope that helps.
Regards,
Andy
"Labuns
Hi Gerard,
Thank you for your assistance you have been of enormous help.
Regards,
Andy
"Gerard Samuel" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 27 December 2003 10:54 am, Andy Higgins wrote:
>
> > 1. At the time of login will the log
Hi Mark,
Thank you for confirming that for me. I am new to the list and did do a
search though past messages but did not find this point (obvioulsy I did not
look hard enough).
Thanks again.
Regards,
Andy
"Mark Charette" <[EMAIL PROTECTED]> wrote in message
news:
be
logged that they will have to log in again?
3. For forms, where the SID need to be passed, do you pass this as a hidden
form variable or do you do it on the URL?
You help is greatly appreciated.
Thanks again.
Regards,
Andy
"Gerard Samuel" <[EMAIL PROTECTED]> wrote in mes
Hi Aniruddha,
Try using
session_start();
$HTTP_SESSION_VARS['session_referer'] = "abc.com";
and
if (session_is_registered('session_referer'))
go to abc.com;
Regards,
Andy
"Aniruddha" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
&g
login i.e. will it be possible for some one to hijack the login if this
check is not there? Or does anyone have any other suggesstions for doing
authentication?
Thank you.
Regards,
Andy
"Andras Kende" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> -Original M
see
if they are logged in is done.
Any help that could be supplied would be greatly appreciated.
Thank you.
Regards,
Andy
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
One quick thought:
You might want to add the following to your if statement:
else {
$this->_cache[$key] = new $key;
return $this->_cache[$key];
}
Andy
> -Original Message-
> From: Gerard Samuel [mailto:[EMAIL PROTECTED]
> Sent: Monday, October 06, 20
301 - 400 of 780 matches
Mail list logo