Re: [PHP-DB] converting scripts for register_globals=Off

2004-04-29 Thread jeffreyb
If you have already have a number of scripts and, especially, if you are doing 
things with the variables inside the script (in other words, the variables 
appear more than once), it can be more convenient to convert at the top of 
each page, eg:

$id = $_REQUEST['id'];
$this = $_REQUEST['this'];
$that = $_SERVER['that'];

etc...

Jeffrey  Baumgartner

Date sent:  Thu, 29 Apr 2004 11:40:14 +0200
From:   Kim Jacobs (Crooks) - Mweb 
[EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject:[PHP-DB] converting scripts for register_globals=Off

 if any of you could help me out, I would greatly appreciate it... I am
 an absolute beginner to php (2 weeks now) and dont know what I dont
 know...
 
 I have written some scripts to access my online SQL db and I've tested
 the scripts on my machine with PHP 4.3.6 and register_globals = On Now
 where I host my site, uses PHP 4.3.5 and has register_globals = Off
 which means of course, that my scripts arent working, but I dont know
 why
 
 My question is, how do I convert my scripts so that they will work
 please? I know that $id and $submit are two of the 'inputs' that it
 doesnt like, but I dont know the rest
 
 Tx
 K
 
  
 MWEB: S.A.'s most trusted and reliable Internet Service Provider. Just
 Like That. 
 
 To join, go to: http://join.mweb.co.za or call 0860032000.
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Uploads conspiracy or curiosity?

2004-03-08 Thread jeffreyb
I am puzzled.

I have built a php script to upload a document to a directory and save the info 
in an MySQL table. 

I created a sample document in OpenOffice and saved it as a .doc file. 

When I access the page via an Opera browser, I can upload the file without 
problem. 

When I access the page via MS Explorer, the document simply does not 
upload. There are no error messages. However, if I attempt to upload 
another file type, such as a PDF, Explorer uploads it without problem. 

In doing this, I recall some curious behaviour with Explorer uploading 
OpenOffice documents saved as OpenOffice documents in the past. 

If I were conspiracy minded, I'd suspect that this is MS's way of discouraging 
use of OpenOffice. In any event, I am curious to know what is causing this.

Thanks,

Jeffrey Baumgartner

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] method question

2003-12-17 Thread jeffreyb
 I am looking to create a comp-time calculator of sorts using
 PHP/MySQL.  I am still in the learning process of how all of this
 works.  I want to be able to create a web interface where my employee
 can login and enter her comp-time as she works extra.  I also want to be
 able to have an admin side where I can subtract her comp-time as she
 takes it and keep a running total of her remaining time.  My question is
 - do you do the math in PHP or do you do it in MySQL.  I am new to this
 type of logic so any input would be helpful.  I am sure that there is a
 script like this that already exists but I want to try this one myself
 for the learning factor.
 thanks,
 DF
 
 -- 
You can do the maths with either, although I find PHP easier. 

The thing to bear in mind is that MySQL saves the data so you can call it up 
again in other queries. Data in PHP, on the other hand, is gone as soon as 
you leave the page or end the session. So, it is important to design a 
programme that leaves the data you want to save in MySQL. 

With that in mind, it is normally easy to see where the maths should be done.  

Good luck,

Jeffrey Baumgartner

www.ungodly.com
more fun than a visit to the dentist (almost)

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Problem with mail()

2003-12-04 Thread jeffreyb
I have an if statement which includes two mail() functions. Curiously, the second one 
works, 
in that it results in e-mails being received. But the first doesn't - and I cannot for 
the life of me 
figure out why.

The code is below. It is part of the final sequence for registering for an on-line 
brainstorming 
session. $email is a session variable and I know it is working (as it is in the from 
field of the 
second e-mail).

code

if ($sequencer == 3){
$email_message=Dear $name $surname: \n\n
Your BrainStorm session has been set up. Once payment has been received, you can 
access your session at 
http://www.jpb.com/sylvia/brainstorm.php?brainstorm_id=$brainstorm_id. \n\n
Alternatively, you can go to http://www.jpb.com/sylvia/, click on the BrainStorm link 
and enter 
the BrainStorm session number: $brainstorm_id. \n\n
You may invite up to $invites participants to join you. If they have not BrainStormed 
with 
Sylvia before, recommend they visit at least ten minutes prior to the session in order 
to 
register and read the instructions. \n\n
Also be sure you forward the URL and/or BrainStorm session number to participants so 
that 
they can join you. \n\n
If you have any comments, please feel free to send them to us by replying to this 
e-mail. \n\n
Sylvia Automatic Reply;
  
mail($email,Your Sylvia BrainStorm session information,$email_message,From: 
[EMAIL PROTECTED]);

if ($invite == yes){  
foreach($bs_email as $key = $emailgetter){

$mail_message=Dear $bs_name[$key] $bs_surname[$key]: \n
$name $surname has invited you to participate in a brainstorming 
session on: \n
$issue 
(BrainStorm session number: $brainstorm_id) 
on $bs_date at $bs_time. \n

Please confirm via e-mail or telephone your ability to participate. 
If you have not used Sylvia BrainStorm before, please visit 
http://www.jpb.com/sylvia/ to familiarise yourself with the system. 
On the day of the BrainStorm session, please log on to Sylvia, 
click on \BrainStorm\ and enter the BrainStorm session number above.\n
This is an automatic message generated by Sylvia web based BrainStorming 
software for $name $surname. \n\n;

mail($emailgetter,Invitation to participate in web based BrainStorm 
session,$mail_message,From: $email);
}
}
etc...
}

