php-general Digest 22 Jun 2002 23:21:07 -0000 Issue 1421

Topics (messages 103391 through 103431):

Nested Menu Help
        103391 by: webmaster.tececo.com
        103399 by: César Aracena

Re: Cc / Bcc don't work on win2k but on linux???
        103392 by: Christoph Grottolo
        103394 by: Lance

header() and explorer
        103393 by: Nightshade
        103405 by: Chris Shiflett

Re: [PHP-DB] Re: Emulating HTTP File Uploads
        103395 by: Ruprecht Helms

Re: mailing list program?
        103396 by: Bruce Karstedt
        103397 by: Devrim GUNDUZ

PHP as a proxy to an htaccess protected site.
        103398 by: Josepablo Pérez -  PHP  -

When are Form Variables Null?
        103400 by: Al Baker
        103406 by: Chris Shiflett

Current date & time in MySQL datetime format
        103401 by: Phil Schwarzmann
        103402 by: Rasmus Lerdorf
        103409 by: John Holmes
        103410 by: Austin Marshall

array_reverse
        103403 by: Alexander Mclean III
        103404 by: Julie Meloni

checkboxes
        103407 by: M.E. Suliman
        103408 by: Austin Marshall
        103428 by: David Freeman

Anyone have slides for an Intro to PHP Class?
        103411 by: John Holmes
        103414 by: SP
        103416 by: John Holmes
        103420 by: Chris Shiflett
        103421 by: Chris Shiflett

UPDATE mysql
        103412 by: Phil Schwarzmann
        103413 by: Austin Marshall
        103418 by: John Holmes
        103422 by: Chris Shiflett
        103424 by: Julie Meloni

PLEASE HELP-Unable to get off this list
        103415 by: r.no7.biz
        103417 by: r.no7.biz
        103419 by: r.no7.biz
        103423 by: r.no7.biz
        103425 by: Chris Shiflett
        103426 by: Jason Wong
        103427 by: r.no7.biz

Get difference between strings.
        103429 by: David Duong

cookies
        103430 by: Paul O'Neil

