php-windows Digest 20 Jan 2003 05:39:54 -0000 Issue 1545 Topics (messages 17974 through 17984):
Re: Subject: cookies problem (FIXED) 17974 by: Chris Kranz Re: Configuration of Apache Server 17975 by: Chris Kranz 17976 by: Scott Carr Re: Configuration of Apache Server - Thanks for advice 17977 by: Craig Smith New guy to PHP Mail Parse question 17978 by: Rafael Alan Bleiweiss 17979 by: Chris Kranz forms, php 17980 by: Adrian Partenie 17983 by: Chris Kranz Apahce Windows problems 17981 by: Sabina A. Schneider How do I review previous FAQs? 17982 by: Marlene Burckhalter Re: arrays and nested arrays and loops and databases... 17984 by: Eric Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] ----------------------------------------------------------------------
--- Begin Message ---surely if headers had already been sent, it would give an error telling you so. In my files, the page is displayed properly, in full, with no errors... but cookies are missing from the server and being sent. chris kranz fatcuban.com -----Original Message----- From: Neil Smith [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 19, 2003 10:19 AM To: [EMAIL PROTECTED] Subject: [PHP-WIN] Re: Subject: cookies problem (FIXED) Well the fact that this fixed it, tends to imply you were outputting some warn level messages before cookies were sent, therefore they weren't : A cookie is a header, and like any HTTP header they must be sent before any other content (even a newline or linebreak can do it). If you pushed any error messages (such as a warning that a variable was not yet defined etc) before sending your cookie or other headers, this would cause your symptoms. HTH Neil Smith. At 03:33 19/01/2003 +0000, you wrote: >Message-ID: <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >From: "Ed" <[EMAIL PROTECTED]> >Date: Sat, 18 Jan 2003 17:03:00 -0600 >Subject: Re: Subject: cookies problem (FIXED) > >It's not a browser problem, as I said in my post php wasn't saving the >cookies. This seems to be a widespred problem after searching many mailing >lists and seeing this problem on every one of them, with no fixes. I had >already changed my path to c:\php\sessions, so that wasn't the problem >either. What finally fixed it was changing this in the php.ini file: > >error_reporting = E_ALL > >To This: >error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR > >Now cookis and sessions work just like they're supposed to. > >Ed -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---Make sure your browsing to the file thru your webserver... http://localhost/test.php and not locally... file://c:/www/test.php for instance... other than this, I've had this problem, but it was configuration errors in httpd.conf. double check everything in here... chris kranz fatcuban.com -----Original Message----- From: Craig Smith [mailto:[EMAIL PROTECTED]] Sent: Saturday, January 18, 2003 5:17 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] Configuration of Apache Server Problem: When trying to open a test.php file containing a simple test php script, windows prompts for program to open file with. Apache is running from the console as opposed to a service. *PHP Installation* PHP version 4.3.0 installed from php-4.3.0-installer.exe. Also downloaded the zip file php-4.3.0-Win32.zip Install directory d:\program files\php Followed details in install.txt file from php install routine. Running from php.exe as opposed to dll. This included copying bundled dll files from zip file to windows\system directory. *MDAC Installation* Installed Microsoft Data Access Components version 2.6 as downloade form Microsoft Website. *Apache Server Installation* Apache Server version 1.3.23 installed. Install directory d:\Program Files\Apache Configured httpd.conf as per details in install.txt . This took account of where php install location. Suspect that the test.php file needs to be in a particular location to be picked up by php. Is where is this defined. Regard Craig Smith -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ---You need to put the file under <apache drive>\Program Files\Apache Group\Apache\htdocs That is the normal path for default apache. -- Scott Carr Documentation Maintainer http://documentation.openoffice.org OpenOffice.org Quoting Chris Kranz <[EMAIL PROTECTED]>: > Make sure your browsing to the file thru your webserver... > > http://localhost/test.php > > and not locally... > > file://c:/www/test.php > > for instance... other than this, I've had this problem, but it was > configuration errors in httpd.conf. double check everything in here... > > chris kranz > fatcuban.com > > > -----Original Message----- > From: Craig Smith [mailto:[EMAIL PROTECTED]] > Sent: Saturday, January 18, 2003 5:17 PM > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] Configuration of Apache Server > > Problem: > > When trying to open a test.php file containing a simple test php script, > windows prompts for program to open file with. Apache is running from > the > console as opposed to a service. > > *PHP Installation* > > PHP version 4.3.0 installed from php-4.3.0-installer.exe. Also > downloaded > the zip file php-4.3.0-Win32.zip > > Install directory d:\program files\php > > Followed details in install.txt file from php install routine. Running > from > php.exe as opposed to dll. > > This included copying bundled dll files from zip file to windows\system > directory. > > *MDAC Installation* > > Installed Microsoft Data Access Components version 2.6 as downloade form > Microsoft Website. > > *Apache Server Installation* > > Apache Server version 1.3.23 installed. > > Install directory d:\Program Files\Apache > > Configured httpd.conf as per details in install.txt . This took account > of > where php install location. > > Suspect that the test.php file needs to be in a particular location to > be > picked up by php. Is where is this defined. > > Regard > > Craig Smith > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > ------------------------------------------------- This mail sent through IMP: http://horde.org/imp/--- End Message ---
--- Begin Message ---Thanks for advice. It turned out to be something simple as you would expect. Browsed using the the path http://localhost/test.php and it worked. Regards Craig Smith "Scott Carr" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You need to put the file under <apache drive>\Program Files\Apache > Group\Apache\htdocs > > That is the normal path for default apache. > -- > Scott Carr > Documentation Maintainer > http://documentation.openoffice.org > OpenOffice.org > > > Quoting Chris Kranz <[EMAIL PROTECTED]>: > > > Make sure your browsing to the file thru your webserver... > > > > http://localhost/test.php > > > > and not locally... > > > > file://c:/www/test.php > > > > for instance... other than this, I've had this problem, but it was > > configuration errors in httpd.conf. double check everything in here... > > > > chris kranz > > fatcuban.com > > > > > > -----Original Message----- > > From: Craig Smith [mailto:[EMAIL PROTECTED]] > > Sent: Saturday, January 18, 2003 5:17 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP-WIN] Configuration of Apache Server > > > > Problem: > > > > When trying to open a test.php file containing a simple test php script, > > windows prompts for program to open file with. Apache is running from > > the > > console as opposed to a service. > > > > *PHP Installation* > > > > PHP version 4.3.0 installed from php-4.3.0-installer.exe. Also > > downloaded > > the zip file php-4.3.0-Win32.zip > > > > Install directory d:\program files\php > > > > Followed details in install.txt file from php install routine. Running > > from > > php.exe as opposed to dll. > > > > This included copying bundled dll files from zip file to windows\system > > directory. > > > > *MDAC Installation* > > > > Installed Microsoft Data Access Components version 2.6 as downloade form > > Microsoft Website. > > > > *Apache Server Installation* > > > > Apache Server version 1.3.23 installed. > > > > Install directory d:\Program Files\Apache > > > > Configured httpd.conf as per details in install.txt . This took account > > of > > where php install location. > > > > Suspect that the test.php file needs to be in a particular location to > > be > > picked up by php. Is where is this defined. > > > > Regard > > > > Craig Smith > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > ------------------------------------------------- > This mail sent through IMP: http://horde.org/imp/--- End Message ---
--- Begin Message --- Hi everyone - new to PHP , Cold Fusion background...
I've got a client with a mail form on their site that needs to be posted to an email account and it doesn't work he asked me to look at it... it's on Windows and the form has fields like this:
first_name
last_name
dayphone_1
dayphone_2
dayphone_3
mortgage_past_due
reason_for_applying
In the PHP process page that he sends the form to I think it's a simple problem but it sends an email but the fields are left blank - what's wrong with the following code?
<?php
mail("[EMAIL PROTECTED]","Web Site Application","
hey, a form:
first name: $first_name
last name: $last_name
day phone: $day_phone_1 $day_phone_2 $day_phone_3
--------------------------
Is Your Mortgage Current Or Past Due: $mortgage_past_due
Reason for Applying: ---------------------------
$reason_for_applying
------------------------------------------------
","From: [EMAIL PROTECTED]\n");
header("location:form_submitted.html\n");
?>
--- End Message ---
--- Begin Message ---Make sure you have global variables set on in your php.ini If you can't change this, then try doing $_POST['variable name'] to get the form fields... Unless your submitting your form using GET ofcourse, then use $_GET chris kranz fatcuban.com -----Original Message----- From: Rafael Alan Bleiweiss [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 19, 2003 6:01 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] New guy to PHP Mail Parse question Hi everyone - new to PHP , Cold Fusion background... I've got a client with a mail form on their site that needs to be posted to an email account and it doesn't work he asked me to look at it... it's on Windows and the form has fields like this: first_name last_name dayphone_1 dayphone_2 dayphone_3 mortgage_past_due reason_for_applying In the PHP process page that he sends the form to I think it's a simple problem but it sends an email but the fields are left blank - what's wrong with the following code? <?php mail("[EMAIL PROTECTED]","Web Site Application"," hey, a form: first name: $first_name last name: $last_name day phone: $day_phone_1 $day_phone_2 $day_phone_3 -------------------------- Is Your Mortgage Current Or Past Due: $mortgage_past_due Reason for Applying: --------------------------- $reason_for_applying ------------------------------------------------ ","From: [EMAIL PROTECTED]\n"); header("location:form_submitted.html\n"); ?> -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php--- End Message ---
--- Begin Message ------ End Message ---
Hello,
The code below outputs the errors:
Notice: Undefined index: submit in login.php on line 19
Notice: Undefined index: username in on line 20
Notice: Undefined index: password in on line 21
In rest works fine. Register_globals are on. What I'm doing wrong?Thanks, Adrian
?php
echo "
<form method=post action=""
<br>
<b>name:</b><br><input type=\"text\" name=\"name\"><br>
<b>password:</b><br><input type=\"text\" name=\"password\"><br>
<input type=\"submit\" name=\"submit\" value=\"Submit\"> ";
$submit = $_POST['submit']; //line 19
$username = $_POST['username']; //line 20
$password = $_POST['password'];
if ($submit)
{
$result=mysql_connect("localhost", $username, $password) or die("Invalid username or password");
//printf("Succesfully conected");
if
($result){
echo "<td><a href="">;
}
}
?>
</body>
</html>
--- Begin Message ---For starters. $username = $_POST['username']; in your form, you declare name, not username is this code you've given from the page login.php? is it simply submitting to itself? chris kranz <http://www.fatcuban.com/> fatcuban.com -----Original Message----- From: Adrian Partenie [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 19, 2003 10:41 PM To: [EMAIL PROTECTED] Subject: [PHP-WIN] forms, php Hello, The code below outputs the errors: Notice: Undefined index: submit in login.php on line 19 Notice: Undefined index: username in on line 20 Notice: Undefined index: password in on line 21 In rest works fine. Register_globals are on. What I'm doing wrong? Thanks, Adrian ?php echo " <form method=post action=/login.php> <br> <b>name:</b><br><input type=\"text\" name=\"name\"><br> <b>password:</b><br><input type=\"text\" name=\"password\"><br> <input type=\"submit\" name=\"submit\" value=\"Submit\"> "; $submit = $_POST['submit']; //line 19 $username = $_POST['username']; //line 20 $password = $_POST['password']; if ($submit) { $result=mysql_connect("localhost", $username, $password) or die("Invalid username or password"); //printf("Succesfully conected"); if ($result){ echo "<td><a href=\"main_page.html\">Database</a></td>"; } } ?> </body> </html>--- End Message ---
--- Begin Message ---I am writing to you to report a problem, which I haven't found in the FAQs and errors. I have installed Apache 1.3.27 for Windows, with PHP4 and Mysql 1.4 and when I try to see a page, that contains sessions there appears an error- window that says that Windows closes Apache, because it has genereted a problem. I search in the Apache logs but nothing appears. I've followed the php code that I've generated and the problem is where the script tris to register a variable. I attach here my php.ini that I'm using in C:\Winnt .Thank you very much for your help and time. Sabina Alejandra Schneider [EMAIL PROTECTED]--- End Message ---
--- Begin Message ---I lost some of my e-mails due to a computer problem. My initial e-mail from lists.php.net was in the batch lost. Can someone please tell me how I can search the old FAQs? I need to do some research. Thanks, Marlene--- End Message ---
--- Begin Message ---Dear sir, I'am Eric I have the same question about this. But what if does will this the final $to[] array will contains all of address and name data. but the address bar should not be hold if a large number of address presents. Is that have any suggestions?? Thanks yours tarn@hk ----- Original Message ----- From: "Dash McElroy" <[EMAIL PROTECTED]> To: "H Marc Bower" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Sunday, January 19, 2003 11:33 AM Subject: Re: [PHP-WIN] arrays and nested arrays and loops and databases... > If I understand correctly, you want to have an array containing an array > with people's email address and name from your db like this: > > $to[0]['address'] = [EMAIL PROTECTED] > $to[0]['name'] = Bob Smith > $to[1]['address'] = [EMAIL PROTECTED] > $to[1]['name'] = John Jones > > (the above is obviously not valid PHP...) > > I would do something like this: > > $to = array(); > $query = "select email, fullname from tablename where updateannounce = 1"; > $result = mysql_query($query); > while ($output = mysql_fetch_array($result)) { > $to[] = array('address' => $output['address'], > 'name' => $output['name']); > } > > assuming, of course, that your database column names are 'address' and > 'name'. > > This should work, but I may have borked something up on the name based > arrays. > > -Dash > > "The pyramid is opening!" > "Which one?" > "The one with the ever-widening hole in it!" > -- Firesign Theater, "How Can You Be In Two Places At > Once When You're Not Anywhere At All" > > On Sat, 18 Jan 2003, H Marc Bower wrote: > > > Well... I can usually puzzle myself through these things, but I figured > > it's time to ask the list. :) It may be a simple thing that I'm missing, > > but here's what I have. > > > > The structure that I'm trying to modify is as follows: > > > > $to = array( > > array( > > 'address'=>'[EMAIL PROTECTED]', > > 'name'=>'Bob Smith' > > ), > > array( > > 'address'=>'[EMAIL PROTECTED]', > > 'name'=>'John Jones' > > ) > > ); > > > > That said, I have a database of names and email addresses which I want to > > insert into this structure, but in a loop since I don't want to have an > > array() section for each one, not knowing how many are going to be in the > > list at the time this script is run. I want to loop the 'sub' array() > > statements so that I can build up the main array(). I use mysql as follows: > > > > $query = "select email, fullname from tablename where updateannounce = 1"; > > $result = mysql_query($query); > > while ($output = mysql_fetch_array($result)) > > { > > //This is where I want the loop of arrays to appear, so I can > > dynamically insert the email and fullname fields into the obvious spots > > } > > > > > > I need to figure out how to do this, essentially: > > > > $to = array(<loop to fill other array() statements>); > > > > I don't know how to get that loop to work inside the overall array() > > statement, though... any assistance would be greatly appreciated. > > > > Thank you, > > > > Marc > > > > > > > > -- > > PHP Windows Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >--- End Message ---