|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
php-general Digest 26 Jun 2003 12:34:12 -0000 Issue 2140
php-general-digest-help
lists.php.net
Date: Thu Jun 26 2003 - 07:34:12 CDT
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 26 Jun 2003 12:34:12 -0000 Issue 2140
Topics (messages 152898 through 152970):
Re: pdf routine - good local / bad online
152898 by: Martin Towell
152913 by: Jeff Harris
Converting Array
152899 by: John Wulff
152900 by: Martin Towell
152901 by: David Otton
152927 by: Ernest E Vogelsinger
Re: Command line php output redirection.
152902 by: Joshua Moore-Oliva
Re: Securing PHP code
152903 by: Joel Rees
152909 by: Joseph Szobody
152933 by: SLanger.spirit21.de
152939 by: nad
152944 by: Justin French
Why Can't I get this to work
152904 by: Ron Clark
152918 by: Jason Wong
Re: Curl & NTLM
152905 by: Andrew Ziem
152906 by: Andrew Ziem
152907 by: Boaz Yahav
Fatal Error: Call to undefined function: *mail()*? What's next, echo?
152908 by: weston.leary.csoft.net
152917 by: Jason Wong
HTML_QuickForm
152910 by: Ralph
Sybase and PHP
152911 by: Michael A Smith
152912 by: Ray Hunter
Re: sessions and browser back[Scanned]
152914 by: Bibhas Kumar Samanta
Array Info
152915 by: John Wulff
Re: quotes
152916 by: chris sherwood
152945 by: Ford, Mike [LSS]
Re: One more time - HTTP_HOST
152919 by: Jason Wong
passwd protected page
152920 by: Bibhas Kumar Samanta
152921 by: Sichta Daniel
152923 by: Bibhas Kumar Samanta
152924 by: Bibhas Kumar Samanta
152925 by: Chris Kay
152926 by: Bibhas Kumar Samanta
152929 by: Chris Kay
152930 by: Chris Kay
Impossible bug!
152922 by: John Wulff
Re: PHP & Mysql Error Code 1062 - Duplicates found
152928 by: Ow Mun Heng
Re: passwd protected page[Scanned]
152931 by: Michael Egan
Re: '/tmp/mysql.sock' error
152932 by: Jean-Christian IMbeault
152935 by: - Edwin -
152937 by: Jason Wong
unpack() and binary data
152934 by: Gerard Samuel
Re: Impossible bug! (fwd)
152936 by: Andy Fiddaman
Re: Help please!
152938 by: poetbox
152947 by: nad
remote cvs server
152940 by: php dot net
Seraching for good Hotel & room booking program.....
152941 by: Giuliano
Re: Weird mktime problem
152942 by: Ford, Mike [LSS]
152948 by: Naintara Jain
152949 by: Ford, Mike [LSS]
152962 by: Jason Wong
Re:[PHP] Array Info
152943 by: Haseeb
152946 by: Ford, Mike [LSS]
need help breaking out of loop.
152950 by: anders thoresson
152953 by: Naintara Jain
152954 by: David Otton
Re: need help breaking out of loop.[Scanned]
152951 by: Michael Egan
limiting functions
152952 by: Daryl Meese
twodimensional array / word-frequencylist
152955 by: Dore van Hoorn
152956 by: Jason Wong
152957 by: Chris Hayes
152959 by: Chris Hayes
152960 by: David Nicholson
152961 by: David Nicholson
152963 by: sven
152964 by: Naintara Jain
152965 by: David Otton
cannot get php through apache to write to my home dir on shared server
152958 by: frank reeves
152966 by: Marek Kilimajer
152968 by: CPT John W. Holmes
Re: Japanese text not displaying correctly.
152967 by: - Edwin -
problem with mktime
152969 by: anders thoresson
defect tracking systems
152970 by: Martin Balcar
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:
Is the pdf module being loaded on the linux machine ?
What is the error message (if any) that's displayed at the "create handle"
bit ?
Martin
-----Original Message-----
From: Floyd Baker [mailto:fbaker
olm1.com]
Sent: Thursday, 26 June 2003 10:32 AM
To: php-general
lists.php.net
Subject: [PHP] pdf routine - good local / bad online
Hi.
I have a routine creating a pdf file. Here is the script that works
on the win98 dev box. But when I upload it to the linux online, it
does not work.
It stops at 'create handle'. Can someone please tell me why?
// GET COMPANY INFO
while($row = mysql_fetch_array($mysql_result)){
$name1 = $row['name1'];
$name2 = $row['name2'];
$addr1 = $row['addr1'];
$addr2 = $row['addr2'];
$city = $row['city'];
$stat = $row['stat'];
$zipc = $row['zipc'];
$phone = $row['phone'];}
// START PDF FILE
unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');
// create handle for new PDF document
pdf_delete($pdf);
$pdf = pdf_new();
// open a file
pdf_open_file($pdf, 'f:/localhost/adobe/' . $cocode . '_info.pdf');
I do change the 'f:/localhost' to https://xx.xx.xx,xx when uploaded.
Any thoughts will be greatly appreciated... TIA
Floyd
attached mail follows:
On Jun 25, 2003, "Floyd Baker" claimed that:
|
|Hi.
|
|I have a routine creating a pdf file. Here is the script that works
|on the win98 dev box. But when I upload it to the linux online, it
|does not work.
|
|It stops at 'create handle'. Can someone please tell me why?
|
|// GET COMPANY INFO
| while($row = mysql_fetch_array($mysql_result)){
| $name1 = $row['name1'];
| $name2 = $row['name2'];
| $addr1 = $row['addr1'];
| $addr2 = $row['addr2'];
| $city = $row['city'];
| $stat = $row['stat'];
| $zipc = $row['zipc'];
| $phone = $row['phone'];}
|
|// START PDF FILE
| unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');
|
|// create handle for new PDF document
| pdf_delete($pdf);
| $pdf = pdf_new();
|
|// open a file
| pdf_open_file($pdf, 'f:/localhost/adobe/' . $cocode . '_info.pdf');
|
|
|I do change the 'f:/localhost' to https://xx.xx.xx,xx when uploaded.
|
|Any thoughts will be greatly appreciated... TIA
|
|Floyd
|
|--
Not sure you can unlink a file by https:// protocol. Make sure that it's
pointing correctly to a file for which httpd has write permissions.
http://www.php.net/unlink
"unlink('f:/localhost/adobe/' . $cocode . '_info.pdf');'
"unlink('/usr/local/httpd/htdocs/' . $cocode . '_info.pdf');
--
Registered Linux user #304026.
"lynx -source http://jharris.rallycentral.us/jharris.asc | gpg --import"
Key fingerprint = 52FC 20BD 025A 8C13 5FC6 68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
attached mail follows:
I've got an array in the following format:
Array ( [Jan-1999] => 36.04,140.35,319.53,324.07 [Feb-1999] =>
1.78,71.78,320.58,141.97 )
I need it in the following format:
$example_data = array(
array("Feb-1999",1.78,71.78,320.58,141.97),
array("Jan-1999",36.04,140.35,319.53,324.07)
);
I'm such an idiot when it comes to arrays that I can't figure this out. How
do I do it?
Thanks.
attached mail follows:
what about (untested)?
$example_data = array();
foreach ($blah_array as $key=>$value)
{
$example_data[] = array($key, $value);
}
-----Original Message-----
From: John Wulff [mailto:johnw
orcasnet.com]
Sent: Thursday, 26 June 2003 11:37 AM
To: php-general
lists.php.net
Subject: [PHP] Converting Array
I've got an array in the following format:
Array ( [Jan-1999] => 36.04,140.35,319.53,324.07 [Feb-1999] =>
1.78,71.78,320.58,141.97 )
I need it in the following format:
$example_data = array(
array("Feb-1999",1.78,71.78,320.58,141.97),
array("Jan-1999",36.04,140.35,319.53,324.07)
);
I'm such an idiot when it comes to arrays that I can't figure this out. How
do I do it?
Thanks.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
__________ Information from NOD32 1.436 (20030612) __________
This message was checked by NOD32 for Exchange e-mail monitor.
http://www.nod32.com
attached mail follows:
On Wed, 25 Jun 2003 18:37:02 -0700, you wrote:
>I've got an array in the following format:
>Array ( [Jan-1999] => 36.04,140.35,319.53,324.07 [Feb-1999] =>
>1.78,71.78,320.58,141.97 )
Assuming that I've interpreted your array structure correctly,
$a = array ("Jan-1999" => array (36.04,140.35,319.53,324.07),
"Feb-1999" => array (1.78,71.78,320.58,141.97)
);
There are plenty of possible solutions. Here's a slightly perverse one:
$f = create_function ('$x, $y', 'return (array_merge(array($x), $y));');
$a = array_map($f, array_keys ($a), $a);
Otherwise... loop from 0 to sizeof ($array), replacing each element of the
array with
array($key) + $value
attached mail follows:
At 03:37 26.06.2003, John Wulff said:
--------------------[snip]--------------------
>I've got an array in the following format:
>Array ( [Jan-1999] => 36.04,140.35,319.53,324.07 [Feb-1999] =>
>1.78,71.78,320.58,141.97 )
>
>I need it in the following format:
>$example_data = array(
> array("Feb-1999",1.78,71.78,320.58,141.97),
> array("Jan-1999",36.04,140.35,319.53,324.07)
>);
--------------------[snip]--------------------
This should do:
$array_output = array();
foreach ($array_input as $key => $data) {
$atmp = explode(',',$data);
array_unshift($atmp, $key);
$array_output[] = $atmp;
}
May I ask why you're reformatting the array - maybe you could avoid this step?
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
attached mail follows:
That worked, thanks.
On June 25, 2003 07:16 pm, David Nicholson wrote:
> Hello,
>
>
> This is a reply to an e-mail that you wrote on Wed, 25 Jun 2003 at 23:48,
> lines prefixed by '>' were originally written by you.
>
> > php parser.php > temp
> > temp only contains
> > Content-type: text/html
> > X-Powered-By: PHP/4.3.2
>
> Maybe try using the -q parameter? what do you get then?
> -q Quiet-mode. Suppress HTTP Header output.
>
> David.
attached mail follows:
> "Maybe I am missing something totally obvious, but if the server is set up
> to
> properly parse php files - having configs outside of the doc root should not
> make much of a security difference?
> "
>
> Is this a true statement or not? (of course we have to make the assumption
> that server access has not been compromised....)
There was a version of php where exactly this sort of hole existed under
certain conditions. That hole does not exist in the present version.
Check the security announcements for details.
However, you should always consider a file extension among the weaker
class of protections.
--
Joel Rees, programmer, Kansai Systems Group
Altech Corporation (Alpsgiken), Osaka, Japan
http://www.alpsgiken.co.jp
attached mail follows:
> A safer architechture would be to use two machines. One to act as the
> Web server and the other to process transactions. The Web server would
> take the orders and request the transaction server to process them.
>
> The transcation server can only be accessed from the Web server. Nobody
> should be able to reach the transaction server from the Internet. The
> transaction server machine should have the database server too. The
> database server should not accept network connections.
Manuel,
Having never setup a multi-server web environment before, I'm a bit curious. How would the public server communicate with the private server, passing in database queries and getting results, if it can't connect directly to the database? Are we talking about building a SOAP interface between the two?
Thanks,
Joseph
attached mail follows:
One more thing, make sure the application is running on its own server
meaning don't use a shared hosting enviroment that allows others to gain
access to your directories. In this case even placing the file outside of
docroot doesnot secure it in anyway since any other user can access it
with their php scripts since it is most likely that the webserver user is
the same for all shared hosters. This can be allevated with safe_mode =
on.
I know this is a very specific scenario but none the less you should make
sure this is not possible.
You could store the password encrypted and decrypt it before giving it to
the database this way if anybody got the file they can not read the
password. This of course still leaves it open where to store the keys.
I wonder if there is way to actually securly store database passwords for
scripts on a server without compromising security to some degree.
It all comes down to one credo:
There is no such thing as absolute security, the trick is to make
retrieval of information as hard as possible.
About security books: There are none that are specific to php that I know
of but general books such as 'Hackers Guide' or so give you a fair deal of
information (and sources) on how security can be compromised on your
system. Don't forget your friend Google or someother Searchenginge for
that matter.
As allready mentioned:
1. Trust nobody, Validate everything
2. Watch out for SQL Injection
3. Close everything you don't need on your server
4. Let your php code be checked by others. Maybe even this list?
5. Turn of register_globals to prevent variable injection into your script
6. Turn your error level up to E_ALL to see all notices. This will prevent
you from using uninitialized variables or using constants you have not
defined. I find it helpfull to display all errors to screen during
developement. Don't forget to turn this off for production purposes. In
production regularly inspect the php error log.
Regards
Stefan Langer
attached mail follows:
>>> 1) The site will have to take very high traffic and possibly thousands
of transactions per hour
>>> -> Which is the best free db to use (I am guessing MySQL)
>>> -> Which is the best paid database (Other than MySQL)
transactions ???
Go for one which offers "commit/rollback" ...
===============
>>> 2) I store the db password and login info in a database.inc.php file. Is
there any way I can prevent a person from >>> getting the db pass even after
he gets this file?
The only way (i think, maybe there are other ways to do it) it to set up two
server (connected in a local network): one public and one private. Surely
the private server will have the databases. It will only be available in the
local network !!! Even if the get your "database.inc.php" they CANNOT have
your data from the DB.
For e.g. to connect to the DB (mySQL)
mysql_connect("10.1.1.20", ...)
A private IP can be accessed locally... Well it really works.. i've done
something like this !!!
===============
>>> 3) Does anyone know a book that focuses of writing secure code.
Free issue of PHP|Arch magazine...
https://www.phparch.com/issuedata/2003/jan/
Gonna help you surely...
===============
>>> 4)What about Zend source safe. Is that recommended. How exactly does it
work and what exactly does this do. >>> Will it help to keep my
database.inc.php file safe?
Surely Zend Encoder or TurckSoft or any other utility will be do a great
favour.
Turck MMCache encodes a simple "echo phpinfo();" like this...
<?php return
mmcache_load('eJzz9XV2dPZwZWBkYABhJjDJAGaAgQ0zlMHAyMjMDqQKMgoy89Ly7VjAQoxQSW
erGM+81JKC0qSY8vLyovz8khhfX+fE5IzUGKAG3bTMnNTimMy8lNQKPSCfAQB+BRdH');
?>
Who gonna decode this???
===============
>>> 5)How do I know the code that I am writing and my server is safe. Are
there any services out there that would >>> help me evaluate this.
At development stage put error_reporting = E_ALL;
Eliminate all notices, warnings, etc.
On live server error_reporting = ~E_ALL; (don't forget '~' ... haha)
===============
Not only you have to write secure codes, but it will be the responsibility
of the network admin not to let anybody have access to your server (public
or private !!!) from outside... I remember when i first joined the company
i'm working at, my network admin accessed my PC from outside our network (he
gained accessed thr' the router or I don't know how... the Network Experts
will answer this well) he then asked me to patch everything, etc..
Any mistake in this post, plz correct me so that i can learn from it.
That's a very small help from me. Hope it helps.
GOOD LUCK
Nadim Attari
http://www.alienworkers.com
attached mail follows:
I'm not a security expert at all, but...
The short answer to your question is that if you have to ask how to make
your code secure, then chances are, you probably shouldn't be attempting it
at all... but then again, we all have to learn somewhere...
Do a google search, and read thousands of articles relating to security
(even if it's not directly to do with what you want)... over time you'll
build a library in your head of issues that need to be resolved.
A key point in understanding security is to ask "what should i allow",
rather than "what should i make sure they don't do".
More comments inline:
on 26/06/03 7:01 PM, Siddharth Hegde (siddharth
webquezt.com) wrote:
> I want some advice and tips from experts on the following
> The server will be Red Hat Linux 7.3
I hope it's a dedicated box, with Telnet, FTP etc blocked to all but your
own IP address'?
> 2) I store the db password and login info in a database.inc.php file. Is there
> any way I can prevent a person from getting the db pass even after he gets
> this file?
Store an MD5 of the password, that way you're comparing the two hashes, not
two passwords... even if someone stumbles into your database, they'll only
see the MD5'd password. A further step would be encryption, on which you
will have to do a LOT of reading.
> 3) Does anyone know a book that focuses of writing secure code.
There's plenty of articles... just search and search and search on google...
keep digging, a read everything.
> 5)How do I know the code that I am writing and my server is safe. Are there
> any services out there that would help me evaluate this.
Pay a programmer with a lot more experience to consult on your project.
Start with open source products which may have an inherited strength and
security as they draw on the experiences of many programmers, some of which
with MANY years behind the wheel.
> Although this is a high profile project, our budget is super small and A LOT
> depends on this project taking off within a small budget, but at the same time
> don't want to compromise on security.
If your client's primary concern is cost, not security or customer
satisfaction, then I'd be a little worried :)
I'd start by not storing the cc numbers, or any other sensitive data on the
web server at all... it will depend on your application, but if there are no
numbers stored, then there's very little reason to attempt to hack in and
get them, yes?
Talk to your credit card merchant about the options you have, and take any
advice they can provide... also, don't skimp on things like cc merchants...
Make sure all logins and sensitive data is done over SSL too.
Justin
attached mail follows:
Hello all,
I have a php script that reads a flat text file with fields seperated by a
space. I explode them into an array just fine, but when I try then to load
that array into a mysql database, it doesn't work. Here is my script:
for ($i=0; $i<$number_of_alerts; $i++) {
// Split each line
$line = explode(" ", $ipfwlog[$i]);
$line[1] = intval($line[1]);
$IPFWsql = "INSERT INTO Firewall_Logs (month, date, time, fw_name, kernel,
fw_engine, rule_number, action, protocol, src
$results = mysql_query($IPFWsql) or die ("Could not execute query");
}
Any ideas why this does not work? I am completely stuck.
Thanks in advance,
RonC
attached mail follows:
On Thursday 26 June 2003 11:20, Ron Clark wrote:
> I have a php script that reads a flat text file with fields seperated by a
> space. I explode them into an array just fine, but when I try then to load
> that array into a mysql database, it doesn't work. Here is my script:
>
> for ($i=0; $i<$number_of_alerts; $i++) {
> // Split each line
> $line = explode(" ", $ipfwlog[$i]);
>
> $line[1] = intval($line[1]);
>
> $IPFWsql = "INSERT INTO Firewall_Logs (month, date, time, fw_name, kernel,
> fw_engine, rule_number, action, protocol, src
> $results = mysql_query($IPFWsql) or die ("Could not execute query");
>
> }
>
> Any ideas why this does not work? I am completely stuck.
What makes you think it doesn't work? IOW what happens?
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
attached mail follows:
Try the PHP file() command.
Assumably you mean HTML not NTML.
Andrew
http://cday.sourceforge.net
Boaz Yahav wrote:
> Does anyone have a code snippet that connects to a remote server using
> NTML
> and gets the HTML source?
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
attached mail follows:
Try the PHP file() command.
Assumably you mean HTML not NTML.
Andrew
http://cday.sourceforge.net
Boaz Yahav wrote:
> Does anyone have a code snippet that connects to a remote server using
> NTML
> and gets the HTML source?
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
attached mail follows:
I mean NTLM :)
-----Original Message-----
From: Andrew Ziem [mailto:andyziem
acmemail.net]
Sent: Thursday, June 26, 2003 5:27 AM
To: Boaz Yahav
Cc: php-general
lists.php.net
Subject: Re: Curl & NTLM
Try the PHP file() command.
Assumably you mean HTML not NTML.
Andrew
http://cday.sourceforge.net
Boaz Yahav wrote:
> Does anyone have a code snippet that connects to a remote server using
> NTML and gets the HTML source?
>
> Sincerely
>
> berber
>
> Visit http://www.weberdev.com/ Today!!!
> To see where PHP might take you tomorrow.
attached mail follows:
I was testing a boring little FormMail script I've used on dozens of PHP
installations (Apache and IIS), when I got an error:
Fatal error: Call to undefined function: mail() in /usr/local/apache/vweb/redfishinsurance/form2mail.php on line 65
What? How? I quote from the PHP manual entry for the "mail()" function:
"Requirements
No external libraries are needed to build this extension.
Installation
There is no installation needed to use these functions; they are part of the PHP core."
I wouldn't be so surprised and perplexed if it just somehow failed, but nope,
it's *undefined* ... should I be worried echo() and print() are going to go next?
Help.
-W
attached mail follows:
On Thursday 26 June 2003 12:38, weston
leary.csoft.net wrote:
> I was testing a boring little FormMail script I've used on dozens of PHP
> installations (Apache and IIS), when I got an error:
>
> Fatal error: Call to undefined function: mail() in
> /usr/local/apache/vweb/redfishinsurance/form2mail.php on line 65
> What? How? I quote from the PHP manual entry for the "mail()" function:
>
> "Requirements
>
> No external libraries are needed to build this extension.
>
> Installation
>
> There is no installation needed to use these functions; they are part of
> the PHP core."
What the manual doesn't make clear is that mail() is only compiled in if
./configure was able to find the sendmail binary.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
attached mail follows:
Anybody used PEAR: HTML_QuickForm or Manuel Lemos Forms Generation and
Validation class? I'm looking to use one of these for my forms, so I was
wondering if anybody had any experience in working with either.
attached mail follows:
Hi,
I want to connect to a Sybase database running on another windoze server
without having to a buy a copy of sybase for linux. How can I compile
PHP to have the sybase functions, but not the local database program.
-Michael
--
Michael A Smith <php-digest
custom87.net>
attached mail follows:
U just need the sybase client on the linux machine and the file that
contains your TNS names...
--
BigDog
On Wed, 2003-06-25 at 23:26, Michael A Smith wrote:
> Hi,
>
> I want to connect to a Sybase database running on another windoze server
> without having to a buy a copy of sybase for linux. How can I compile
> PHP to have the sybase functions, but not the local database program.
>
> -Michael
> --
> Michael A Smith <php-digest
custom87.net>
>
attached mail follows:
Thanks Michael,
Can you suggest any other method (without using session_start)
by which I can track users and validate for each page.
What I do currently , in the login page register the user using sessions
and in other pages see if user is registered.
I need to restrict each page based on mysql table page access right
against each user.
Thanks,
Bibhas
Michael Egan wrote:
>
> Bibhas,
>
> I'm sure I've read somewhere that this is a deliberate security feature with using sessions - i.e. you can't view contents of form fields by using the back button on your browser.
>
> Couldn't you use JavaScript to ensure that the data is validated on the client side before the form is submitted?
>
> Regards,
>
> Michael Egan
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: 25 June 2003 14:26
> To: php-general
lists.php.net
> Subject: [PHP] sessions and browser back[Scanned]
>
> Hi,
>
> I am trying to create restricted pages for my php/mysql/apache
> server with sessions and passing session varibales to other pages for
> validation.
>
> Eventually I am doinng session_start() at the begining and
> checking whether logged in user is authorised to use this page
> by a routine.
>
> Now problem is, if filled in data in the form is incorrect, the forms
> gives an error. But when I press browser BACK button to get the
> filled in form , the form seems to get reset with _no_ data.
>
> When I try without session_start() at the begining of form , things
> seem to behave normally.
>
> Does session_start() reset the form and I guess browser should
> have returned be by fiiled in page from cache ?
>
> Please help
>
> -Bibhas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I need some information about an array structured as follows:
$example_data = array(
array("Mar-99",0,0,5945.33,0),
array("Feb-99",0,0,47648.90,0),
array("Jan-99",0,0,13365.52,0)
);
I need to know the largest number in the array.
I need to know how many sets of numbers there are, ie how many commas there
are.
I need to seperate all the numbers into their own variables... this I think
I know how to do.
Thats it for now, but more may come....
Thanks in advance.
attached mail follows:
echo "<input name='company' type='text' value='". htmlentities($company)
."'>";
this doesnt work cause the engine doesnt like that
try this
echo "<input name='company' type='text' value='".( htmlentities($company))
."'>";
"Anthony" <atampone
attechcomputer.com> wrote in message
news:<20030625183749.25154.qmail
pb1.pair.com>...
> tough to tell... but it looks like you have the " and ' mixed up before
the
> > in the end :-P
>
> - Anthony
>
> "Lso ." <lukas__scott
hotmail.com> wrote in message
> news:LAW8-F68WYdnHDJcxdV00049a74
hotmail.com...
> > ok i see why i didnt work but i dont know why.
> >
> > can anyone tell me why this works:
> >
> > <input name="testfield" type="text" value="<? echo
> htmlentities($company)
> > ?>">
> >
> > but this doesn't:
> >
> > echo "<input name='company' type='text' value='". htmlentities($company)
> > ."'>";
> >
> > Lucas Owens
> > www.lucasowens.com
> > www.technoiraudio.com
> >
> > _________________________________________________________________
> > Add photos to your e-mail with MSN 8. Get 2 months FREE*.
> > http://join.msn.com/?page=features/featuredemail
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
attached mail follows:
> -----Original Message-----
> From: Lso . [mailto:lukas__scott
hotmail.com]
> Sent: 25 June 2003 18:32
>
> ok i see why i didnt work but i dont know why.
>
> can anyone tell me why this works:
>
> <input name="testfield" type="text" value="<? echo
> htmlentities($company)
> ?>">
>
> but this doesn't:
>
> echo "<input name='company' type='text' value='".
> htmlentities($company)
> ."'>";
Because by default htmlentities will convert double quotes but not single ones -- if you convert the second one to use double quotes in the HTML (like the first one), it should work:
echo '<input name="company" type="text" value="', htmlentities($company), '">';
Or you could use the optional 2nd parameter to htmlentities to make it convert single quotes as well -- the following is a quote from the manual page at http://www.php.net/htmlentities:
> the optional second quote_style parameter lets you define what will
> be done with 'single' and "double" quotes. It takes on one of three
> constants with the default being ENT_COMPAT:
>
> Constant Name Description
> ENT_COMPAT Will convert double-quotes and leave single-quotes
> alone.
> ENT_QUOTES Will convert both double and single quotes.
> ENT_NOQUOTES Will leave both double and single quotes unconverted.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On Thursday 26 June 2003 05:41, Sparky Kopetzky wrote:
> Is $_SERVER['HTTP_HOST'] the same as CGI $_ENV['REMOTE_HOST'] ??
No.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
attached mail follows:
Hi,
Without using sessions , how can I create
passwd protected pages in mysql/php.
I need to remember the user from login page and
validate this user in other pages.
Thanks,
Bibhas
attached mail follows:
Hi,
You can validate user on login page and sets the flag in database table.
Then on each page you have to check that flag again ....
DS
-----Original Message-----
From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
Sent: Thursday, June 26, 2003 8:52 AM
To: php-general
lists.php.net
Subject: [PHP] passwd protected page
Hi,
Without using sessions , how can I create
passwd protected pages in mysql/php.
I need to remember the user from login page and
validate this user in other pages.
Thanks,
Bibhas
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
-Will it be secure?
-What will happen in case browser crashes setting the flag,
I guess , in sessions, sessions will be terminated.
-Bibhas
Sichta Daniel wrote:
>
> Hi,
>
> You can validate user on login page and sets the flag in database table.
> Then on each page you have to check that flag again ....
>
> DS
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, June 26, 2003 8:52 AM
> To: php-general
lists.php.net
> Subject: [PHP] passwd protected page
>
> Hi,
>
> Without using sessions , how can I create
> passwd protected pages in mysql/php.
>
> I need to remember the user from login page and
> validate this user in other pages.
>
> Thanks,
> Bibhas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
how should I pass the logged in user to other pages ?
In the database at the same time there might be several user
logged in ?
Thanks,
Bibhas
Sichta Daniel wrote:
>
> Hi,
>
> You can validate user on login page and sets the flag in database table.
> Then on each page you have to check that flag again ....
>
> DS
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, June 26, 2003 8:52 AM
> To: php-general
lists.php.net
> Subject: [PHP] passwd protected page
>
> Hi,
>
> Without using sessions , how can I create
> passwd protected pages in mysql/php.
>
> I need to remember the user from login page and
> validate this user in other pages.
>
> Thanks,
> Bibhas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Why not use sessions, store a $loggedin value in a session or cookie
And check that at the top of each page.. no session = no access
Hope this helps
---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------
-----Original Message-----
From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
Sent: Thursday, 26 June 2003 5:14 PM
To: Sichta Daniel
Cc: php-general
lists.php.net
Subject: Re: [PHP] passwd protected page
how should I pass the logged in user to other pages ?
In the database at the same time there might be several user
logged in ?
Thanks,
Bibhas
Sichta Daniel wrote:
>
> Hi,
>
> You can validate user on login page and sets the flag in database
table.
> Then on each page you have to check that flag again ....
>
> DS
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, June 26, 2003 8:52 AM
> To: php-general
lists.php.net
> Subject: [PHP] passwd protected page
>
> Hi,
>
> Without using sessions , how can I create
> passwd protected pages in mysql/php.
>
> I need to remember the user from login page and
> validate this user in other pages.
>
> Thanks,
> Bibhas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Message protected by MailGuard: e-mail anti-virus, anti-spam and content
filtering.
http://www.mailguard.com.au/mg
attached mail follows:
my problem is that when I use sessions in the restricted pages
the session_start() seem to reset the form ( when other filled in data
is lost) when go back to the form using
Back in the browser.
So I wanted to avoid session_start
How are the good php sites designed ?
regds,
Bibhas
Chris Kay wrote:
>
> Why not use sessions, store a $loggedin value in a session or cookie
> And check that at the top of each page.. no session = no access
>
> Hope this helps
>
> ---------------------------------------------------------
> Chris Kay
> Techex Communications
> Website: www.techex.com.au Email: chris.kay
techex.net.au
> Telephone: 1300 88 111 2 - Fax: 1300 882 221
> ---------------------------------------------------------
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, 26 June 2003 5:14 PM
> To: Sichta Daniel
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] passwd protected page
>
> how should I pass the logged in user to other pages ?
> In the database at the same time there might be several user
> logged in ?
>
> Thanks,
> Bibhas
>
> Sichta Daniel wrote:
> >
> > Hi,
> >
> > You can validate user on login page and sets the flag in database
> table.
> > Then on each page you have to check that flag again ....
> >
> > DS
> >
> > -----Original Message-----
> > From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> > Sent: Thursday, June 26, 2003 8:52 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] passwd protected page
> >
> > Hi,
> >
> > Without using sessions , how can I create
> > passwd protected pages in mysql/php.
> >
> > I need to remember the user from login page and
> > validate this user in other pages.
> >
> > Thanks,
> > Bibhas
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Message protected by MailGuard: e-mail anti-virus, anti-spam and content
> filtering.
> http://www.mailguard.com.au/mg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Sorry I didn't read the first post about not wanting to use sessions,
what about cookies?
What about making a hash of the username and password and place it in
the url
EG: /main.php?u=chris&p=AJKHSA765JAFG443320
Something like that
Check the hash against the database each page
$db = mysql_query("select * from users where username = '". $_GET['u']
."'");
if ( mysql_num_rows($db) ) {
$database = mysql_fetch_array($db);
If ( $_GET['p'] == md5($database[password]) ) {
// Let them go
} else {
header("Location: error.php?error=invalid");
}
} else {
header("Location: error.php?error=noset");
}
Try this it will work
---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------
-----Original Message-----
From: Chris Kay
Sent: Thursday, 26 June 2003 5:19 PM
To: bks
cal.interrasystems.com
Cc: php-general
lists.php.net
Subject: RE: [PHP] passwd protected page
Why not use sessions, store a $loggedin value in a session or cookie
And check that at the top of each page.. no session = no access
Hope this helps
---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------
-----Original Message-----
From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
Sent: Thursday, 26 June 2003 5:14 PM
To: Sichta Daniel
Cc: php-general
lists.php.net
Subject: Re: [PHP] passwd protected page
how should I pass the logged in user to other pages ?
In the database at the same time there might be several user
logged in ?
Thanks,
Bibhas
Sichta Daniel wrote:
>
> Hi,
>
> You can validate user on login page and sets the flag in database
table.
> Then on each page you have to check that flag again ....
>
> DS
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, June 26, 2003 8:52 AM
> To: php-general
lists.php.net
> Subject: [PHP] passwd protected page
>
> Hi,
>
> Without using sessions , how can I create
> passwd protected pages in mysql/php.
>
> I need to remember the user from login page and
> validate this user in other pages.
>
> Thanks,
> Bibhas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Message protected by MailGuard: e-mail anti-virus, anti-spam and content
filtering.
http://www.mailguard.com.au/mg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
ARGGGGGGGGGGG bad day for coding & reading
Replace
if ( mysql_num_rows($db) ) {
with
if ( mysql_num_rows($db)==1 ) {
now I am going home before I cause any more damage :)
---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------
-----Original Message-----
From: Chris Kay
Sent: Thursday, 26 June 2003 5:27 PM
To: Chris Kay; bks
cal.interrasystems.com
Cc: php-general
lists.php.net
Subject: RE: [PHP] passwd protected page
Sorry I didn't read the first post about not wanting to use sessions,
what about cookies?
What about making a hash of the username and password and place it in
the url
EG: /main.php?u=chris&p=AJKHSA765JAFG443320
Something like that
Check the hash against the database each page
$db = mysql_query("select * from users where username = '". $_GET['u']
."'");
if ( mysql_num_rows($db) ) {
$database = mysql_fetch_array($db);
If ( $_GET['p'] == md5($database[password]) ) {
// Let them go
} else {
header("Location: error.php?error=invalid");
}
} else {
header("Location: error.php?error=noset");
}
Try this it will work
---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------
-----Original Message-----
From: Chris Kay
Sent: Thursday, 26 June 2003 5:19 PM
To: bks
cal.interrasystems.com
Cc: php-general
lists.php.net
Subject: RE: [PHP] passwd protected page
Why not use sessions, store a $loggedin value in a session or cookie
And check that at the top of each page.. no session = no access
Hope this helps
---------------------------------------------------------
Chris Kay
Techex Communications
Website: www.techex.com.au Email: chris.kay
techex.net.au
Telephone: 1300 88 111 2 - Fax: 1300 882 221
---------------------------------------------------------
-----Original Message-----
From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
Sent: Thursday, 26 June 2003 5:14 PM
To: Sichta Daniel
Cc: php-general
lists.php.net
Subject: Re: [PHP] passwd protected page
how should I pass the logged in user to other pages ?
In the database at the same time there might be several user
logged in ?
Thanks,
Bibhas
Sichta Daniel wrote:
>
> Hi,
>
> You can validate user on login page and sets the flag in database
table.
> Then on each page you have to check that flag again ....
>
> DS
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, June 26, 2003 8:52 AM
> To: php-general
lists.php.net
> Subject: [PHP] passwd protected page
>
> Hi,
>
> Without using sessions , how can I create
> passwd protected pages in mysql/php.
>
> I need to remember the user from login page and
> validate this user in other pages.
>
> Thanks,
> Bibhas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Message protected by MailGuard: e-mail anti-virus, anti-spam and content
filtering.
http://www.mailguard.com.au/mg
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Where the heck is my problem? No matter what the value for *_color is
always 1!!!
$example_data = array(
array("Mar-99",100,2000,5945.33,1234,10),
array("Feb-99",908,3454,47648.90,4321,50),
array("Jan-99",542,8000,13365.52,6012,60)
);
$high = 47648.90;
if(!isset($num))
{
$num = 1;
}
while($num <= 100 && $num >= 1)
{
foreach ($example_data as $key=>$value)
{
list($month, $a, $b, $c, $d, $e) = $value;
$a_percent = ($a / $high) * 100;
if($a_percent > $num) { $a_color = 1; }
$b_percent = ($b / $high) * 100;
if($b_percent > $num) { $b_color = 1; }
$c_percent = ($c / $high) * 100;
if($c_percent > $num) { $c_color = 1; }
$d_percent = ($d / $high) * 100;
if($d_percent > $num) { $d_color = 1; }
$e_percent = ($e / $high) * 100;
if($e_percent > $num) { $e_color = 1; }
}
$num = $num + 1;
}
attached mail follows:
Hi All,
I found out how to do it already. Thanks for the help.
mysql_error() was the key..
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
-----Original Message-----
From: Ow Mun Heng
Sent: Wednesday, June 25, 2003 10:03 AM
To: php-general
lists.php.net
Subject: PHP & Mysql Error Code 1062 - Duplicates found
Hi PHP'ers,
I've got a question regarding the input of (multiple) data into
mysql through PHP.
If there is already an entry in the database, then an mysql will generate an
error 1062 stating that the entry is a duplicate. (This will happen only if
I input the data through mySQL using xterm, if I use PHP, then I only get
the 'duplicate entry found', partly cause I don't know how to get the error
code as well as the duplicate entry returned to PHP to be output'ed to the
browser.
Below is my code. $my_query is concatenated from an array.
$my_query = $my_query.
"\n('".$SN[$i]."','".$DCM[$i]."','".$Supp[$i]."','".$time_now."'),";
$query = "INSERT INTO pioneer(serial_no,dcm,supplier,fa_timestamp) VALUES
$my_query;";
$result = mysql_db_query('tracker',$query);
if ($result)
echo "<br><br>".mysql_affected_rows()." Drives & DCM combo inserted into
database.";
else
echo "\n<br><br>Duplicate entry found. Data not inserted.";
Can anyone help me out?
Cheers,
Mun Heng, Ow
H/M Engineering
Western Digital M'sia
DID : 03-7870 5168
attached mail follows:
Bibhas,
I've seen many references to the phpBB application on this list in the past and had a look at it in detail some weeks ago. It's a fairly large application but the way they deal with sessions is instructive.
If I've understood it correctly they don't use the session management features in PHP but create their own. When a user visits the site a session is created with a unique identifier. This is then stored in a sessions table in the database. The session ID is passed to other pages as the user visits them either by use of cookies or by appending the session id to each url. If the user logs in then the user id is also stored in the relevant sessions table and other information about the user is pulled from a users table for that user id.
If you download the application - www.phpbb.com - you'll find the relevant code in the sessions file within the includes directory - though they have recently upgraded the application so this might have changed.
HTH,
Michael Egan
-----Original Message-----
From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
Sent: 26 June 2003 08:23
To: Chris Kay
Cc: php-general
lists.php.net
Subject: Re: [PHP] passwd protected page[Scanned]
my problem is that when I use sessions in the restricted pages
the session_start() seem to reset the form ( when other filled in data
is lost) when go back to the form using
Back in the browser.
So I wanted to avoid session_start
How are the good php sites designed ?
regds,
Bibhas
Chris Kay wrote:
>
> Why not use sessions, store a $loggedin value in a session or cookie
> And check that at the top of each page.. no session = no access
>
> Hope this helps
>
> ---------------------------------------------------------
> Chris Kay
> Techex Communications
> Website: www.techex.com.au Email: chris.kay
techex.net.au
> Telephone: 1300 88 111 2 - Fax: 1300 882 221
> ---------------------------------------------------------
>
> -----Original Message-----
> From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> Sent: Thursday, 26 June 2003 5:14 PM
> To: Sichta Daniel
> Cc: php-general
lists.php.net
> Subject: Re: [PHP] passwd protected page
>
> how should I pass the logged in user to other pages ?
> In the database at the same time there might be several user
> logged in ?
>
> Thanks,
> Bibhas
>
> Sichta Daniel wrote:
> >
> > Hi,
> >
> > You can validate user on login page and sets the flag in database
> table.
> > Then on each page you have to check that flag again ....
> >
> > DS
> >
> > -----Original Message-----
> > From: Bibhas Kumar Samanta [mailto:bks
cal.interrasystems.com]
> > Sent: Thursday, June 26, 2003 8:52 AM
> > To: php-general
lists.php.net
> > Subject: [PHP] passwd protected page
> >
> > Hi,
> >
> > Without using sessions , how can I create
> > passwd protected pages in mysql/php.
> >
> > I need to remember the user from login page and
> > validate this user in other pages.
> >
> > Thanks,
> > Bibhas
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> Message protected by MailGuard: e-mail anti-virus, anti-spam and content
> filtering.
> http://www.mailguard.com.au/mg
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
I've installed PHP from source and MySQL 4.0.9 from rpm on my RH 9 machine.
When I try and connect from php using mysql_connect() I get the
following error:
Warning: mysql_connect(): Can't connect to local MySQL server through
socket '/tmp/mysql.sock' (2)
The server is up and running and I can connect fine using the command
line client.
Do I need some special configuration?
Any advice appriciated!
Jean-Christian Imbeault
attached mail follows:
Hello,
Jean-Christian IMbeault <jc
mega-bucks.co.jp> wrote:
> I've installed PHP from source and MySQL 4.0.9 from rpm on my RH 9
> machine.
>
> When I try and connect from php using mysql_connect() I get the
> following error:
>
> Warning: mysql_connect(): Can't connect to local MySQL server through
> socket '/tmp/mysql.sock' (2)
>
> The server is up and running and I can connect fine using the command
> line client.
>
> Do I need some special configuration?
>
> Any advice appriciated!
Not sure but you can try this:
First, using the command line client, check whether you're using the
correct socket.
mysql> status;
Then, make sure that you have the same entry inside "/etc/my.cnf". (Or,
you can just change the value inside my.cnf to point to /tmp/mysql.sock-
-and see if it works.) Restart mysqld after making any changes...
HTH,
- E -
__________________________________________________
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!
http://bb.yahoo.co.jp/
attached mail follows:
On Thursday 26 June 2003 15:53, Jean-Christian IMbeault wrote:
> I've installed PHP from source and MySQL 4.0.9 from rpm on my RH 9 machine.
>
> When I try and connect from php using mysql_connect() I get the
> following error:
>
> Warning: mysql_connect(): Can't connect to local MySQL server through
> socket '/tmp/mysql.sock' (2)
>
> The server is up and running and I can connect fine using the command
> line client.
>
> Do I need some special configuration?
Find out where your mysql.sock is and edit php.ini to match.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
It's not whether you win or lose, it's how you place the blame.
*/
attached mail follows:
First of all, I have nearly no idea as to how to interpret binary data.
But Im attempting to parse binary data for file metadata information
(like mp3 files).
Concerning unpack(), I can across this link from the notes in the manual ->
http://fooassociates.com/phpfer/html/rn45re877.html
This has somewhat made things a little clearer as to how to move around
in a binary string.
But as a total newbie at this, I was wondering if there are any more
examples or tutorials, that would be
geared towards my intellectual ablity in this matter.
Any tips and or hints would be greatly appreciated.
Thanks
attached mail follows:
You never set *_color back to 0 at any point, so the first time through
the loop it gets set to 1 and stays there.
Replace you lines like:
; if($a_percent > $num) { $a_color = 1; }
with:
$a_color = $a_percent > $num;
On Thu, 26 Jun 2003, John Wulff wrote:
; Where the heck is my problem? No matter what the value for *_color is
; always 1!!!
;
; $example_data = array(
; array("Mar-99",100,2000,5945.33,1234,10),
; array("Feb-99",908,3454,47648.90,4321,50),
; array("Jan-99",542,8000,13365.52,6012,60)
; );
;
; $high = 47648.90;
; if(!isset($num))
; {
; $num = 1;
; }
; while($num <= 100 && $num >= 1)
; {
;
; foreach ($example_data as $key=>$value)
; {
; list($month, $a, $b, $c, $d, $e) = $value;
;
; $a_percent = ($a / $high) * 100;
;
; $b_percent = ($b / $high) * 100;
; if($b_percent > $num) { $b_color = 1; }
;
; $c_percent = ($c / $high) * 100;
; if($c_percent > $num) { $c_color = 1; }
;
; $d_percent = ($d / $high) * 100;
; if($d_percent > $num) { $d_color = 1; }
;
; $e_percent = ($e / $high) * 100;
; if($e_percent > $num) { $e_color = 1; }
; }
;
; $num = $num + 1;
; }
;
;
;
; --
; PHP General Mailing List (http://www.php.net/)
; To unsubscribe, visit: http://www.php.net/unsub.php
;
attached mail follows:
hi, Nadim Attari£¡
Well it doesn't... I have to send it as a mail to php-general
lists.php.net, then it works... If I click on the thread and try to "Reply to Group", it doesn't work !!!
We always send the mail to php-general
lists.php.net, and not using "reply to group" function,I think there's no easy way to do this.If you really have problems with PHP,sending mail is not the important thing,the more important thing is to get a good reply!Sorry,it's my own opinion:)
======= 2003-06-25 15:17:00 you wrote£º=======
>> hmm, well this post is here twice. so it works better than you thought? ;-)
>
>Well it doesn't... I have to send it as a mail to php-general
lists.php.net, then it works... If I click on the thread and try to "Reply to Group", it doesn't work !!!
>
>Anyway I can send my post now... and special thanks goes to Edward Dudlik (Becoming Digital).
>
>Nadim Attari
>http://www.alienworkers.com
= = = = = = = = = = = = = = = = = = = =
¡¡¡¡¡¡Thanks for your kindness.
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡poetbox
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡phplist
enorth.com.cn
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡2003-06-26
attached mail follows:
> We always send the mail to php-general
lists.php.net, and not
using "reply to group" function,I think there's no easy way to do this.If
you really have problems with PHP,sending mail is not the important
thing,the more important thing is to get a good reply!Sorry,it's my own
opinion:)
- Yea for sure, the most important thing is to get your PHP problems solved
here..
- Well I've been able to send from my news client (Outlook Express). This
post was not mailed but "Reply to Group"ed
Thx for the help...
Nadim Attari
http://www.alienworkers.com
attached mail follows:
I started to implement cvs connection protocole with php with a socket
connection. As it is poorly documented can anybody tip me in that task???
attached mail follows:
Hello,
i am serching for a good program (PHP) that i can use for
a hotel and apartments booking and billing system.
do you know some? thank you very much in advance,
Giulio
attached mail follows:
> -----Original Message-----
> From: Glenn [mailto:WaterDios
yahoo.com]
> Sent: 25 June 2003 14:58
[....]
> Here is what's weired.
>
> I use these lines to get the specifics:
> $StartHour = substr("$StartTime", 0, 2);
> $StartMinute = substr("$StartTime", 3, 2);
> $EndHour = substr("$EndTime", 0, 2);
> $EndMinute = substr("$EndTime", 3, 2);
> list($SMonth, $SDay, $SYear) = split('/', $StartDate);
> list($EMonth, $EDay, $EYear) = split('/', $EndDate);
>
> I then do this:
> $SUnixTime = mktime($StartHour, $StartMinute, 00, $SMonth,
> $SDay, $SYear);
>
> This is what's being sent to the mktime:
> (17,00,00,06,23,2003)
>
> This is what it ouputs:
> 1056405600
>
> Which is not technically correct. That is the unix time stamp for the
> starting our in Zulu time (greenwich mean time) which is
> currently 5 hours
> ahead of my timezone.
>
> Can anyone tell me why mktime is automatically converting to
> zulu time?
UNIX timestamps are *always* GMT -- it's the routines that process them that
do timezone (and DST) conversion. To prove this, run the following on your
server:
<?php
$timestamp = 1056405600;
echo "GMT = ", gmdate("Y-m-d H:i:s"), "<br />\n";
echo "local = ", date("Y-m-d H:i:s"), "<br />\n";
?>
Also see the manual page for gmdate() at http://www.php.net/gmdate which
shows a very similar script as its first example.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
You might want to consider removing the leading zeroes, this post is there
in the php manual and has been useful to me.
---------xxx-----------------------------
jchen3625 AT yahoo DOT com (25-Aug-2002 03:33)
beware, arguments with leading zeros are treated as zeros.
that is,
"mktime(0,0,0,10,09,2002)" == 09/30/2002, whereas
"mktime(0,0,0,10,9,2002)" == 10/09/2002.
---------xxx-----------------------------
Naintara
-----Original Message-----
From: php-general-return-152942-naintara=del6.vsnl.net.in
lists.php.net
[mailto:php-general-return-152942-naintara=del6.vsnl.net.in
lists.php.ne
t]On Behalf Of Ford, Mike [LSS]
Sent: Thursday, June 26, 2003 3:23 PM
To: 'Glenn'; php-general
lists.php.net
Subject: RE: [PHP] Weird mktime problem
> -----Original Message-----
> From: Glenn [mailto:WaterDios
yahoo.com]
> Sent: 25 June 2003 14:58
[....]
> Here is what's weired.
>
> I use these lines to get the specifics:
> $StartHour = substr("$StartTime", 0, 2);
> $StartMinute = substr("$StartTime", 3, 2);
> $EndHour = substr("$EndTime", 0, 2);
> $EndMinute = substr("$EndTime", 3, 2);
> list($SMonth, $SDay, $SYear) = split('/', $StartDate);
> list($EMonth, $EDay, $EYear) = split('/', $EndDate);
>
> I then do this:
> $SUnixTime = mktime($StartHour, $StartMinute, 00, $SMonth,
> $SDay, $SYear);
>
> This is what's being sent to the mktime:
> (17,00,00,06,23,2003)
>
> This is what it ouputs:
> 1056405600
>
> Which is not technically correct. That is the unix time stamp for the
> starting our in Zulu time (greenwich mean time) which is
> currently 5 hours
> ahead of my timezone.
>
> Can anyone tell me why mktime is automatically converting to
> zulu time?
UNIX timestamps are *always* GMT -- it's the routines that process them that
do timezone (and DST) conversion. To prove this, run the following on your
server:
<?php
$timestamp = 1056405600;
echo "GMT = ", gmdate("Y-m-d H:i:s"), "<br />\n";
echo "local = ", date("Y-m-d H:i:s"), "<br />\n";
?>
Also see the manual page for gmdate() at http://www.php.net/gmdate which
shows a very similar script as its first example.
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003
attached mail follows:
Ooops! Make that:
<?php
$timestamp = 1056405600;
echo "GMT = ", gmdate("Y-m-d H:i:s", $timestamp), "<br />\n";
echo "local = ", date("Y-m-d H:i:s", $timestamp), "<br />\n";
?>
> -----Original Message-----
> From: Ford, Mike [LSS]
> Sent: 26 June 2003 10:53
>
> UNIX timestamps are *always* GMT -- it's the routines that
> process them that do timezone (and DST) conversion. To prove
> this, run the following on your server:
>
> <?php
> $timestamp = 1056405600;
> echo "GMT = ", gmdate("Y-m-d H:i:s"), "<br />\n";
> echo "local = ", date("Y-m-d H:i:s"), "<br />\n";
> ?>
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
On Thursday 26 June 2003 18:46, Naintara Jain wrote:
> You might want to consider removing the leading zeroes, this post is there
> in the php manual and has been useful to me.
>
> ---------xxx-----------------------------
> jchen3625 AT yahoo DOT com (25-Aug-2002 03:33)
>
> beware, arguments with leading zeros are treated as zeros.
> that is,
> "mktime(0,0,0,10,09,2002)" == 09/30/2002, whereas
> "mktime(0,0,0,10,9,2002)" == 10/09/2002.
> ---------xxx-----------------------------
To be precise, integers written with a leading zero are treated as octal
numbers. But octal numbers can only contain digits 0-7. If it contains any
other digits then (probably) the whole value is rendered as 0.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
So this it it. We're going to die.
*/
attached mail follows:
Hi,
from the array i asume that you are trying to make a tree structure like this
Data_Array
{
Mar-99
{
0,
0,
5945,
33,
0
}
}
Second you said that you want to make variables out of these values. 1 thing to note is $0 Or $Mar-99 is not a valid variable name?
Please clear these points . may be then i will be able to help
Haseeb
ps. sprry for beaking thread but i am not subscribed to any news server.using outlook exp and don't know how to configure it.
attached mail follows:
> -----Original Message-----
> From: Haseeb [mailto:webcodder
hotmail.com]
> Sent: 26 June 2001 22:56
>
> ps. sprry for beaking thread but i am not subscribed to any
> news server.using outlook exp and don't know how to configure it.
At least configure your system's clock, please -- it's currently 2 years
slow!
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford
lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211
attached mail follows:
Hi,
I'm working of a PHP-MySQL-planning system for a newspaper. I want to add
dates and number for each issue. I have to following code, where
$current_date is a unix timestamp.
If $current_date is a Saturday or Sunday, I want to quit the current
execution of the loop and contiune with the next date. But when the if-
clause that checks if $issue_day_of_week is Sunday or Saturday is included
in my while-loop, everything stalls. Without it, everything goes smooth.
What am I missing?
while ($i <= $number_of_days)
{
$issue_date = strftime("%Y-%m-%d", $current_date);
$issue_month = date("m", $current_date);
$issue_day = date("d", $current_date);
$issue_day_of_week = date("l", $current_date);
// Check that $issue_date isn't Saturday or Sunday
if ($issue_day_of_week == "Sunday" | $issue_day_of_week == "Saturday")
{
continue;
}
if ($issue_month == 1 & $issue_day == 1)
{
$issue_number = 1;
$current_date = $current_date + 86400;
$i++;
$issue_number++;
continue;
}
$current_date = $current_date + 86400;
$i++;
$issue_number++;
}
--
anders thoresson
attached mail follows:
Are you incrementing number_of_days anywhere within the loop?
It looks like you have an infinite loop running. If you want to be able to
move to the next date, increment you date variable.
-Naintara
-----Original Message-----
From: php-general-return-152950-naintara=del6.vsnl.net.in
lists.php.net
[mailto:php-general-return-152950-naintara=del6.vsnl.net.in
lists.php.ne
t]On Behalf Of anders thoresson
Sent: Thursday, June 26, 2003 4:31 PM
To: php-general
lists.php.net
Subject: [PHP] need help breaking out of loop.
Hi,
I'm working of a PHP-MySQL-planning system for a newspaper. I want to add
dates and number for each issue. I have to following code, where
$current_date is a unix timestamp.
If $current_date is a Saturday or Sunday, I want to quit the current
execution of the loop and contiune with the next date. But when the if-
clause that checks if $issue_day_of_week is Sunday or Saturday is included
in my while-loop, everything stalls. Without it, everything goes smooth.
What am I missing?
while ($i <= $number_of_days)
{
$issue_date = strftime("%Y-%m-%d", $current_date);
$issue_month = date("m", $current_date);
$issue_day = date("d", $current_date);
$issue_day_of_week = date("l", $current_date);
// Check that $issue_date isn't Saturday or Sunday
if ($issue_day_of_week == "Sunday" | $issue_day_of_week == "Saturday")
{
continue;
}
if ($issue_month == 1 & $issue_day == 1)
{
$issue_number = 1;
$current_date = $current_date + 86400;
$i++;
$issue_number++;
continue;
}
$current_date = $current_date + 86400;
$i++;
$issue_number++;
}
--
anders thoresson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.491 / Virus Database: 290 - Release Date: 6/18/2003
attached mail follows:
On Thu, 26 Jun 2003 13:00:45 +0200, you wrote:
> What am I missing?
At first glance
>while ($i <= $number_of_days)
> {
> $issue_date = strftime("%Y-%m-%d", $current_date);
> $issue_month = date("m", $current_date);
> $issue_day = date("d", $current_date);
> $issue_day_of_week = date("l", $current_date);
>
> // Check that $issue_date isn't Saturday or Sunday
>
> if ($issue_day_of_week == "Sunday" | $issue_day_of_week == "Saturday")
if ($issue_day_of_week == 'Sunday' || $issue_day_of_week == 'Saturday')
> {
> continue;
> }
>
> if ($issue_month == 1 & $issue_day == 1)
if ($issue_month == 1 && $issue_day == 1)
> {
> $issue_number = 1;
> $current_date = $current_date + 86400;
> $i++;
> $issue_number++;
> continue;
> }
> $current_date = $current_date + 86400;
> $i++;
> $issue_number++;
> }
attached mail follows:
Anders,
Are you missing a '|' in the if condition?
Michael Egan
-----Original Message-----
From: anders thoresson [mailto:listor
thoresson.net]
Sent: 26 June 2003 12:01
To: php-general
lists.php.net
Subject: [PHP] need help breaking out of loop.[Scanned]
Hi,
I'm working of a PHP-MySQL-planning system for a newspaper. I want to add
dates and number for each issue. I have to following code, where
$current_date is a unix timestamp.
If $current_date is a Saturday or Sunday, I want to quit the current
execution of the loop and contiune with the next date. But when the if-
clause that checks if $issue_day_of_week is Sunday or Saturday is included
in my while-loop, everything stalls. Without it, everything goes smooth.
What am I missing?
while ($i <= $number_of_days)
{
$issue_date = strftime("%Y-%m-%d", $current_date);
$issue_month = date("m", $current_date);
$issue_day = date("d", $current_date);
$issue_day_of_week = date("l", $current_date);
// Check that $issue_date isn't Saturday or Sunday
if ($issue_day_of_week == "Sunday" | $issue_day_of_week == "Saturday")
{
continue;
}
if ($issue_month == 1 & $issue_day == 1)
{
$issue_number = 1;
$current_date = $current_date + 86400;
$i++;
$issue_number++;
continue;
}
$current_date = $current_date + 86400;
$i++;
$issue_number++;
}
--
anders thoresson
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Ok, lets see if I can sum this up. I have a number of scripts that my
clients (on a virtual host) can include into their PHP scripts to use my
software. While my scripts need clear access to all functions (exec, eval,
unlink, etc) I would like to stop my clients from having access to some of
the more dangerous functions. But, I believe if my script is included in
theirs it will be running from their directory and, therefore the httpd.conf
file will be no good.
A quick thought -- It would be nice if we had a "authorization code" in the
php.ini file that the more dangerous