is there a function like javascript's window.open in PHP
        103431 by: Burak Delice

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 ---
When I am in page A (or one of it's children) I wish to show it's one level of children like so:
 
Page A
  Child 1
  Child 2
  etc...
Page B
 
When I am in page B (or one of it's children) I wish to show it's one level of children like so:
 
Page A
Page B
  Child 1
  Child 2
  etc...
 
Do you get the picture?
 
I have a db with link url, id, parent id and title
 
does any one know of a simple function or something to do this for one level?
 
I have tried and sort of failed 3 times. And before I keep trying I thought I would ask this group
 
--- End Message ---
--- Begin Message ---
I found a way of doing this in order to show the “home” button when
browsing the site, but not when seeing the home page. What I do, is to
set two menus like this:
 
If ($browse == ‘yes’)
{
            <a href=”index.php”>home</a>
}
<a href=”page1.php?browse=yes”>page 1</a>
<a href=”page2.php?browse=yes ”>page 2</a>
<a href=”page3.php?browse=yes ”>page 3</a>
 
Notice how the links to other pages have the browse=yes set. You could
do something like this by building two menus (A and B) so PHP will read
something like browse=a or browse=b and fetch the right buttons from the
DB using different queries.
 
I know there must be an easier way, but so far, this is what I came with
which suites my needs very well.
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Friday, June 21, 2002 6:13 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Nested Menu Help
 
When I am in page A (or one of it's children) I wish to show it's one
level of children like so:
 
Page A
  Child 1
  Child 2
  etc...
Page B
 
When I am in page B (or one of it's children) I wish to show it's one
level of children like so:
 
Page A
Page B
  Child 1
  Child 2
  etc...
 
Do you get the picture?
 
I have a db with link url, id, parent id and title
 
does any one know of a simple function or something to do this for one
level?
 
I have tried and sort of failed 3 times. And before I keep trying I
thought I would ask this group
 
JJ Harrison
[EMAIL PROTECTED]
www.tececo.com
--- End Message ---
--- Begin Message ---
Lance wrote:
> cool! 4.3.0dev work like a charm! but is it safe for deployment
> server?
>

No. It's a dev version which has not been going through qa. (We're using it
on an intranet and didn't have any probs until now.)

Christoph

--- End Message ---
--- Begin Message ---
ok. thanks for the info. guess i have to wait till it hit stable version 
before deploying it on live server. for now, it's byebye to 
CC/BCC/Attachments.

thanks again.

lance

Christoph Grottolo wrote:
> Lance wrote:
> 
>>cool! 4.3.0dev work like a charm! but is it safe for deployment
>>server?
>>
> 
> 
> No. It's a dev version which has not been going through qa. (We're using it
> on an intranet and didn't have any probs until now.)
> 
> Christoph
> 

--- End Message ---
--- Begin Message ---
Hi there, I've read that explorer has a bug when a form post data to 
another page that calls header() function. Any idea to avoid this?
Tnx in advance jonny
--- End Message ---
--- Begin Message ---
The only problem I know of with IE and using the header() function is 
when you use the header function like this:

header("Location: http://www.php.net/";);

IE will correctly realize that it needs to make a second request (GET, 
no matter what type of request the original was), but it fails to 
include any cookie information in this second request.

To solve this, I have read where people use relative URLs instead of 
full (even though this goes against the HTTP definition) such as this:

header("Location: ./index.html");

This may have little to do with whatever problem you are experiencing, 
but if it's the "Location" header with IE that is giving you trouble, 
this is worth trying just to see if it is a workaround for you. Most 
other browsers I have tried (Galeon, Konqueror, Opera, Netscape, lynx) 
will correctly interpret the relative URL as well, and only lynx 
complains. :)

Chris

Nightshade wrote:

>Hi there, I've read that explorer has a bug when a form post data to 
>another page that calls header() function. Any idea to avoid this?
>Tnx in advance jonny
>
>  
>


--- End Message ---
--- Begin Message ---
>> I use fopen() to open remote php scripts using the GET method for non-file
>> uploads but it doesnt work with HTTP POST or file uploads.
>>
>> Does anyone have any ideas?
> 
> http://www.php.net/manual/en/ref.curl.php

php consits of a ftpfunction to put files on a webserver without
any cgi-like methodhandling.

Regards,
Ruprecht

----------------------------------------------------------------------
Ruprecht Helms  -   IT-Service, Internet, Softwareentwicklung
======================================================
E-Mail: Ruprecht Helms <[EMAIL PROTECTED]>
Date: 22-Jun-02
Time: 14:54:40
======================================================
Homepage:     http://www.rheyn.de 
email:             [EMAIL PROTECTED]

Phone + Fax  +49[0]7621 16 99 16


This message was sent by XFMail 
--------------------------------------------------------------------
--- End Message ---
--- Begin Message ---
Try majordomo or ezmlm, neither are PHP dependent.

Bruce Karstedt
President
Technology Consulting Associates, Ltd.
Tel: 847-735-9488
Fax: 847-735-9474


-----Original Message-----
From: savaidis [mailto:[EMAIL PROTECTED]]
Sent: Saturday, June 22, 2002 3:08 AM
To: PHP list
Subject: [PHP] mailing list program?



Is there any mailing list prorgam for Linux server? I want to have text
import possibility of addresses.


Thanks

Makis


--- End Message ---
--- Begin Message ---

Hi,

I suggest you to use ecartis, which is really powerful and easy to 
install.

www.ecartis.org

Best regards,

Devrim.
 
> -----Original Message-----
> From: savaidis [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 22, 2002 3:08 AM
> To: PHP list
> Subject: [PHP] mailing list program?
> 
> 
> 
> Is there any mailing list prorgam for Linux server? I want to have text
> import possibility of addresses.
> 
> 
> Thanks
> 
> Makis
> 
> 
> 
> 

-- 

Devrim GUNDUZ

[EMAIL PROTECTED]
[EMAIL PROTECTED]

Web : http://devrim.oper.metu.edu.tr
-------------------------------------


--- End Message ---
--- Begin Message ---
Hello folks,

Iam trying to make a script that you give it the login and password for 
a determined password protected site, and it logs you in. It will be 
like a proxy.

So, what I have is something like this:

<?
$fp = fopen ("http://
$login:$[EMAIL PROTECTED]/protected_area/index.html", "r");
while (!feof ($fp)) {
    $buffer = fgets($fp, 4096);
    echo $buffer;
}
fclose ($fp);
?>

So now.. here I have two problems:
1.) If the user enters a login/pass that is not the correct this 
appears on the screen hundreds of times:

"Warning: Supplied argument is not a valid File-Handle resource .."

2.) /protected_area/index.html is a frame site, which means that if the 
pass/login are ok it will show you only the index.html, but this is 
made of frames, so then I have another login prompt for the frames.

My question is, is there anyway I can fix problem 1, and in problem 2 
is there anyway to proxy this in a better way, where you input the 
login once and it stay there so i dont get any more login prompts?
--- End Message ---
--- Begin Message ---
Hi,

I've been wondering the behavior of browsers and POST submissions..
basically I'd like to know the behavior of:
is_null(), empty(), and isset().

I've found that sometimes when an item is not filled out, the variable
is still set on the subsequent page, like $_POST['var'] = "";

What does everyone use to see if forms were submitted correctly?

I built my own function:
function form_exists($variable)
{ 
        if (strlen($variable) < 1)
        {
                return false;
        } else {
                return true;
        }
}

It was the only apparent way I could know *for sure* that independent of
the browser, I knew what the heck was being submitted.

Thoughts?

Thanks,
Al


-- 
This email was sent with Ximian Evolution.

--- End Message ---
--- Begin Message ---
Al,

This depends entirely on your browser actually, as it is the one sending 
form variables back to the server in a POST request. Luckily, browsers 
are very consistent with how they handle this. :)

Off the top of my head (I might be forgetting some form field types):

text fields - always set
drop downs - always set
radio buttons - will not be set if no radio box was selected
checkboxes - will not be set if no checkbox was checked

The best way to test this (always best to make sure rather than trust a 
stranger on a mailing list, heh) would be to create a page with every 
type of form field you can think of and submit it to a PHP page where 
you loop through and output every variable in $_POST.

As for the functions you mention, is_null() checks to see if the 
variable has a null value, which I believe is never the case for form 
fields (someone correct me if I'm wrong). The function empty() is the 
same check as ( == "") and will be true for text fields where the user 
did not enter anything. The isset() function will let you know if a 
variable exists at all. For the case of a single checkbox in a form 
fields, the variable will be set if it was checked, and it will not be 
set if the box was not checked.

Chris

Al Baker wrote:

>Hi,
>
>I've been wondering the behavior of browsers and POST submissions..
>basically I'd like to know the behavior of:
>is_null(), empty(), and isset().
>
>I've found that sometimes when an item is not filled out, the variable
>is still set on the subsequent page, like $_POST['var'] = "";
>
>What does everyone use to see if forms were submitted correctly?
>
>I built my own function:
>function form_exists($variable)
>{ 
>       if (strlen($variable) < 1)
>       {
>               return false;
>       } else {
>               return true;
>       }
>}
>
>It was the only apparent way I could know *for sure* that independent of
>the browser, I knew what the heck was being submitted.
>
>Thoughts?
>
>Thanks,
>Al
>
>
>  
>


--- End Message ---
--- Begin Message ---
I want to produce the current date & time in a MySQL datetime format
that I can then put into a MySQL database.

How do I do this?  I've tried mktime() and getdate() but it's not
working.

Thanks!!
--- End Message ---
--- Begin Message ---
Use the date() function.

On Sat, 22 Jun 2002, Phil Schwarzmann wrote:

> I want to produce the current date & time in a MySQL datetime format
> that I can then put into a MySQL database.
>
> How do I do this?  I've tried mktime() and getdate() but it's not
> working.
>
> Thanks!!
>

--- End Message ---
--- Begin Message ---
Use NOW() in your query...

INSERT INTO table VALUES (NOW()),'John');

---John Holmes...

> -----Original Message-----
> From: Phil Schwarzmann [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, June 22, 2002 12:56 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Current date & time in MySQL datetime format
> 
> I want to produce the current date & time in a MySQL datetime format
> that I can then put into a MySQL database.
> 
> How do I do this?  I've tried mktime() and getdate() but it's not
> working.
> 
> Thanks!!

--- End Message ---
--- Begin Message ---
Phil Schwarzmann wrote:
> I want to produce the current date & time in a MySQL datetime format
> that I can then put into a MySQL database.
> 
> How do I do this?  I've tried mktime() and getdate() but it's not
> working.
> 
> Thanks!!
> 

If you want to do it with mysql (i.e. insert the current time) use NOW() 
(the mysql function) for example INSERT INTO foo (date) VALUES (NOW())

--- End Message ---
--- Begin Message ---
I have problem with array_reverse.

I just want to call info from my MySQL / db / table / and display the 
info in reverse.

here is a sample of the code:

<HTML>
<?php 
$db = mysql_connect("localhost", "root", ""); 
mysql_select_db("learndb",$db); 
$result = mysql_ query("SELECT * FROM personnel",$ db); 
echo "<TABLE BORDER=2>"; 
echo"<TR><TD><B>Full Name</B><TD><B>Nick 
Name</B><TD><B>Options</B></TR>"; 
while($myrow = mysql_fetch_array($result)) 
{ 
echo "<TR><TD>".$myrow["firstname"]." 
".$myrow["lastname"]."<TD>".$myrow["nick"]; 
echo "<TD><a href=\"view.php?id=".$myrow[id]."\">View</a>"; 
} 
echo "</TABLE>"; 
?> 
</HTML>

This would echo  info by the order of the "id".

Help?



Alexander McLean III
Designer / Developer / Illustrator
AM3 Design
am3design.com
[EMAIL PROTECTED]
--- End Message ---
--- Begin Message ---
AMI> This would echo  info by the order of the "id".

I  would recommend doing that in your SQL, unless you're doing other
special processing.

// for ascending order
SELECT * FROM personnel ORDER BY id ASC

// for descending order, aka reverse
SELECT * FROM personnel ORDER BY id DESC


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20

--- End Message ---
--- Begin Message ---
Hi

I know this might be a bit easy for all you experts out there.  I have
multiple checkboxes and text areas in a form.  In the confirmation email
sent to the user I manage to get the text areas to display in the email.
How would I get the results of the  checkboxes to to display as well?

Thanks in advance

Mohamed



--- End Message ---
--- Begin Message ---
M.E. Suliman wrote:
> Hi
> 
> I know this might be a bit easy for all you experts out there.  I have
> multiple checkboxes and text areas in a form.  In the confirmation email
> sent to the user I manage to get the text areas to display in the email.
> How would I get the results of the  checkboxes to to display as well?
> 
> Thanks in advance
> 
> Mohamed
> 
> 
> 

checkboxes are like any other input, yo ugive them a name and optionally 
a value, and if they are selected when the form is sent then the 
variable is set (usually to "on") or given the value that you assign it.

For example: <input type="checkbox" name="foo" value="bar"> would yield 
$_REQUEST['foo']=="bar" in the script.  Checkboxes can also use arrays, 
which usually prove to be more useful. i.e. <input type="checkbox" 
name="foo[apple]"> and <input type="checkbox" name="foo[banana]">

Anyways, to display it in HTML it's <?=$_REQUEST['foo']?> or echo 
$_REQUEST['foo']; depending on how you do things.  You can also use the 
$_POST or $_GET vars and accomplish the same thing depending on the 
mehtod you use or if register globals are on then it's just $foo;

--- End Message ---
--- Begin Message ---

 > I know this might be a bit easy for all you experts out 
 > there.  I have multiple checkboxes and text areas in a form.  In the 
 > confirmation email sent to the user I manage to get the text areas to
display 
 > in the email. How would I get the results of the  checkboxes to to
display as well?

Here is a page I wrote to explore form processing.  It has a simple form
on it that includes each type of form element (except file upload) and
displays back all input.  It can also be used as a form target and it
will tell you what form elements were submitted.

It was written some time ago and I haven't updated it for the latest
version of PHP so it will most likely require register_globals to be on.

-----8<-----
<html>
<head>
    <title>OQI - CGI Reflector</title>
</head>
<body bgcolor="#F5F5F5" text="#000000" link="#000099" vlink="#6600CC">

<?

if ($HTTP_POST_VARS)
{
    echo "<h1 align=\"center\"><font face=\"Arial,Helvetica\">CGI
Reflector</font></h1>\n";
    echo "<center><font face=\"Arial,Helvetica\" size=2>\n";
    echo "Here are the results of the form that you have just
submitted:\n";
    echo "</font></center>\n";

    echo "<center><table width=500 border=0 cellspacing=5
cellpadding=5>\n";
    echo "<tr>\n";
    echo "<th align=center width=200 bgcolor=\"#D0DCE0\">\n";
    echo "<font face=\"Arial,Helvetica\" size=2>Form Input
Name</font>\n";
    echo "</th><th align=center width=300 bgcolor=\"#D0DCE0\">\n";
    echo "<font face=\"Arial,Helvetica\" size=2>Form Input
Data</font>\n";
    echo "</th>\n";
    echo "</tr>\n";
    while(list($key, $val) = each($HTTP_POST_VARS))
    {
        echo "<tr>\n";
        echo "<td align=center width=200 bgcolor=\"#D0DCE0\">\n";
        echo "<font face=\"Arial,Helvetica\" size=2>$key</font>\n";
        echo "</td><td align=center width=300 bgcolor=\"#D0DCE0\">\n";
        if (is_array($val))
        {
            while(list($sval) = each($val))
            {
                echo "<font face=\"Arial,Helvetica\"
size=2>$sval<br></font>\n";
            }
        } else {
            echo "<font face=\"Arial,Helvetica\" size=2>$val</font>\n";
        }
        echo "</td>\n";
        echo "</tr>\n";
    }
    echo "</table></center>\n";
} else {
    echo "<h1 align=\"center\"><font face=\"Arial,Helvetica\">CGI
Reflector</font></h1>\n";
?>

<form name="FormExample" action="<?=$PHP_SELF?>" method="post">
    <center><table width=500 border=0 bgcolor="D0DCE0" cellpadding=5
cellspacing=0>
    <tr>
        <td width=500 align=center colspan=2 bgcolor="#E5E5E5">
            <font face="Arial,Helvetica" size=3>Test Form</font>
        </td>
    </tr><tr>
        <th width=200 align=right bgcolor="D0D0D0">
            <font face="Arial,Helvetica" size=2>Text</font>
        </th><td width=300 align=left>
            <input type="text" name="TextInput" value="Text Input Text"
size=30 maxlength=50>
        </td>
    </tr><tr>
        <th width=200 align=right bgcolor="D0D0D0">
            <font face="Arial,Helvetica" size=2>Select</font>
        </th><td width=300 align=left>
            <select name="SelectInput">
                <option value="1" selected>First Option</option>
                <option value="2">Second Option</option>
                <option value="3">Third Option</option>
            </select>
        </td>
    </tr><tr>
        <th width=200 align=right bgcolor="D0D0D0">
            <font face="Arial,Helvetica" size=2>Multi-Select</font>
        </th><td width=300 align=left>
            <select name="MultiSelect[]" size=3 multiple>
                <option value="1">First Option</option>
                <option value="2">Second Option</option>
                <option value="3">Third Option</option>
                <option value="4">Fourth Option</option>
                <option value="5">Fifth Option</option>
            </select>
        </td>
    </tr><tr>
        <th width=200 align=right bgcolor="D0D0D0">
            <font face="Arial,Helvetica" size=2>Check Box</font>
        </th><td width=300 align=left><font face="Arial,Helvetica"
size=2>
            <input type="checkbox" name="CheckBox1" value="1">Check Box
1<br>
            <input type="checkbox" name="CheckBox2" value="2">Check Box
2
        </font></td>
    </tr><tr>
        <th width=200 align=right bgcolor="D0D0D0">
            <font face="Arial,Helvetica" size=2>Radio Button</font>
        </th><td width=300 align=left><font face="Arial,Helvetica"
size=2>
            <input type="radio" name="RadioButton" value="1">Radio
Button 1<br>
            <input type="radio" name="RadioButton" value="2">Radio
Button 2
        </font></td>
    </tr><tr>
        <th width=200 align=right bgcolor="D0D0D0">
            <font face="Arial,Helvetica" size=2>Text Area</font>
        </th><td width=300 align=left><font face="Arial,Helvetica"
size=2>
            <textarea name="TextArea" width=30 rows=4>Default
Text</textarea>
        </font></td>
    </tr><tr>
        <td width=500 align=center colspan=2 bgcolor="#E5E5E5">
            <input type="submit" name="Submit" value="Submit Form">
            <input type="reset" name="Reset" value="Reset Form">
        </td>
    </tr>
    </table></center>
</form>

<?
}
?>

</body>
</html>
----8<-----


--- End Message ---
--- Begin Message ---
Does anyone have a presentation that I could use for an introduction to
PHP programming class? I've got an application that I want to bring some
more developers in on, but I'll need to teach them PHP and MySQL. I want
to give some classes to teach them the basics, and then we can learn
through actual programming from there. Does anyone have a presentation
like this? My audience will be people that have an HTML knowledge and
possibly a c/c++ introduction. Thanks for any help.
 
---John Holmes.
--- End Message ---
--- Begin Message ---
Here's a bunch of slide shows

http://conf.php.net/



-----Original Message-----
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: June 22, 2002 2:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Anyone have slides for an Intro to PHP Class?


Does anyone have a presentation that I could use for an introduction to
PHP programming class? I've got an application that I want to bring some
more developers in on, but I'll need to teach them PHP and MySQL. I want
to give some classes to teach them the basics, and then we can learn
through actual programming from there. Does anyone have a presentation
like this? My audience will be people that have an HTML knowledge and
possibly a c/c++ introduction. Thanks for any help.
 
---John Holmes.

--- End Message ---
--- Begin Message ---
Sorry, I should've mentioned I had looked over those. I may take bits and
pieces from those. Was just wondering if anyone had anything else. something
that follows the manual, for example? This is a variable, this is an IF
loop, this is how you do a file upload, etc...

---John Holmes...
----- Original Message -----
From: "SP" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, June 22, 2002 3:03 PM
Subject: RE: [PHP] Anyone have slides for an Intro to PHP Class?


> Here's a bunch of slide shows
>
> http://conf.php.net/
>
>
>
> -----Original Message-----
> From: John Holmes [mailto:[EMAIL PROTECTED]]
> Sent: June 22, 2002 2:36 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Anyone have slides for an Intro to PHP Class?
>
>
> Does anyone have a presentation that I could use for an introduction to
> PHP programming class? I've got an application that I want to bring some
> more developers in on, but I'll need to teach them PHP and MySQL. I want
> to give some classes to teach them the basics, and then we can learn
> through actual programming from there. Does anyone have a presentation
> like this? My audience will be people that have an HTML knowledge and
> possibly a c/c++ introduction. Thanks for any help.
>
> ---John Holmes.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Those presentations are great.

Also, the source code to power them is available if your browse through 
the PHP CVS tree; I believe it's just called "pres" or something like 
that. That way you can tailor your slide shows to your audience as well 
as present it without having to have a network connection, as you can 
run the whole show from your laptop.

It's a great presentation system. I assume Rasmus wrote it to help ease 
the pains of having so many presentations to give.

Chris

SP wrote:

>Here's a bunch of slide shows
>
>http://conf.php.net/
>

--- End Message ---
--- Begin Message ---
Take those presentations and modify them to fit your needs. I believe 
there is even a "presentation" on how to implement the presentation system.

Chris

1LT John W. Holmes wrote:

>Sorry, I should've mentioned I had looked over those. I may take bits and
>pieces from those. Was just wondering if anyone had anything else. something
>that follows the manual, for example? This is a variable, this is an IF
>loop, this is how you do a file upload, etc...
>
>---John Holmes...
>

--- End Message ---
--- Begin Message ---
I can't get UPDATE to work properly when querying MySQL.

$query = "UPDATE $table SET field1='$var1' WHERE id='$id'";

I want to update one field of one row in a table.  Is this syntax
correct?
--- End Message ---
--- Begin Message ---
Phil Schwarzmann wrote:
> I can't get UPDATE to work properly when querying MySQL.
> 
> $query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
> 
> I want to update one field of one row in a table.  Is this syntax
> correct?
> 

yes

--- End Message ---
--- Begin Message ---
It's correct for PHP, but there's no telling what MySQL is actually
recieving. Are you sure all of those variables have values?? Yeah? Are you
really sure??

Use mysql_error() with your query.

$result = mysql_query("UPDATE ...") or die("Error in update: " .
mysql_error());

---John Holmes...
----- Original Message -----
From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, June 22, 2002 2:44 PM
Subject: [PHP] UPDATE mysql


> I can't get UPDATE to work properly when querying MySQL.
>
> $query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
>
> I want to update one field of one row in a table.  Is this syntax
> correct?
>

--- End Message ---
--- Begin Message ---
Actually, it looks to me like you're missing a semicolon terminating 
your SQL statement. Try this:

$query="update $table set field1='$var1' where id='$id';";

1LT John W. Holmes wrote:

>It's correct for PHP, but there's no telling what MySQL is actually
>recieving.
>----- Original Message -----
>From: "Phil Schwarzmann" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Saturday, June 22, 2002 2:44 PM
>Subject: [PHP] UPDATE mysql
>
>>I can't get UPDATE to work properly when querying MySQL.
>>
>>$query = "UPDATE $table SET field1='$var1' WHERE id='$id'";
>>
>>I want to update one field of one row in a table.  Is this syntax
>>correct?
>>

--- End Message ---
--- Begin Message ---
CS> Actually, it looks to me like you're missing a semicolon terminating 
CS> your SQL statement. Try this:

CS> $query="update $table set field1='$var1' where id='$id';";

Actually, that semicolon is not required (and I think it might even break it).

The user should echo the query as suggested previously, so as to
ensure that values for the variables are all actually there, and being
passed to MySQL.


- Julie

--> Julie Meloni
--> [EMAIL PROTECTED]
--> www.thickbook.com

Find "Sams Teach Yourself MySQL in 24 Hours" at
http://www.amazon.com/exec/obidos/ASIN/0672323494/thickbookcom-20

--- End Message ---
--- Begin Message ---

Hi PPL,

Learning PHP was fun thanks to all of you, you were a big help, I could not have come 
so far without all your comments,suggestions and flames....:-) thanks.

Now I have a differient kind of problem, My mailbox ([EMAIL PROTECTED]) is getting flooded 
and I would like to stop recieveing mail from the list, I have tried unsubscribing a 
number of times without any success as the admin/moderator has blocked my address from 
sending mail to the list, so am using this new email address.....

If any of you have an idea on who the admin is kindly tell him to remove me, he/she 
can send me a confirmation email if needed to prove that "[EMAIL PROTECTED]" is my address 
too, but please ask him/her to remove me asap.

Cheers,
-Ryan.
--- End Message ---
--- Begin Message ---

Hi PPL,

Learning PHP was fun thanks to all of you, you were a big help, I could not have come 
so far without all your comments,suggestions and flames....:-) thanks.

Now I have a differient kind of problem, My mailbox ([EMAIL PROTECTED]) is getting flooded 
and I would like to stop recieveing mail from the list, I have tried unsubscribing a 
number of times without any success as the admin/moderator has blocked my address from 
sending mail to the list, so am using this new email address.....

If any of you have an idea on who the admin is kindly tell him to remove me, he/she 
can send me a confirmation email if needed to prove that "[EMAIL PROTECTED]" is my address 
too, but please ask him/her to remove me asap.

Cheers,
-Ryan.
--- End Message ---
--- Begin Message ---

Hi PPL,

Learning PHP was fun thanks to all of you, you were a big help, I could not have come 
so far without all your comments,suggestions and flames....:-) thanks.