/code

Many thanks,

Jeffrey Baumgartner

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Nevermind [was: [PHP-DB] Problem with mail()]

2003-12-04 Thread jeffreyb
Forget my post of a few moments ago - sudenly, it is working. Must be 
gremlins in the server. 

Sorry for the wasted bandwidth.

Jeffrey Baumgartner


From:   [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Date sent:  Thu, 04 Dec 2003 20:34:26 +0100
Priority:   normal
Subject:[PHP-DB] Problem with mail()

 I have an if statement which includes two mail() functions. Curiously, the second 
 one works, 
 in that it results in e-mails being received. But the first doesn't - and I cannot 
 for the life of me 
 figure out why.
 
 The code is below. It is part of the final sequence for registering for an on-line 
 brainstorming 
 session. $email is a session variable and I know it is working (as it is in the from 
 field of the 
 second e-mail).
 
 code
 
 if ($sequencer == 3){
 $email_message=Dear $name $surname: \n\n
 Your BrainStorm session has been set up. Once payment has been received, you can 
 access your session at 
 http://www.jpb.com/sylvia/brainstorm.php?brainstorm_id=$brainstorm_id. \n\n
 Alternatively, you can go to http://www.jpb.com/sylvia/, click on the BrainStorm 
 link and enter 
 the BrainStorm session number: $brainstorm_id. \n\n
 You may invite up to $invites participants to join you. If they have not 
 BrainStormed with 
 Sylvia before, recommend they visit at least ten minutes prior to the session in 
 order to 
 register and read the instructions. \n\n
 Also be sure you forward the URL and/or BrainStorm session number to participants so 
 that 
 they can join you. \n\n
 If you have any comments, please feel free to send them to us by replying to this 
 e-mail. \n\n
 Sylvia Automatic Reply;
 
 mail($email,Your Sylvia BrainStorm session information,$email_message,From: 
 [EMAIL PROTECTED]);
 
 if ($invite == yes){  
   foreach($bs_email as $key = $emailgetter){
 
 $mail_message=Dear $bs_name[$key] $bs_surname[$key]: \n
 $name $surname has invited you to participate in a brainstorming 
 session on: \n
 $issue 
 (BrainStorm session number: $brainstorm_id) 
 on $bs_date at $bs_time. \n
 
 Please confirm via e-mail or telephone your ability to participate. 
 If you have not used Sylvia BrainStorm before, please visit 
 http://www.jpb.com/sylvia/ to familiarise yourself with the system. 
 On the day of the BrainStorm session, please log on to Sylvia, 
 click on \BrainStorm\ and enter the BrainStorm session number above.\n
 This is an automatic message generated by Sylvia web based BrainStorming 
 software for $name $surname. \n\n;
 
 mail($emailgetter,Invitation to participate in web based BrainStorm 
 session,$mail_message,From: $email);
 }
 }
 etc...
 }
 
 /code
 
 Many thanks,
 
 Jeffrey Baumgartner
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP-DB] Sessions and input form

2003-11-24 Thread jeffreyb
Dear Aleks:

What I usually do for a situation like this is...

1) User fills out form and data is INSERTed into the table. If you use 
auto_increment for the row id, use PHP's mysql_insert_id to get the id and 
use this for step 2.

2) Page confirms data by SELECTing the data from the MySQL table and 
inserting it into the form. 

3) If the user makes changes, it is UPDATEd in the MySQL table.

I hope this is clear.

Good luck,

Jeffrey Baumgartner

 Hi all,
 
 I have a form that when populated and submitted is entered into a MySQL dB.
 What I would like to do is be able to present the submitter with a
 confirmation page listing the information from the form and then ask them to
 confirm their submission. Also, if there is a problem or want to change
 something, they can use the browser back button to go to the previous page and
 make corrections.
 
 At first I thought that using Sessions to add the form values would allow this
 to work.. I have gone threw this twice since last night and find that my logic
 is flawed... It works once... then when another submissions is attempted the
 process hangs and returns a CGI timeout.
 
 I am by no means a newbie but obviously I am not doing something right with
 regards to session use. So I ask you more knowledgeable then I for your input
 and advise. In hind sight I think my problem is that once the information is
 confirmed and supposed to be entered into the dB I am not destroying the
 session... Like I said, I think my approach is all wrong here. I already have
 a login routine that uses sessions and works flawlessly..[at least in
 appearance].
 
 Any help would be very much appreciated.
 
 TYIA
 
 Aleks
 
 -- 
 PHP Database Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php