Now I have a differient kind of problem, My mailbox ([EMAIL PROTECTED]) is getting flooded 
and I would like to stop recieveing mail from the list, I have tried unsubscribing a 
number of times without any success as the admin/moderator has blocked my address from 
sending mail to the list, so am using this new email address.....

If any of you have an idea on who the admin is kindly tell him to remove me, he/she 
can send me a confirmation email if needed to prove that "[EMAIL PROTECTED]" is my address 
too, but please ask him/her to remove me asap.

Cheers,
-Ryan.
--- End Message ---
--- Begin Message ---

Hi PPL,

Learning PHP was fun thanks to all of you, you were a big help, I could not have come 
so far without all your comments,suggestions and flames....:-) thanks.

Now I have a differient kind of problem, My mailbox ([EMAIL PROTECTED]) is getting flooded 
and I would like to stop recieveing mail from the list, I have tried unsubscribing a 
number of times without any success as the admin/moderator has blocked my address from 
sending mail to the list, so am using this new email address.....

If any of you have an idea on who the admin is kindly tell him to remove me, he/she 
can send me a confirmation email if needed to prove that "[EMAIL PROTECTED]" is my address 
too, but please ask him/her to remove me asap.

Cheers,
-Ryan.
--- End Message ---
--- Begin Message ---
Go here and do it yourself:

http://www.php.net/mailing-lists.php

[EMAIL PROTECTED] wrote:

>If any of you have an idea on who the admin is kindly tell him to remove me, he/she 
>can send me a confirmation email if needed to prove that "[EMAIL PROTECTED]" is my address 
>too, but please ask him/her to remove me asap.
>
>Cheers,
>-Ryan.
>

--- End Message ---
--- Begin Message ---
On Sunday 23 June 2002 03:39, [EMAIL PROTECTED] wrote:

> Now I have a differient kind of problem, My mailbox ([EMAIL PROTECTED]) is
> getting flooded and I would like to stop recieveing mail from the list, I
> have tried unsubscribing a number of times without any success as the
> admin/moderator has blocked my address from sending mail to the list, so am
> using this new email address.....

Flooding the list with requests to unsubscribe _annoys_ people.

> If any of you have an idea on who the admin is kindly tell him to remove
> me, he/she can send me a confirmation email if needed to prove that
> "[EMAIL PROTECTED]" is my address too, but please ask him/her to remove me asap.

Go and ask yourself! If you had kept/read the welcome message that you should 
have received when subscribing you would have known what to do. Here's some 
selected excerpts:

"Welcome to [EMAIL PROTECTED]!

Please save this message so that you know the address you are
subscribed under, in case you later want to unsubscribe or change your
subscription address."

and

"If you need to get in touch with the human owner of this list,
please send a message to:

    <[EMAIL PROTECTED]>"


Please, if you can't handle a mailing list, don't subscribe!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
"There is hopeful symbolism in the fact that flags do not wave in a vacuum."
--Arthur C. Clarke
*/

--- End Message ---
--- Begin Message ---

Hey there dude,

> Flooding the list with requests to unsubscribe _annoys_ people.
> 

Didnt mean to flood the list, my mail program is giving me a bit of a problem and I 
didnt know if the mail had gone or not.....
 
 
> Go and ask yourself! If you had kept/read the welcome message that you should 
> have received when subscribing you would have known what to do. Here's some 
> selected excerpts:

I still do have to welcome email, the problem like I mentioned in my first email is 
that I have been blocked by the admin/s and cannot send the owner a letter or send the 
unsubscribe email, it just bounces back :-(

I was hoping that one of the admins would see this thread and wipe out [EMAIL PROTECTED]

Cheers,
-Ryan.

****Brazil = NEW football world champions. HURRAH*******
--- End Message ---
--- Begin Message ---
How would I get the difference between strings?

Example:
ViewCVS can browse directories, change logs, and revisions of files. It can
display diffs between versions and show selections of files based on tags or
branches...

This was word for word from sourceforge project ViewCVS, however ViewCVS was
written in Python.

Is their a way for PHP to Display the 'diffs' between two submitted text?

Lets say the user submitted a text file stored as $textin, then the script
displays the 'diffs' (including what was removed) between it and a previous
text stored as $otext.

I just need to be pointed in the right direction.


--- End Message ---
--- Begin Message ---
If a browser has cookies blocked , anyone have code if unable to set cookie
then  goto another page.

--- End Message ---
--- Begin Message ---
hi,

I wonder that is there a PHP function like window.open() into Javascript?

thankyouverymuch.


--- End Message ---

Reply via email to