Re: [PHP] Write text on imge...AND save it to disk..

2004-08-05 Thread Jason Wong
On Thursday 05 August 2004 13:18, PHP Gen wrote:

 I did, but forget it, I got another answer from Wudi
 that is far more helpful and I think a starting point.

IOW rather than looking up the answer yourself, you would like someone else to 
do it for you then copy and paste it to the list? Is that how you learn?

-- 
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
--
/*
Yea from the table of my memory
I'll wipe away all trivial fond records.
-- Hamlet
*/

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



Re: [PHP] File Uploading Issue

2004-08-05 Thread Jason Wong
On Thursday 05 August 2004 13:42, PHP E-Mail List wrote:

 You don't have permission to access /directory uploaded
 to/renamed file.txt on this server.

What are the permissions on that file?

-- 
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
--
/*
If you are smart enough to know that you're not smart enough to be an
Engineer, then you're in Business.
*/

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



[PHP] Re: XML validation with XML Schema

2004-08-05 Thread Ace
Matias Bagini matiasb at netlabs.com.ar writes:

 
 Is there any way to validate an XML with XML Schema using PHP4... I need 
 something like the
 
 bool DOMDocument-schemaValidate ( string filename)
 
 that exists on PHP5
 
 Thanks,
 
 Matias.
 


I use an external validator called XSV. It's the official W3C validator, i 
guess...

http://www.ltg.ed.ac.uk/~ht/xsv-status.html

You'll just have to develop a little script to access it. This validator is 
quite useful, because he sends you back an xml log for each validation. That 
log describes each error.

Ace

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



Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$

2004-08-05 Thread Josh Acecool M
The files that are evaled work perfectly without being evaled.

I dont think eval was meant for large files etc.

Whats on that like: a preg_match that looks for \$variable = something;

and thats the like it messes up on.

Also, if the file which is evaled includes another file, the variables from
the included file wont get parsed or anything, and the variables set to it
by the first file, or the class dont work at all.

John Holmes [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Josh Acecool M wrote:
var $The_Template_Sys;
  
  $this - The_Template_Sys = file_get_contents($The_Template_File);
  
  $this - Sub_Template = TRUE;
  Any ideas?

 I have an idea I said in a previous email!

 you say you're getting a parse error. How could anyone possibly help you
 troubleshoot that parse error unless they had an example of what was in
 the file being eval()'d??

 What is actually in the file that's failing the eval()??!?!?! What line
 of the file is failing? What is on that line? What's on the couple of
 lines before it? What's on the couple of lines after that line that's
 failing? What does the line with the eval() call look like? Are you
 doing anything else with $this-The_Template_Sys before it's
eval()'d??

 -- 

 John Holmes

 php|architect - The magazine for PHP professionals -
http://www.phparch.com

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



[PHP] Barcode info anyone...

2004-08-05 Thread Dave Carrera
Hi List,

I know I can generate  print barcodes in php for my app :-)

But can I read the generated barcode into my php application and select the
associated item and if so what do you have to do to get it working.

I think that maybe the mouse cursor would be in a form field, scan the
barcode and the data from the barcode reader would go into the form field of
which I can issue a OnChange instruction, but I might be completely wrong.

Any pointers, urls, advice, hardware suggestions (UK Based) very much
welcome

Thank you in advance for any help

Dave Carrera


-- 
UK Web Hosting @ http://www.ephgroup.com  

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.733 / Virus Database: 487 - Release Date: 02/08/2004
 

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



[PHP] References and array indexes

2004-08-05 Thread Gabriel Birke
Hello!
The following PHP code:
?
$a = array(1=First Element, 2=Second Element);
$v = $a['3'];
print_r($a);
?
has this result:
Array(
1 = First Element,
2 = Second Element,
3 =
)
Can anyone give me an explanation for this? What is happening in the 
guts of the PHP interpreter when it gets these instructions?

With best regards
Gabriel Birke
--
KONTOR4_Neue Medien
Plathnerstraße 5
30175 Hannover
Fax: +49 51184 48 98 99
mailto:[EMAIL PROTECTED]
http://www.kontor4.de
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] POST superglobal is empty

2004-08-05 Thread Christophe Chisogne
Andy Loftus a écrit :
Does anyone have any ideas as to why $_POST would be empty when 
submitting a form to php?
I remember a post in this list about IE 6 not sending POST datas
some times (when reloading an html form).
If you use Mozilla or Firefox, the Livehttpheaders[1] extension
can help seeing what html headers are sent/received
So you can see if it's browser or server related.
Perhaps there's a strange setting in php.ini.
Add a 'phpinfo()' in your PHP code and search weird things
(you can also see there if POST is empty)
Hope it helps,
Christophe
[1] http://livehttpheaders.mozdev.org/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] need help with $HTTP_RAW_POST_DATA

2004-08-05 Thread PHPDiscuss - PHP Newsgroups and mailing lists
Hi all, 

I am using a Debian server with all stable packages so PHP is version
4.1.2 

I was developing a SyncML server and was using $HTTP_RAW_POST_DATA as a
receiving container for incoming SyncML communication from my Sony
Ericsson T-616. Recently finished writing the WBXML convertor and are
working with the SyncML engine. 

Everything was working fine until i wanted to try to update to PHP5, but
there aren't any officially unstable/experiment PHP5 from Debian. So i got
mine from DotDeb.org. 

Everything worked but then $HTTP_RAW_POST_DATA suddenly is not receiving
any data. I recall reading in the PHP manual that $HTTP_RAW_POST_DATA is
disabled, i enabled it by setting always_populate_raw_post_data = On. It
did not work, so i removed PHP5 and reinstalled the stable version of PHP
which is 4.1.2 

$HTTP_RAW_POST_DATA is still not receiving any data. I looked into PHP
4.1.2's php.ini file and didn't see any parameter setting for
always_populate_raw_post_data which is not surprising since the default
disable is only active after 4.2.0 

I added that line anyway and restarted Apache, still the
$HTTP_RAW_POST_DATA is not working. I know that XML RPC uses this global
variable for parsing XML data as well, so it should be empty. 

Anyone know what is going on and how to fix it? It was working fine before
i upgraded and then it was just broken after that. 

Since $HTTP_RAW_POST_DATA is going to be disabled by default, is there a
better variable to be used for receiving communication data? 

I noticed php://input but that's going to be changed to php://filter, but
i have never tried using that before either. So i have no idea how it
works. 

If anyone can help me reactivate $HTTP_RAW_POST_DATA or find a better way
to grab communication data, please HELP!! 

Thank you in advance 
Regards 
Mian

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



Re: [PHP] Barcode info anyone...

2004-08-05 Thread Torsten Rosenberger
hello



 I think that maybe the mouse cursor would be in a form field, scan the
 barcode and the data from the barcode reader would go into the form field of
 which I can issue a OnChange instruction, but I might be completely wrong.
the input field should have the focus 
(cursor must in the field, this can made with javascript)
a barcode read is programable, if you scan an barcode 
the reader converts the barcode into digits (EAN13 2012345678905)
this code is writen in the input field. if the scanner is programmed to
automatically add a enter (char 13 i think)  you have your submit.

i have scanners from Metrologic Orbit 
http://www.barcodeisland.com/ean13.phtml
http://www.strichcodeservice.at/andere_check_digits.htm
http://www.ean.co.at/

you easy test open notepad or under linux kwrite 
and scan 

br/torsten
 
 Any pointers, urls, advice, hardware suggestions (UK Based) very much
 welcome
 
 Thank you in advance for any help
 
 Dave Carrera
 
 
 -- 
 UK Web Hosting @ http://www.ephgroup.com  
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.733 / Virus Database: 487 - Release Date: 02/08/2004
  

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



[PHP] Re: References and array indexes

2004-08-05 Thread Ace
Gabriel Birke birke at kontor4.de writes:

 
 Hello!
 
 The following PHP code:
 ?
 $a = array(1=First Element, 2=Second Element);
 $v = $a['3'];
 print_r($a);
 ?
 has this result:
 
 Array(
   1 = First Element,
   2 = Second Element,
   3 =
 )
 
 Can anyone give me an explanation for this? What is happening in the 
 guts of the PHP interpreter when it gets these instructions?
 
 With best regards
 
 Gabriel Birke
 

Hi !

As you passed $a in reference while defining $v, the '3' index of $a was 
defined. Furthermore, you didn't at any time affect a value to that '3' index 
of $a, but it exists because he was invocated once...

So the result of your print_r isn't odd ;)

Maybe you know that very well and your question was infinitely more technical, 
but for that I can't answer anymore ;)

Ace

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



Re: [PHP] need help with $HTTP_RAW_POST_DATA

2004-08-05 Thread raditha dissanayake

Everything was working fine until i wanted to try to update to PHP5, but
there aren't any officially unstable/experiment PHP5 from Debian. So i got
mine from DotDeb.org. 
 

You could always copmpile from source.
Everything worked but then $HTTP_RAW_POST_DATA suddenly is not receiving
any data. I recall reading in the PHP manual that $HTTP_RAW_POST_DATA is
disabled, i enabled it by setting always_populate_raw_post_data = On. It
did not work, so i removed PHP5 and reinstalled the stable version of PHP
which is 4.1.2 
 

I am suprised that it ever worked for you. According to my understanding 
raw post data is available only if the content type is unrecognized by 
the php engine - assuming that you were infact using such a content type 
then it shouldn't stop working all of a sudden.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] File Uploading Issue

2004-08-05 Thread raditha dissanayake
PHP E-Mail List wrote:
Ok, I figured I'd tackle this since I've been coding php for about 6
months now. And wouldn't ya know, I'm having problems with, what I
thought would be the easiest thing to code ever.  Yeah well I get the
file to upload, and heck I can even take the file and display what text
was uploaded.

However when I go and try tio view the file in that directory. It says:

Forbidden
 

As jason has said this is a permission issue and probably related to 
your umask setting. It's unusual for a file not to have the +r settings 
but can happen. You can most often call the chmod() function to rectify 
this issue on your upload handler.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] problem solved (?)

2004-08-05 Thread Mark
Thanks very much, Curt.

I assumed (stupid me) that I needed to configure PHP 5 for mysqli but this was 
nonsense since I am using version 4.0 of MySQL.
Now I use php_mysql.dll in C:\PHP and only remove the ; from ;extension=php_mysql.dll
in php.ini. Sorry to have bothered you all with this.

! Still the problem remains that there is no mysqli equivalent for mysql_field_name

Regards,

Mark

Curt Zirzow [EMAIL PROTECTED] schreef in bericht news:[EMAIL PROTECTED]
 * Thus wrote Mark:
  I use MySQL: C:\mysql\binmysqladmin version status proc
  C:\MYSQL\BIN\MYSQLA~1.EXE  Ver 8.40 Distrib 4.0.20a, for Win95/Win98 on i32
  Copyright (C) 2000 MySQL AB  MySQL Finland AB  TCX DataKonsult AB
  This software comes with ABSOLUTELY NO WARRANTY. This is free software,
  and you are welcome to modify and redistribute it under the GPL license
 
 - php script implies you want to use mysqli_* stuff
 -  using msql_* module in your code
 - using 4.0.x mysql datase which which expects mysql_* module
 
 You should really straigten out those issues before you continue.
 
 
 Curt
 -- 
 First, let me assure you that this is not one of those shady pyramid schemes
 you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] Barcode info anyone...

2004-08-05 Thread Fernando Gutierrez
use JPGRAPH barcode class

On Thu, 5 Aug 2004 08:57:30 +0100, Dave Carrera [EMAIL PROTECTED] wrote:
 Hi List,
 
 I know I can generate  print barcodes in php for my app :-)
 
 But can I read the generated barcode into my php application and select the
 associated item and if so what do you have to do to get it working.
 
 I think that maybe the mouse cursor would be in a form field, scan the
 barcode and the data from the barcode reader would go into the form field of
 which I can issue a OnChange instruction, but I might be completely wrong.
 
 Any pointers, urls, advice, hardware suggestions (UK Based) very much
 welcome
 
 Thank you in advance for any help
 
 Dave Carrera
 
 --
 UK Web Hosting @ http://www.ephgroup.com
 
 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.733 / Virus Database: 487 - Release Date: 02/08/2004
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
-- Fernando Gutierrez Perez --
gmeileando un poco :)

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



[PHP] Getting data from table as a tree

2004-08-05 Thread pt2002
Hi

I have a table like this
id, pid, name. When a item has no parent, pid = 0. There is no limit in
depth.
1, 0, Test 1
2, 1, Test 1.1
3, 1, Test 1.2
4, 2, Test 1.1.1
5, 1, Test 1.3
6, 3, Test 1.2.1

I need to read this table and return an array that represents the tree.
Maybe using a recursive function but had no success.

I just need someone to point in the right direction.
TIA

Greets
pt2002

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



Re: [PHP] Passing user entered data to DB

2004-08-05 Thread Jordi Canals
John Holmes wrote:
$uservar = htmlspecialchars(strip_tags($uservar));
You don't need to use strip_tags _and_ htmlspecialchars()... unless you 
want strip_tags to get rid of such malicious and deadly content such as 
grin and wow. Just use htmlspecialchars().
Well, my idea was to apply both: I do not want to get any tag in the 
user input and prevent showing the html tags in the later output. For 
that I've applied strip_tags()

To apply htmlspecialchars() after that Is done to convert double quotes, 
and ampersand to html entities. Not appliying it has two efects: Strings 
with quotes does not show correct in input boxes. Strings with 
ampersands do not pass the W3C validator. And just to convert lt and gt 
signs when used alones like ... 5  2.

Just that are my reasons to apply both: Security and get a clean string.

$securevar = (magic_quotes_gpc) ? $uservar : addslashes($uservar);
$securevar = (get_magic_quotes_gpc()) ? $uservar : addslashes($uservar);
$securevar = $intval($uservar);
$securevar = intval($uservar);
Definetly, I should not code as late as night ;) My Samples where plenty 
of mistakes :p

Thanks for your comments,
Jordi
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Optimizing Tips

2004-08-05 Thread Vinayakam Murugan
Hello

I am a fresh PHP programmer and am part of a team developing a LAMP based 
website. The problem we are facing is that when the site was hosted on a 
local server, it was quite fast. Now that we have to use the internet to get 
to it, it has become very slow even keeping in mind considerations like 
connection speed . 

Any pointers on what  how optimizations can be done?

-- 
Warm Regards
~~~
Vinayakam Murugan

Tel: 91-22 - 2288 2163 Ext 121
Help Desk: 91-22 - 2288 2774
Fax Number: 91-22 - 2288 2809
Mobile : 022-31018082

http://www.TheArgonCompany.com

Viruses getting you down?
Get your virus protected mailbox at http://www.tassm.com

Linux. The Choice of the GNU generation

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



[PHP] using headers to download a file takes too long

2004-08-05 Thread Mark Cooke
Hi,
I'm writing a few scripts that allows users to download files,
some around 45MB+.
The files are stored outside the webroot, for security reasons,
so when the user clicks on the link, this called my downloadFile.php 
script, this script accesses the requested files, using the path 
relative to the top of the actual file system, then outputs the correct 
headers for the mimetype and file length (to assist in the download box 
status time), for small files, then  this is really quick and works 
great, yet for files from say 10MB or more, it takes around a minute 
before the download box even pops up.

I've tried using readfile and fread, to access the files, yet both seem 
to take the same amount of time, it would seem like they are getting 
buffered, or maybe read into memory, before they are allowed to be 
downloaded, basically I'm trying to reproduce the same effect of having 
the file in the webroot and creating a simple href to the actual file 
(using this method, would show the location of the files, this is what 
I'm trying to avoid).

Can anyone advise me on what I may be doing wrong,
code examples can be supplied if required.
Cheers in advance
Mark
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] problem solved (?)

2004-08-05 Thread Jay Blanchard
[snip]
! Still the problem remains that there is no mysqli equivalent for
mysql_field_name
[/snip]

As I had suggested earlier you could do a DESCRIBE `table` query and
loop through the column names returned.

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



RE: [PHP] Optimizing Tips

2004-08-05 Thread Jay Blanchard
[snip]
I am a fresh PHP programmer and am part of a team developing a LAMP
based 
website. The problem we are facing is that when the site was hosted on a

local server, it was quite fast. Now that we have to use the internet to
get 
to it, it has become very slow even keeping in mind considerations like 
connection speed . 

Any pointers on what  how optimizations can be done?
[/snip]

You still need to pay attention to image sizes, the amount of HTML or
XHTML code within pages and such. PHP would not likely be the cause of a
slowdown unless the code is 100's of lines long, which may introduce
some delays.

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



RE: [PHP] Optimizing Tips

2004-08-05 Thread Nicklas Bondesson
There are many things you can do to optimize speed on a website. First of
all you need to determine how many concurrent users you can handle on the
server you are hosting the website on. You have to take the following into
consideration: CPU, Memory, Disks, Network etc. You can gain relatively much
performance let's say if you have much disk I/O activity if you switch from
IDE to SCSI disks. 

Let's say you can handle 1500 concurrent users on this server you are
running the site on but in fact there are 3000 users trying to access the
site at the same time, the requests will then be queued and the site will be
experienced as very slow. What you can do here is to add another server and
loadbalance the load between the two servers or you can setup a web cache in
front of the server to take the initial requests.

Also the Internet capacity plays a big part in the overall site performance.
You should have a bit more bandwith capacity that your users will use
because of the overload in the TCP/IP communication.

I hope this can give you a direction in the right way.

Nicke

-Original Message-
From: Vinayakam Murugan [mailto:[EMAIL PROTECTED] 
Sent: den 5 augusti 2004 12:48
To: [EMAIL PROTECTED]
Subject: [PHP] Optimizing Tips

Hello

I am a fresh PHP programmer and am part of a team developing a LAMP based
website. The problem we are facing is that when the site was hosted on a
local server, it was quite fast. Now that we have to use the internet to get
to it, it has become very slow even keeping in mind considerations like
connection speed . 

Any pointers on what  how optimizations can be done?

--
Warm Regards
~~~
Vinayakam Murugan

Tel: 91-22 - 2288 2163 Ext 121
Help Desk: 91-22 - 2288 2774
Fax Number: 91-22 - 2288 2809
Mobile : 022-31018082

http://www.TheArgonCompany.com

Viruses getting you down?
Get your virus protected mailbox at http://www.tassm.com

Linux. The Choice of the GNU generation

--
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] Re: Getting data from table as a tree

2004-08-05 Thread Torsten Roehr
Pt2002 [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi

 I have a table like this
 id, pid, name. When a item has no parent, pid = 0. There is no limit in
 depth.
 1, 0, Test 1
 2, 1, Test 1.1
 3, 1, Test 1.2
 4, 2, Test 1.1.1
 5, 1, Test 1.3
 6, 3, Test 1.2.1

 I need to read this table and return an array that represents the tree.
 Maybe using a recursive function but had no success.

 I just need someone to point in the right direction.
 TIA

 Greets
 pt2002

Hi,

those two PEAR packages might help you:
http://pear.php.net/package/DB_NestedSet
http://pear.php.net/package/Tree

Regards, Torsten Roehr

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



Re: [PHP] Optimizing Tips

2004-08-05 Thread Alister Bulman
On Thu, 5 Aug 2004 16:17:34 +0530, Vinayakam Murugan
[EMAIL PROTECTED] wrote:
 I am a fresh PHP programmer and am part of a team developing a LAMP based
 website. The problem we are facing is that when the site was hosted on a
 local server, it was quite fast. Now that we have to use the internet to get
 to it, it has become very slow even keeping in mind considerations like
 connection speed .
 Any pointers on what  how optimizations can be done?

How big are the pages you are sending around?  How much data are you
getting from external sources (like a mysql database or draged in from
other sites).  How fast is the ilnk from the webserver?  There's a lot
of good questions you can ask to figure it out.

For the first, you can trim the html and images you are sending, and
gzip the output (see mod_gzip or http://php.net/ob_gzhandler

Alister

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



Re: [PHP] Optimizing Tips

2004-08-05 Thread Umesh Deshmukh
Hi,

Please check if
1) you have used recordsets, you have closed it at proper places.
2) connection objects are closed or not.

These are some of the things in case of PHP.

While coding , pls. follow. to open only one connection with the database.

Regards,

Umesh.
- Original Message -
From: Vinayakam Murugan [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 05, 2004 4:17 PM
Subject: [PHP] Optimizing Tips


 Hello

 I am a fresh PHP programmer and am part of a team developing a LAMP based
 website. The problem we are facing is that when the site was hosted on a
 local server, it was quite fast. Now that we have to use the internet to
get
 to it, it has become very slow even keeping in mind considerations like
 connection speed .

 Any pointers on what  how optimizations can be done?

 --
 Warm Regards
 ~~~
 Vinayakam Murugan

 Tel: 91-22 - 2288 2163 Ext 121
 Help Desk: 91-22 - 2288 2774
 Fax Number: 91-22 - 2288 2809
 Mobile : 022-31018082

 http://www.TheArgonCompany.com

 Viruses getting you down?
 Get your virus protected mailbox at http://www.tassm.com

 Linux. The Choice of the GNU generation

 --
 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



Re: [PHP] Getting data from table as a tree

2004-08-05 Thread Burhan Khalid
pt2002 wrote:
Hi
I have a table like this
id, pid, name. When a item has no parent, pid = 0. There is no limit in
depth.
1, 0, Test 1
2, 1, Test 1.1
3, 1, Test 1.2
4, 2, Test 1.1.1
5, 1, Test 1.3
6, 3, Test 1.2.1
I need to read this table and return an array that represents the tree.
Maybe using a recursive function but had no success.
http://pear.php.net/package/Tree
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] What does \\0 means?

2004-08-05 Thread Jay
Hi!
Found the following code in the PHP manual:
$text = http://www.somelink.com;;
echo(ereg_replace([[:alpha:]]+://[^[:space:]]+[[:alnum:]/],
a href=\\\0\\\0/a, $text));
What does \\0 means, i have seen this before with \\1 and \\2
what does they mean?
Thanx In Advance
Jay
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] MySql Tables

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 08:51, DIFF FanneHH offered up the following 
tid-bit of information :
  How many records can be in a MyIsam table?
 Thanks

I'm sure they could tell you on the MySQL mailing list.

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Optimizing Tips

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 06:47, Vinayakam Murugan offered up the following 
tid-bit of information :
 Hello

 I am a fresh PHP programmer and am part of a team developing a LAMP based
 website. The problem we are facing is that when the site was hosted on a
 local server, it was quite fast. Now that we have to use the internet to
 get to it, it has become very slow even keeping in mind considerations
 like connection speed .

 Any pointers on what  how optimizations can be done?

Developing it locally, you were probably *at least* on a 10-Base 
network...that's going to fly compared to accessing it over the web (unless 
you're on a OC12 or something ;)  Two, developing it locally, your team was 
probably the only people hitting the box, so if you now have it hosted on a 
shared server, the 'live' box is taking more traffic.  Three, hardware?  
Chances are, this has very little to do with php/html.

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] What does \\0 means?

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 10:03, John W. Holmes offered up the following 
tid-bit of information :
 oo.ooo... can I do it?? ;)

 \\0 is actually the entire string that was matches. \\1 would be the
 first parenthesized substring, \\2 the second, etc.

 Don't worry, I had to look in the manual to be sure, too. :)

 ---John Holmes...

Damn!  I almost had it.  *L*

One of these days I'll look at that manual thing y'all keep talking about.

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Re: str_replace() problem in PHP5 - RESOLVED

2004-08-05 Thread Jon Bertsch
Curt and Justin,
Thanks for the ideas. I resolved this by removing the str_replace() call 
from within a function that I was calling and running it in-line in the 
code. Since the html string was less than 500 char it seems unlikely that 
it was memory but that's also about the only thing that would be different 
between prod and dev environments so that's the best candidate for causing 
the problem (php.ini set at default 8M). There were no error messages at 
all, the script would just end and the logs showed nothing at all, as if it 
was never even called.

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


[PHP] Browsers on terminal server

2004-08-05 Thread Lester Caine
I am using
$_SERVER[REMOTE_ADDR]
to get address of the browser accessing the system and then using
gethostbyaddr() to get the machine name.
This worked great until I came to a site using M$ Terminal Server to 
provide the terminals. We still need to know what machine we are talking 
to, so we can identify the room, and flag the correct set of displays, 
but $_SERVER[REMOTE_ADDR] seems to be giving only the IP address of 
the TS machine.

Anybody been here already. Is it possible to identify the terminal that 
is browsing on the other side of TS. Any pointers to some help to 
restore operation in this situation.

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Branching blunder

2004-08-05 Thread Alex Hogan
 
[snip]
 Because $answers = 5; is the last check of $answers unless 
 the else statement is invoked. Try this...
[/snip]

That was it.., I don't know why I didn't see that.


Thanks Jay.


alex
*
The contents of this e-mail and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom it is addressed. The 
views stated herein do not necessarily represent the view of the company. If you are 
not the intended recipient of this e-mail you may not copy, forward, disclose, or 
otherwise use it or any part of it in any form whatsoever. If you have received this 
e-mail in error please e-mail the sender. 
*

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



[PHP] Need Some Direction

2004-08-05 Thread Aaron Todd
Hello,

I am trying to build up a members only site, but I need some direction.  So
far I have written a page that will let a user register for access.  That
script emails me their info so I can validate it, sends them a thankyou
email and then sends the data to a temporary MySQL database table.  In the
email that I get I created two links.  One will send the user an acceptance
email and put their info in a final database table.  The other will send the
user a Deny email and will delete their info from the temporary database
table.

I have also created a login script that will ask for a username and password
and verify it with the database.  If its all correct then it will redirect
you to a restricted page.

The direction I need is how do I go about restricting access to the members
only pages?  I have been reading up on sessions, which I think will be a
cool addition to this site, but I still havent found much on restrictin
access without a username and password.  Currently my login and registration
pages are located in the root of the domain.  The all the members only pages
are in a directory called /members/.

Can anyone give me some direction on how I should go about all this.

Thanks,

Aaron

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



[PHP] Re: JavaScript Enabled?

2004-08-05 Thread Kim Steinhaug
Indeed an old thread this one, but I still would like to know if someone
have
some input on some ways of solving this dilemma.

Surely it is easy to detect javascript when its enabled, but what to do when
it's
not enabled is a much more interesting approach. I have several systems
online
which (maby from old habits) heavily depends on javascript functionality.
Surely
I could easily remove all javascript and do all processing and validation
serverside,
but in my honest opinion I see no practical reason to ignor javascript in
any
application. The benefits of using java is far greater than the problems.

SOLLUTION 1 - DETECTING THE CLIENT
I would think that if we set a meta refresh to the noscript.htm and an
onload javascript
to switch to script.htm we could from theese pages set some session
variables if the
user has script or not. However this redirecting of pages is kinda silly I
think, and I
would like to think that there are other ways of doing this? Let us not
forget that
search engines would just love this sollution on our frontpage...  Surely we
could add
this code and refresh the same page with ?jave=false or ?java=true, but for
some
reason I dont like this sollution. Meta refresh is bad.

ALTERNATIVE SOLLUTION - POSSIBLE?
Hoping someone has already solved this Im throwing some thoughts here. Since
I use the session variable on all my pages, I could also create a fake gif
spacer
from a php script (eg. spacer.gif.php, which eventually spits out the gif
but lets me
do some stuff meanwhile at first). This gif could be called from javascript
document write.
A 1x1 spacer, which if I call this gif would mean that javascript would
work,
and if this script is triggered I could update the session with eg.
script=true;
Which would make me know if the user has it enabled or not?

Atleast this sounds logical in my head, aslong as I dont need to alert the
user
at once if hes got enabled java or not. This approach would mean that I can
alert the user with whatever HTML code from PHP I would want after eg.
3 pageviews, since he would surely have the triggered the dopcument.write by
then.
(Ofcourse if he has deactivated images aswell we have problems but hey... )

Alot of nothing here really, but maby someone have some thoughts on the
matter.

-- 
Kim Steinhaug
-
There are 10 types of people when it comes to binary numbers:
those who understand them, and those who don't.
-
www.steinhaug.com - www.easywebshop.no - www.easycms.no www.webkitpro.com
-


Richard Davey [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi all,

 Can anyone suggest a suitable means for detecting if a client browser
 has JavaScript enabled or not?

 I know this isn't exactly PHP related, but I need to make sure my PHP
 script offers an alternative in a friendly way and not a JS error, but
 I just wondered if there was a foolproof method of doing this?

 -- 
 Best regards,
  Richard Davey
  http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Browsers on terminal server

2004-08-05 Thread John W. Holmes
From: Lester Caine [EMAIL PROTECTED]
 I am using
 $_SERVER[REMOTE_ADDR]
 to get address of the browser accessing the system and then using
 gethostbyaddr() to get the machine name.

 This worked great until I came to a site using M$ Terminal Server to
 provide the terminals. We still need to know what machine we are talking
 to, so we can identify the room, and flag the correct set of displays,
 but $_SERVER[REMOTE_ADDR] seems to be giving only the IP address of
 the TS machine.

 Anybody been here already. Is it possible to identify the terminal that
 is browsing on the other side of TS. Any pointers to some help to
 restore operation in this situation.

I really doubt it. I'd recommend searching MSDN for some answers. If it was
available to PHP, you'd see it on a phpinfo() screen or somewhere in
$_SERVER, but I doubt it is.

---John Holmes...

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



Re: [PHP] What does \\0 means?

2004-08-05 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED]
On Thursday 05 August 2004 07:39, Jay offered up the following tid-bit of
information :
 Found the following code in the PHP manual:
 $text = http://www.somelink.com;;
 echo(ereg_replace([[:alpha:]]+://[^[:space:]]+[[:alnum:]/],
  a href=\\\0\\\0/a, $text));

 What does \\0 means, i have seen this before with \\1 and \\2

 Well, I'm not much of a ereg guy...more preg, but if I had to take a
guess,
 the \\0 in ereg is like $1 in perl regular expressions.  ie it's replacing
 the \\0 with the first match found in the expression.  Run the
script...I'm
 betting it will out put...

 a href=http://www.somelink.com;http://www.somelink.com/a

 Course, if I'm wrong, someone on the list will be quick to lay the smack
 down on me, and you'll get the correct answer. ;)

oo.ooo... can I do it?? ;)

\\0 is actually the entire string that was matches. \\1 would be the first
parenthesized substring, \\2 the second, etc.

Don't worry, I had to look in the manual to be sure, too. :)

---John Holmes...

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



Re: [PHP] Need Some Direction

2004-08-05 Thread Jason Davidson
I created a simpleAuth script that handles authentication, then sets up
a session, there is a method that i called requireAuth();  i call this
method on any page i want restricted to the members, it checks the for
the valid sessoin, and also checks the time of login, and calls my
destoy method if user is over an hour logged in.   if not valid
session, or over the time limit, headers to some page and gives
appropriate error message to user.

Jason

Aaron Todd [EMAIL PROTECTED] wrote: 
 
 Hello,
 
 I am trying to build up a members only site, but I need some direction.  So
 far I have written a page that will let a user register for access.  That
 script emails me their info so I can validate it, sends them a thankyou
 email and then sends the data to a temporary MySQL database table.  In the
 email that I get I created two links.  One will send the user an acceptance
 email and put their info in a final database table.  The other will send the
 user a Deny email and will delete their info from the temporary database
 table.
 
 I have also created a login script that will ask for a username and password
 and verify it with the database.  If its all correct then it will redirect
 you to a restricted page.
 
 The direction I need is how do I go about restricting access to the members
 only pages?  I have been reading up on sessions, which I think will be a
 cool addition to this site, but I still havent found much on restrictin
 access without a username and password.  Currently my login and registration
 pages are located in the root of the domain.  The all the members only pages
 are in a directory called /members/.
 
 Can anyone give me some direction on how I should go about all this.
 
 Thanks,
 
 Aaron
 
 -- 
 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] reading filesize on remote server

2004-08-05 Thread Tobias Grønlund
Im having a problem reading filesizes on a remote server, hven only 
having the domainname, and not the exact filename.
(i want to use it to read the filesize and thereby the downloadtime of 
the html-file, and it all schould happen automaticly when someone writes 
the domainname at my webpage) )

i've tried this:
$filename = 'http://www.example.com';
$fp = fopen($filename, r);
$size = filesize($filename);
echo $size;
fclose($fp);
but it only returns this error:
Warning: filesize(): Stat failed for http://www.example.com (errno=2 - 
No such file or directory)

WHAT AM I DOING WRONG???
Tobias, Denmark
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Optimizing Tips

2004-08-05 Thread Nicklas Bondesson
The Zend Optimizer only caches the compiled PHP output (HTML content) that
should be sent to your client. You can always try it but I don't think you
will gain that much on using it. It's worth trying though.

Nicke 

-Original Message-
From: Vinayakam Murugan [mailto:[EMAIL PROTECTED] 
Sent: den 5 augusti 2004 14:09
To: Nicklas Bondesson
Subject: Re: [PHP] Optimizing Tips

On Thursday 05 Aug 2004 5:29 pm, you wrote:
 Will the majority of the visitors surf from within India? I think I 
 will experience the site more slow than anyone from India. I'm surfing 
 from Sweden and the Internet connection to India is not that good.

 I can always take a look inside the server if you give me an account to
it.

 Nicke

True. That could be a factor.

I'm sorry but I am not authorized to part with my account details. Thanks
for asking though.

Would trying an optimizer like Zend help?

--
Warm Regards
~~~
Vinayakam Murugan

Tel: 91-22 - 2288 2163 Ext 105
Fax Number: 91-22 - 2288 2809
Mobile : 91-22-3101 8082

http://www.TheArgonCompany.com

Viruses getting you down?
Get your virus protected mailbox at http://www.tassm.com

Linux. The Choice of the GNU generation

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



Re: [PHP] Optimizing Tips

2004-08-05 Thread Brent Baisley
All things being equal as your test environment (i.e. hardware, load), 
the big difference is latency on the network. You may have designed 
your application to echo code to the client as you create it. This 
may cause lots of small network packets which will slow things down 
considerably. You should build your web page and then send it all at 
once, either through output buffering or by storing everything in a 
variable and echoing the variable at the end. This also allows you to 
take advantage of compression available in the HTTP 1.1 spec. Try and 
get you code so that a single line delivers the whole page to the 
client.

Think of it as someone saying repeat after me. Then they proceed to 
say one word at a time, waiting for you to say the word before they 
move onto the next one. There is a lot of latency, pauses between words 
and response, in that technique.

On Aug 5, 2004, at 6:47 AM, Vinayakam Murugan wrote:
Hello
I am a fresh PHP programmer and am part of a team developing a LAMP 
based
website. The problem we are facing is that when the site was hosted on 
a
local server, it was quite fast. Now that we have to use the internet 
to get
to it, it has become very slow even keeping in mind considerations like
connection speed .

Any pointers on what  how optimizations can be done?
--
Warm Regards
~~~
Vinayakam Murugan
Tel: 91-22 - 2288 2163 Ext 121
Help Desk: 91-22 - 2288 2774
Fax Number: 91-22 - 2288 2809
Mobile : 022-31018082
http://www.TheArgonCompany.com
Viruses getting you down?
Get your virus protected mailbox at http://www.tassm.com
Linux. The Choice of the GNU generation
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search  Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: POST superglobal is empty

2004-08-05 Thread AJL
Not a dumb idea, I have tried that with no success.   Thanks for the
ideas.  Keep 'em coming.  I recall seeing a conversation somewhere
(php bugs, I think) that there is a function to call that will return
the raw input from stdin.  Anyone know what that function is?
--
Andy

On Thu, Aug 05, 2004 at 02:46:48PM +1000, Paul Birnstihl wrote:
 Might be a dumb idea but have you tried putting method=POST instead of 
 method=post ?
 
 
 Andy Loftus wrote:
  Does anyone have any ideas as to why $_POST would be empty when 
  submitting a form to 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



Re: [PHP] Passing user entered data to DB

2004-08-05 Thread John W. Holmes
From: Jordi Canals [EMAIL PROTECTED]
 John Holmes wrote:

  $uservar = htmlspecialchars(strip_tags($uservar));
 
  You don't need to use strip_tags _and_ htmlspecialchars()... unless you
  want strip_tags to get rid of such malicious and deadly content such as
  grin and wow. Just use htmlspecialchars().

 Well, my idea was to apply both: I do not want to get any tag in the
 user input and prevent showing the html tags in the later output. For
 that I've applied strip_tags()

 To apply htmlspecialchars() after that Is done to convert double quotes,
 and ampersand to html entities. Not appliying it has two efects: Strings
 with quotes does not show correct in input boxes. Strings with
 ampersands do not pass the W3C validator. And just to convert lt and gt
 signs when used alones like ... 5  2.

 Just that are my reasons to apply both: Security and get a clean string.

There's no added security by using strip_tags and you're just removing
content that the user wanted to include. I guess it depends upon what this
text is. If you apply htmlspecialchars() to a string that contains HTML,
Javascript code, etc, the code will not be evaluated, so there is no
security risk.

I don't know what the purpose of the text your recieving is, but if I
entered Use an img tag for that and you stripped out img, it would
suck. If you just applied htmlspecialchars(), then when you redisplayed my
text, either in regular HTML or in a text box, then you'd see exactly what I
entered. The img text would not be evaluated as HTML and no actual image
box would be shown.

If you can't tell, I _hate_ the strip_tags function as it needlessly removes
content and the allowable_tags gives a false sense of security.

---John Holmes...

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



Re: [PHP] Outputting Data

2004-08-05 Thread Harlequin
Jay.

Strange behaviour.

My ISP seems to allow me to download messages intermittently but can reply
to all anytime I like. However, If I can't download I can bloody well reply.

Guess who the ISP is...? NTL...!

I'm talking to my ISP about directory access, seems the problem with
outputting that file resides there mate.

thanks again. :)

-- 
-
 Michael Mason
 Arras People
 www.arraspeople.co.uk
-
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
I will post replies to the list once I can access it - for some reason
my
ISP is crap.
[/snip]

Your Reply To All doesn't work on your e-mail client?

[snip]
I think the problem resides with directory access which I am sorting out
right now.
[/snip]

Let me know, I am glad to help if I can.

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



[PHP] How pass form variable to window.open()

2004-08-05 Thread CHAN YICK WAI
Hi,

Anyone can tell if, inside php script, I can pass form variable to the
javascript window.open() call?

That is,

in the form, for example, i have input type=text.. name=student ...

and input type=button onClick=window.open('url?student=$student', )

It seems to me not working.

Thanks, Yw

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



[PHP] Re: Need Some Direction

2004-08-05 Thread Bogdan Ribic
 I have been reading up on sessions, which I think will be a
cool addition to this site, but I still havent found much on restrictin
access without a username and password.  
Sounds like you need to use cookies, check php manual if you don't know 
what they are.

Boban
--
Please answer to the list and not to my email directly.
I use usenet server and do not check yahoo email account.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How pass form variable to window.open()

2004-08-05 Thread John W. Holmes
From: CHAN YICK WAI [EMAIL PROTECTED]

 in the form, for example, i have input type=text.. name=student ...

 and input type=button onClick=window.open('url?student=$student', )

 It seems to me not working.

Define not working because that's how you do it. Well, actually, you need
to echo $student, unless this whole thing is already in an echo

---John Holmes...

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



[PHP] Re: Need Some Direction

2004-08-05 Thread Torsten Roehr
Aaron Todd [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello,

 I am trying to build up a members only site, but I need some direction.
So
 far I have written a page that will let a user register for access.  That
 script emails me their info so I can validate it, sends them a thankyou
 email and then sends the data to a temporary MySQL database table.  In the
 email that I get I created two links.  One will send the user an
acceptance
 email and put their info in a final database table.  The other will send
the
 user a Deny email and will delete their info from the temporary database
 table.

 I have also created a login script that will ask for a username and
password
 and verify it with the database.  If its all correct then it will redirect
 you to a restricted page.

 The direction I need is how do I go about restricting access to the
members
 only pages?  I have been reading up on sessions, which I think will be a
 cool addition to this site, but I still havent found much on restrictin
 access without a username and password.  Currently my login and
registration
 pages are located in the root of the domain.  The all the members only
pages
 are in a directory called /members/.

 Can anyone give me some direction on how I should go about all this.

 Thanks,

 Aaron

Hi Aaron,

you might want to take a look at PEAR's LiveUser:
http://pear.php.net/package/LiveUser

Takes a bit of time to set up but should be exactly what you are looking
for. It handles user authentication (login), session timeout and user
rights.

Regards, Torsten Roehr

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



RE: [PHP] How pass form variable to window.open()

2004-08-05 Thread Jay Blanchard
[snip]
Anyone can tell if, inside php script, I can pass form variable to the
javascript window.open() call?

That is,

in the form, for example, i have input type=text.. name=student ...

and input type=button onClick=window.open('url?student=$student', )

It seems to me not working.
[/snip]

You have to echo or print the sJavaScript statement with PHP, 

print(input type=\button\
onClick=\window.open('url?student=$student', )

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



Re: [PHP] Need Some Direction

2004-08-05 Thread Miles Thompson
Aaron,
The way to do it is to have an authentication page where users log in.  A 
successful login starts the session, on each subsequent page test for the 
session and if it is not present, redirect to the login page. This test is 
just one line at the top of each page you want to protect.

This way if someone comes to a members page through something like Google, 
they will be redirected automatically to the login page.

Trust this his helpful - Miles Thompson
At 11:42 AM 8/5/2004, Aaron Todd wrote:
Hello,
I am trying to build up a members only site, but I need some direction.  So
far I have written a page that will let a user register for access.  That
script emails me their info so I can validate it, sends them a thankyou
email and then sends the data to a temporary MySQL database table.  In the
email that I get I created two links.  One will send the user an acceptance
email and put their info in a final database table.  The other will send the
user a Deny email and will delete their info from the temporary database
table.
I have also created a login script that will ask for a username and password
and verify it with the database.  If its all correct then it will redirect
you to a restricted page.
The direction I need is how do I go about restricting access to the members
only pages?  I have been reading up on sessions, which I think will be a
cool addition to this site, but I still havent found much on restrictin
access without a username and password.  Currently my login and registration
pages are located in the root of the domain.  The all the members only pages
are in a directory called /members/.
Can anyone give me some direction on how I should go about all this.
Thanks,
Aaron
--
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


Re: [PHP] MySql Tables

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 08:58, Jay Blanchard offered up the following 
tid-bit of information :
 [snip]
 How many records can be in a MyIsam table?
 [/snip]

 Bazillions. Only limited by your storage capacity and ability to manage
 large sets of records.

Now wait a minute, my table hit a wall after a gazillion records. ;)

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Need Some Direction

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 10:42, Aaron Todd offered up the following 
tid-bit of information :
snip
 The direction I need is how do I go about restricting access to the
 members only pages?  I have been reading up on sessions, which I think
 will be a cool addition to this site, but I still havent found much on
 restrictin access without a username and password.  Currently my login
 and registration pages are located in the root of the domain.  The all
 the members only pages are in a directory called /members/.

 Can anyone give me some direction on how I should go about all this.
snip

When a user logs in successfully, you could set a session variable (move on 
to cookies if you want them to be able to 'remember' their login) like 
$_SESSION['loggedin'] = true;  Then, in every page in your members section 
(use an include file), do something like this before any output to the 
browser

if ( ! isset ( $_SESSION['loggedin'] ) || ! $_SESSION['loggedin'] ) {
header ( Location : /unauthorized.php );
exit;
}

-- 
John C. Nichel
berGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] Branching blunder

2004-08-05 Thread Ford, Mike [LSS]
On 05 August 2004 15:15, Jay Blanchard wrote:

 [snip]
 if($ans_three[$qzid] === 'None of the above' || $ans_three[$qzid] ===
'All of the above'){ if($ans_four[$qzid] === 'None of the above'
   || $ans_four[$qzid] === 'All of the above'){
 $answers  =   rand(6,8); 
 
}
$answers   =   5;
 }
 else{
$answers   =   rand(1,4);
 }
 
 However when I run it, it checks everything correctly until it has
 answer three and four having 'All of the above' and 'None of
 the above',
 then it branches to $answer = 5, only.  Why?
 [/snip]
 
 Because $answers = 5; is the last check of $answers unless the else
 statement is invoked. Try this...
 
 if($ans_three[$qzid] === 'None of the above' || $ans_three[$qzid] ===
'All of the above'){ if($ans_four[$qzid] === 'None of the above'
   || $ans_four[$qzid] === 'All of the above'){
$answers   =   rand(6,8); } elseif($ans_four[$qzid] !== 'None of
the
 above' || $ans_four[$qzid] !== 'All of the above'){

Ehhhrrrmmm -- that elseif () condition is always going to be true:
logically, it's got to be not equal to one or other of the values.

From a quick glance at the code, I'd say just a straight else would do the
job here, thus:

  if ($ans_three[$qzid] === 'None of the above'
  || $ans_three[$qzid] === 'All of the above')
  {
if ($ans_four[$qzid] === 'None of the above'
|| $ans_four[$qzid] === 'All of the above')
{
  $answers = rand(6,8);
}
else
{
  $answers = 5;
}
  }
  else
  {
$answers = rand(1,4);
  }

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
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



RE: [PHP] How pass form variable to window.open()

2004-08-05 Thread Jason Davidson
Unless student is set somewhere else that wont work.. you need the form
to submit before the text field 'student' sets a var named student. 
One way to do such, without all the window formating is to just submit
the form to the page you want. and target=_new in the form tag.  

other than that, you must use javascript to grab the data from the
textfield, then use window.open() ..create  a javascript method called
openwin or something that gets called OnClick on your button.

function openWin() {
   student = document.Form.Student.value;
   win = open('yourpage.html?student=' + student, 'Title',
'width=45,height=34');
win.focus();
}

Jay Blanchard [EMAIL PROTECTED] wrote: 
 
 [snip]
 Anyone can tell if, inside php script, I can pass form variable to the
 javascript window.open() call?
 
 That is,
 
 in the form, for example, i have input type=text.. name=student ...
 
 and input type=button onClick=window.open('url?student=$student', )
 
 It seems to me not working.
 [/snip]
 
 You have to echo or print the sJavaScript statement with PHP, 
 
 print(input type=\button\
 onClick=\window.open('url?student=$student', )
 
 --
 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] dynamic RAM file for real media

2004-08-05 Thread Daniel Guerrier
I am using PHP to dynamically create real audio links.
The question is I was creating one .ram file for each
real media file that I wanted to stream.  The .ram
files need to have absolute urls (which I do not
like).  I saw a few sites that use one .ram file but
pass it a variable http://url.ram?id=555.

Has anyone done this?
If so, how?



__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

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



Re: [PHP] How pass form variable to window.open()

2004-08-05 Thread CHAN YICK WAI
How about if this $student is actually a text field, when this html
generated by php script, it has no value, so the onClick line is
...url?student=$student without value, when I click, it reads nothing, how
should I do?

thanks again, Yw


- Original Message - 
From: John W. Holmes [EMAIL PROTECTED]
To: CHAN YICK WAI [EMAIL PROTECTED]; 
Sent: Thursday, August 05, 2004 11:06 PM
Subject: Re: [PHP] How pass form variable to window.open()


 From: CHAN YICK WAI [EMAIL PROTECTED]

  in the form, for example, i have input type=text.. name=student ...
 
  and input type=button onClick=window.open('url?student=$student', )
 
  It seems to me not working.

 Define not working because that's how you do it. Well, actually, you
need
 to echo $student, unless this whole thing is already in an echo

 ---John Holmes...


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



Re: [PHP] Location header does not work?

2004-08-05 Thread Bing Du
I really appreciate everyone who responded taking your valuable time
looking into my problem.

Now back to my problem.  Changing the condition to if($_SERVER['HTTPS']
!= 'on') did not make any difference unfortunately. So the result was
still the URL in the Address box of the browser changed to
https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewid=159Itemid=162
fine.  But instead of showing the page that https address should point to,
'You are in HTTPS mode' was displayed as the else clause specified.

Bing

 On Wed, 4 Aug 2004 17:02:30 -0500 (CDT), Bing Du [EMAIL PROTECTED] wrote:
 Ok, now I'm confused and cannot understand the result of the following
 code snippet.  After click the link that I want to redirect, the URL in
 the Address box of the browser changed from http to https fine (that's
 what I expected).  But 'hello my friend' was also displayed.  How come?

  if ($option == 'content' and $task == 'view' and $id ==
 159 and $Itemid = 162)
 {
session_write_close();

if (!isset($_SERVER['HTTPS']))
{
 header(Location:
 https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewid=159Itemid=162;);
} else {
  echo 'hello my friend';
   }
 =if ($option == 'content' and $task == 'view' and $id == 159
 and
 $Itemid == 162) {
   if($_SERVER['HTTPS'] != 'on') {
 header('Location: https://computing.eng.iastate.edu/mambo/index.php'.
   '?option=contenttask=viewid=159Itemid=162');
   } else {
 echo 'You are in HTTPS mode.';
 //do stuff
   }
 }


 Bing


  On Tue, 3 Aug 2004 15:34:27 -0500 (CDT), Bing Du [EMAIL PROTECTED]
 wrote:
  The latest message I got was 'Redirection limit for this URL
 exceeded.
  Unable to load the requested page.This may be caused by cookies that
 are
  blocked.'.
 
 
  Your page is redirecting you over and over again. Your problem is that
  you're not checking for https before you redirect! If the user comes
  in with the https URL, you're still redirecting them. Try checking the
  value of $_SERVER['HTTPS'].
 
  Bing
 
 
 
   On Tuesday 03 August 2004 15:41, Bing Du offered up the following
  tid-bit
   of
   information :
   I've been struggling with this redirect thing for a while but
 still
   cannot get it work.  I'm desperately needing help, please.
  
   What I want to do is redirect
   http://computing.eng.iastate.edu/mambo/index.php?option=contenttask=view
  id=159Itemid=162 to
   https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=vie
  wid=159Itemid=162. The only difference between the above two URLs
 is
   one
   is http and the other is https.
  
   = if ($option == 'content' and $task == 'view' and $id =
  159
   and $Itemid
   == 162)
   {
 session_write_close();
 header(Location:
   https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=vie
  wid=159Itemid=162); exit;
   }
   =
   Am I doing anything wrong with the Location header?
  
   What's the error?  Is it just not forwarding?  Headers already
 sent?
  
   --
   John C. Nichel
   ÜberGeek
   KegWorks.com
   716.856.9675
   [EMAIL PROTECTED]
  
  
 
 
  --
  DB_DataObject_FormBuilder - The database at your fingertips
  http://pear.php.net/package/DB_DataObject_FormBuilder
 
  paperCrane --Justin Patrin--
 

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

 !DSPAM:41115ae5170651561813149!




 --
 DB_DataObject_FormBuilder - The database at your fingertips
 http://pear.php.net/package/DB_DataObject_FormBuilder

 paperCrane --Justin Patrin--


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



[PHP] Log transaction for audit

2004-08-05 Thread CHAN YICK WAI
Hi,

I'm writing an application that requires log every transactions users done,
e.g. update which record, delete which record, something like that.

I guess one way is whenever I issue a mysql_query(), I also insert this
query in whole into another table together with the user name, so I can log
and retrieve it out for audit.

Will you have that kind of experience? How can I do it comprehensively, e.g.
no too big additional coding effort, easy to manage, reliable, etc.

I'm using MySQL.



Thank for your sharing, Yw

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



[PHP] Why do I keep getting a 501 mail error?

2004-08-05 Thread Brian Dunning
Developing on a Windows server to be deployed on Linux. I get SMTP 
server response: 501 Bad address syntax. Here's my code:

$mail_from = 'My Name [EMAIL PROTECTED]';
$mail_server = 'mail.servername.com'; // This is hosted externally
ini_set(SMTP, $mail_server);
ini_set(sendmail_from, $mail_from);
$mail_to = $first_name $last_name $email;
mail($mail_to, Here is my subject, Please click this link to 
activate your  account:\n\n$http_root.owner.php?id=$entry_code, To: 
$mail_to\nFrom: $mail_from\nContent-type: text/plain\nMailer: 
PHP/.phpversion());

I read about trying \r\n instead of \n in the headers, but it didn't 
seem to make any difference, and \n is working on other mail actions on 
this same server.

Thanks for any clues...  :)
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] apache/php: chunk is already free, page is already free

2004-08-05 Thread Ergin Aytac
We made a test for only 20 min. and got our website online. The result 
was 200.000.000 (!!) lines in apache error log with the following:

httpd in free(): warning: chunk is already free.
httpd in free(): warning: page is already free.
httpd in free(): warning: recursive call.
the requests were only made by myself (30 times).
letting the website online for 4 hours produced an apache error log of 
21 GB !!! and some zero sized responses from apache :)

using openbsd 3.2, apache 1.3.26 and php 4.2.3.
the website is a forum using phorum.org software and has a mysql 
database (about 300 MB)

after googling about this I know that only a few people have the same 
problem but couldn't solve it. Most of them say, that this is a memory 
issue of php (some of them used older versions like php 4.0.6). I also 
dont think that the problem is because of phorum.org software, apache or 
mysql. Maybe openbsd?

on the same server there are a lot of other hostings without any problems.
Any hints or links?
thanks
ergin
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] apache/php: chunk is already free, page is already free

2004-08-05 Thread Jay Blanchard
[snip]
We made a test for only 20 min. and got our website online. The result 
was 200.000.000 (!!) lines in apache error log with the following:

Any hints or links?
[/snip]

Here's a hint...send this to the Apache list. 

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



Re: [PHP] How pass form variable to window.open()

2004-08-05 Thread Brian Dunning
Actually, I just did this last night with great success. Here is my  
code, I'm sure you can adapt it to your own. PHP was not needed, this  
was all done as part of the client-side validation JavaScript. Use  
JavaScript in the submit button's onClick to set the JavaScript  
variable with the value from the form field (I have a form field called  
z that is getting passed along as a GET request with the window.open  
href):

script type=text/javascript language=javascript
!--
function validate(myForm)
{
...a bunch of other unrelated stuff here...
  window.open('http://www.mysite.com/tool.php?z='+  
myForm.z.value+'loc='+location.href,'','toolbar=0,location=0,directorie 
s=0,status=0,me  
nubar=0,scrollbars=0,resizable=yes,height=400,width=400',true);
}
//--
/script

form name=myForm
input name=z type=text
input type=submit value=Submit onClick=return validate(myForm);
/form
Hope this helps.  :)
- Brian
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Log transaction for audit

2004-08-05 Thread Bogdan Ribic

Will you have that kind of experience? How can I do it comprehensively, e.g.
no too big additional coding effort, easy to manage, reliable, etc.
  Do you want to hire me or did you just mistakingly press Reply 
instead of compose new mail  :)

  Anyway, what you suggest is OK while testing  debugging etc, but for 
production use you shouldn't log entire queries, just some short 
description of what user did, username  timestamp etc.

Boban.
--
Please answer to the list and not to my email directly.
I use usenet server and do not check yahoo email account.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Location header does not work?

2004-08-05 Thread Ford, Mike [LSS]
On 05 August 2004 16:36, Bing Du wrote:

 I really appreciate everyone who responded taking your valuable time
 looking into my problem. 
 
 Now back to my problem.  Changing the condition to
 if($_SERVER['HTTPS']
 != 'on') did not make any difference unfortunately. So the result was
 still the URL in the Address box of the browser changed to
 https://computing.eng.iastate.edu/mambo/index.php?option=conte
 nttask=viewid=159Itemid=162
 fine.  But instead of showing the page that https address
 should point to,
 'You are in HTTPS mode' was displayed as the else clause specified.

Right, you're obviously not getting this, so let's take it step by step.

(1) Your browser requests
https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewi
d=159Itemid=162

(2) This fires the script /mambo/index.php on your server.

(3) Script finds all conditions in the first if() are met, so tests
$_SERVER['HTTPS'].

(4) ... finding it is not set, it issues a Location: redirect to
https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewi
d=159Itemid=162

(5) Browser sees the redirect, and issues a new request for
https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewi
d=159Itemid=162; at this point, it also changes the URL displayed in its
address bar.

(6) This seems to be where you are confused -- WHICH PAGE DO YOU THINK THIS
IS GOING TO LOAD?





(6a) Server sees new request, this time via https, to exactly the same
script as before, so fires the script /mambo/index.php again.

(7) See (3).

(8) This time it finds $_SERVER['HTTPS'] is set (or =='on', depending), and
echos 'You are in HTTPS mode'.

(9) QED

Which step isn't what you were expecting?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
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



[PHP] $HTTP_REFERER

2004-08-05 Thread Shaun
Hi,

I seem to have problems redirecting pages when I view my site using my
laptop, the only difference is that my laptop has Norton Firewall installed,
can this interfere with the $HTTP_REFERER variable and if so is there a more
reliable alternative?

Thanks for your help

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



Re: [PHP] dynamic RAM file for real media

2004-08-05 Thread raditha dissanayake
Daniel Guerrier wrote:
I am using PHP to dynamically create real audio links.
The question is I was creating one .ram file for each
real media file that I wanted to stream.  The .ram
files need to have absolute urls (which I do not
like).  I saw a few sites that use one .ram file but
pass it a variable http://url.ram?id=555.
Has anyone done this?
 

You will find this topic has been discussed to exaustion in this list. 
Usually the subject would be something like 'hiding urls of downloaded 
files' or 'placing files for download outside the web space'. Even last 
months achives had quite a bit on this.


If so, how?

__
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] $HTTP_REFERER

2004-08-05 Thread Jason Davidson
Its possible norton firewall OR your browser is altering the headers. 
how are you redirecting, norton may not allow for some kind of
redirects either.  Try turning norton off, and visiting the page :)  

Jason

Shaun [EMAIL PROTECTED] wrote: 
 
 Hi,
 
 I seem to have problems redirecting pages when I view my site using my
 laptop, the only difference is that my laptop has Norton Firewall installed,
 can this interfere with the $HTTP_REFERER variable and if so is there a more
 reliable alternative?
 
 Thanks for your help
 
 -- 
 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



Re: [PHP] apache/php: chunk is already free, page is already free

2004-08-05 Thread Ergin Aytac
had no success on the apache list. apache logs also errors with 
sister-projects like php. I think this is not an apache issue but php. 
if you have errors like this it is always very difficult to locate the 
real source of the problem.

Any other hints?
Jay Blanchard schrieb:
[snip]
We made a test for only 20 min. and got our website online. The result 
was 200.000.000 (!!) lines in apache error log with the following:

Any hints or links?
[/snip]
Here's a hint...send this to the Apache list. 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] $HTTP_REFERER

2004-08-05 Thread raditha dissanayake
Shaun wrote:
Hi,
I seem to have problems redirecting pages when I view my site using my
laptop, the only difference is that my laptop has Norton Firewall installed,
can this interfere with the $HTTP_REFERER variable and if so is there a more
reliable alternative?
 

Many firewalls and proxies can filter out referer information so it's 
not likely to be reliable. Referer details can also be forged.

Thanks for your help
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] need help with $HTTP_RAW_POST_DATA

2004-08-05 Thread Curt Zirzow
* Thus wrote PHPDiscuss - PHP Newsgroups and mailing lists:
 I noticed php://input but that's going to be changed to php://filter, but
 i have never tried using that before either. So i have no idea how it
 works. 

The only time php://input will have the data sent from the client
is if php doesn't read in any of the data.  You can force php not
to read that by setting the php.ini post_max_size to a small
number.

Then you can simply do something like:

($fp = fopen('php://input', 'r')) or die('cant open input');

while (! feof($fp) ) {
  echo fgets($fp);
}

Although a slight hack, it is much more effecient with memory,
expecially if you are expecting lots of data.

Curt
-- 
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about.  No, sir.  Our model is the trapezoid!

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



Re: [PHP] $HTTP_REFERER

2004-08-05 Thread Shaun
Hi Jason,

Thanks for your reply, but really I need a solution that will allow me to
let users view the site without having to worry about any firewalls they
might have installed!!!


Jason Davidson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Its possible norton firewall OR your browser is altering the headers.
 how are you redirecting, norton may not allow for some kind of
 redirects either.  Try turning norton off, and visiting the page :)

 Jason

 Shaun [EMAIL PROTECTED] wrote:
 
  Hi,
 
  I seem to have problems redirecting pages when I view my site using my
  laptop, the only difference is that my laptop has Norton Firewall
installed,
  can this interfere with the $HTTP_REFERER variable and if so is there a
more
  reliable alternative?
 
  Thanks for your help
 
  -- 
  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



Re: [PHP] php4.3.7 + phpBB 2.0.10 + Apache - zero sized replies with

2004-08-05 Thread ADFH
 Why would Apache log an error on a db dump?  Or are you talking about 
 the execution of the scripts after you import the data?  If the latter 

Execution of scripts, post import.

 For .htaccess :
 php_value error_reporting E_ALL

Tried it.. no difference.

Not sure whether or not this affects things, but it appears to be a
cPanelX controlled copy of Apache and php..

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



[PHP] filling out HTML forms

2004-08-05 Thread Amanda Hemmerich
So, we are trying to design an account management page that allows users
to manage all of their computer accounts in one place.  We want to allow
them to change their passwords for all of their accounts in one place,
unfortunately, we don't have access to one of the machines to change their
password.  This machine has a web form available that allows users to
change their passwords online, and we were hoping to somehow use the
information that the users entered on our form to fill out the other form.

Is something like this possible?  It seems like I've heard of something
like this before.  Any direction at all on using PHP as a solution to this
problem would be greatly appreciated.

Thanks
Amanda

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



RE: [PHP] Location header does not work?

2004-08-05 Thread Ford, Mike [LSS]
On 05 August 2004 17:12, Ford, Mike [LSS] wrote:

 (1) Your browser requests
 https://computing.eng.iastate.edu/mambo/index.php?option=conte
 nttask=viewi d=159Itemid=162

Bother! Sorry, that should, of course, be http:// in step (1)!

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
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



RE: [PHP] $HTTP_REFERER

2004-08-05 Thread Ford, Mike [LSS]
On 05 August 2004 17:18, Shaun wrote:

 Hi,
 
 I seem to have problems redirecting pages when I view my site using my
 laptop, the only difference is that my laptop has Norton
 Firewall installed,
 can this interfere with the $HTTP_REFERER variable

Not only can, does!  Other firewalls or proxies may alter it, some will simply block 
it, and anyway it can be forged by the user.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning  Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
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



RE: [PHP] Location header does not work?

2004-08-05 Thread Ed Lazor
I sent Bing specific code that will work:

If (!IsSet($_SERVER[HTTPS]))
Header(Location:  https://; . $_SERVER[HTTP_HOST] .
$_SERVER[REQUEST_URI]);


Manually go to the URL specified.  

https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=viewi
d=159Itemid=162

It doesn't work.  It will work if you remove all of the parameters and it
will work if you specify only a few of the parameters.  Basically, there is
a problem with the mambo application handling input.

Bing persists in troubleshooting the redirect when the focus should be on
mambo.




 -Original Message-
 Right, you're obviously not getting this, so let's take it step by step.
 
 (1) Your browser requests
 https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=view
 i
 d=159Itemid=162
 
 (2) This fires the script /mambo/index.php on your server.
 
 (3) Script finds all conditions in the first if() are met, so tests
 $_SERVER['HTTPS'].
 
 (4) ... finding it is not set, it issues a Location: redirect to
 https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=view
 i
 d=159Itemid=162
 
 (5) Browser sees the redirect, and issues a new request for
 https://computing.eng.iastate.edu/mambo/index.php?option=contenttask=view
 i
 d=159Itemid=162; at this point, it also changes the URL displayed in its
 address bar.
 
 (6) This seems to be where you are confused -- WHICH PAGE DO YOU THINK
 THIS
 IS GOING TO LOAD?

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



RE: [PHP] $HTTP_REFERER

2004-08-05 Thread Ed Lazor
Shaun,

Jason is suggesting that you turn Norton off to help troubleshoot the
problem.  In other words, verify that Norton is the problem.

Also, people are suggesting that the display of your web pages not depend so
significantly on the HTTP_REFERRER variable.  Perhaps we can help you come
up with a better solution if you tell us what you're trying to accomplish.

-Ed



 -Original Message-
 From: Shaun [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 05, 2004 9:26 AM
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] $HTTP_REFERER
 
 Hi Jason,
 
 Thanks for your reply, but really I need a solution that will allow me to
 let users view the site without having to worry about any firewalls they
 might have installed!!!
 
 
 Jason Davidson [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
  Its possible norton firewall OR your browser is altering the headers.
  how are you redirecting, norton may not allow for some kind of
  redirects either.  Try turning norton off, and visiting the page :)
 
  Jason
 
  Shaun [EMAIL PROTECTED] wrote:
  
   Hi,
  
   I seem to have problems redirecting pages when I view my site using my
   laptop, the only difference is that my laptop has Norton Firewall
 installed,
   can this interfere with the $HTTP_REFERER variable and if so is there
 a
 more
   reliable alternative?
  
   Thanks for your help
  
   --
   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



RE: [PHP] Why do I keep getting a 501 mail error?

2004-08-05 Thread Ed Lazor
Why are you specifying the To field twice?  I'd try removing the extra
formatting around the email addresses for troubleshooting.

 -Original Message-
 From: Brian Dunning [mailto:[EMAIL PROTECTED]
 Sent: Thursday, August 05, 2004 8:43 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] Why do I keep getting a 501 mail error?
 
 Developing on a Windows server to be deployed on Linux. I get SMTP
 server response: 501 Bad address syntax. Here's my code:
 
 $mail_from = 'My Name [EMAIL PROTECTED]';
 $mail_server = 'mail.servername.com'; // This is hosted externally
 ini_set(SMTP, $mail_server);
 ini_set(sendmail_from, $mail_from);
 $mail_to = $first_name $last_name $email;
 mail($mail_to, Here is my subject, Please click this link to
 activate your  account:\n\n$http_root.owner.php?id=$entry_code, To:
 $mail_to\nFrom: $mail_from\nContent-type: text/plain\nMailer:
 PHP/.phpversion());
 
 I read about trying \r\n instead of \n in the headers, but it didn't
 seem to make any difference, and \n is working on other mail actions on
 this same server.
 
 Thanks for any clues...  :)
 
 --
 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



Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$

2004-08-05 Thread Justin Patrin
On Thu, 5 Aug 2004 09:51:10 -0700, Josh Acecool M
[EMAIL PROTECTED] wrote:
 The files that are evaled work perfectly without being evaled.
 
 I dont think eval was meant for large files etc.
 
 Whats on that like: a preg_match that looks for \$variable = something;
 
 and thats the like it messes up on.
 
 Also, if the file which is evaled includes another file, the variables from
 the included file wont get parsed or anything, and the variables set to it
 by the first file, or the class dont work at all.
 

What version of PHP are you using?

Are you doing anything to the string before eval-ing it? You say that
if you just include() is, it works fine. *Why* not just include it,
then?

 John Holmes [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 
 
  Josh Acecool M wrote:
 var $The_Template_Sys;
   
   $this - The_Template_Sys = file_get_contents($The_Template_File);
   
   $this - Sub_Template = TRUE;
   Any ideas?
 
  I have an idea I said in a previous email!
 
  you say you're getting a parse error. How could anyone possibly help you
  troubleshoot that parse error unless they had an example of what was in
  the file being eval()'d??
 
  What is actually in the file that's failing the eval()??!?!?! What line
  of the file is failing? What is on that line? What's on the couple of
  lines before it? What's on the couple of lines after that line that's
  failing? What does the line with the eval() call look like? Are you
  doing anything else with $this-The_Template_Sys before it's
 eval()'d??
 
  --
 
  John Holmes
 
  php|architect - The magazine for PHP professionals -
 http://www.phparch.com
 

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



[PHP] Re: Getting data from table as a tree

2004-08-05 Thread pt2002
Thank you for your suggestion.
I've had already browse pear classes but didn't want to use them.
I've found some tips and now I can show the tree but I also need to have all
the data in an array and that's the problem now.

Greetings
pt2002

Pt2002 [EMAIL PROTECTED] escreveu na mensagem
news:[EMAIL PROTECTED]
 Hi

 I have a table like this
 id, pid, name. When a item has no parent, pid = 0. There is no limit in
 depth.
 1, 0, Test 1
 2, 1, Test 1.1
 3, 1, Test 1.2
 4, 2, Test 1.1.1
 5, 1, Test 1.3
 6, 3, Test 1.2.1

 I need to read this table and return an array that represents the tree.
 Maybe using a recursive function but had no success.

 I just need someone to point in the right direction.
 TIA

 Greets
 pt2002

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



Re: [PHP] Why do I keep getting a 501 mail error?

2004-08-05 Thread Jason Wong
On Friday 06 August 2004 01:05, Ed Lazor wrote:
 Why are you specifying the To field twice?  I'd try removing the extra
 formatting around the email addresses for troubleshooting.

I would say strip the whole thing down to the bare minimum that illustrates 
the problem.

-- 
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
--
/*
The porcupine with the sharpest quills gets stuck on a tree more often.
*/

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



Re: [PHP] dynamic RAM file for real media

2004-08-05 Thread John W. Holmes
From: Daniel Guerrier [EMAIL PROTECTED]

 I am using PHP to dynamically create real audio links.
 The question is I was creating one .ram file for each
 real media file that I wanted to stream.  The .ram
 files need to have absolute urls (which I do not
 like).  I saw a few sites that use one .ram file but
 pass it a variable http://url.ram?id=555.

Never done it, but I'd guess that the server would be set up for PHP to
parse .ram requests (at least in this directory). Then, from within PHP
you'd grab the $id value, locate the appropriate real audio file, send the
appropriate headers and then readfile() the audio file.

---John Holmes...

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



Re: [PHP] filling out HTML forms

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 12:39, Amanda Hemmerich offered up the following 
tid-bit of information :
 So, we are trying to design an account management page that allows users
 to manage all of their computer accounts in one place.  We want to allow
 them to change their passwords for all of their accounts in one place,
 unfortunately, we don't have access to one of the machines to change
 their password.  This machine has a web form available that allows users
 to change their passwords online, and we were hoping to somehow use the
 information that the users entered on our form to fill out the other
 form.
snip

Do you have access to the code for the 'other form'?  Is the 'other form' on 
the same box as 'your form'?  Does 'your form' submit it's data to the 
'other form'?

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



[PHP] Re: Browsers on terminal server

2004-08-05 Thread Lester Caine
Lester Caine wrote:
I am using
$_SERVER[REMOTE_ADDR]
to get address of the browser accessing the system and then using
gethostbyaddr() to get the machine name.
This worked great until I came to a site using M$ Terminal Server to 
provide the terminals. We still need to know what machine we are talking 
to, so we can identify the room, and flag the correct set of displays, 
but $_SERVER[REMOTE_ADDR] seems to be giving only the IP address of 
the TS machine.

Anybody been here already. Is it possible to identify the terminal that 
is browsing on the other side of TS. Any pointers to some help to 
restore operation in this situation.
OK is is even more of a problem!
Two terminals running browsers via terminal server on one machine both 
accessing PHP on a second machine. Problem - they both use the same 
session, so what ever you do in one is 'seen' by the other.

Does this mean that any browsers running on terminal server are totally 
useless as far as web access ?

--
Lester Caine
-
L.S.Caine Electronic Services
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How pass form variable to window.open()

2004-08-05 Thread John W. Holmes
From: CHAN YICK WAI [EMAIL PROTECTED]

 How about if this $student is actually a text field, when this html
 generated by php script, it has no value, so the onClick line is
 ...url?student=$student without value, when I click, it reads nothing,
how
 should I do?

Javascript.

---John Holmes...

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



Re: [PHP] filling out HTML forms

2004-08-05 Thread John W. Holmes

- Original Message - 
From: Amanda Hemmerich [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, August 05, 2004 12:39 PM
Subject: [PHP] filling out HTML forms


 So, we are trying to design an account management page that allows users
 to manage all of their computer accounts in one place.  We want to allow
 them to change their passwords for all of their accounts in one place,
 unfortunately, we don't have access to one of the machines to change their
 password.  This machine has a web form available that allows users to
 change their passwords online, and we were hoping to somehow use the
 information that the users entered on our form to fill out the other form.

You can use cURL or one of the PEAR classes to have your PHP script fill out
the form on the remote computer... will take some work, but it's possible.

Actually, you could just simulate a POST / GET request to the file that
handles the form processing instead of actually attempting to fill out the
form. Again, cURL and some PEAR classes will help here.

---John Holmes...

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



Re: [PHP] Why do I keep getting a 501 mail error?

2004-08-05 Thread John W. Holmes
From: Brian Dunning [EMAIL PROTECTED]

 Developing on a Windows server to be deployed on Linux. I get SMTP
 server response: 501 Bad address syntax. Here's my code:

 $mail_from = 'My Name [EMAIL PROTECTED]';
 $mail_server = 'mail.servername.com'; // This is hosted externally
 ini_set(SMTP, $mail_server);
 ini_set(sendmail_from, $mail_from);
 $mail_to = $first_name $last_name $email;
 mail($mail_to, Here is my subject, Please click this link to
 activate your  account:\n\n$http_root.owner.php?id=$entry_code, To:
 $mail_to\nFrom: $mail_from\nContent-type: text/plain\nMailer:
 PHP/.phpversion());

 I read about trying \r\n instead of \n in the headers, but it didn't
 seem to make any difference, and \n is working on other mail actions on
 this same server.

 Thanks for any clues...  :)

The first step is to see if you can send a mail using a very basic call to
mail(), simply: mail('[EMAIL PROTECTED]','subject','message');

If that works, then you can move on by slowly adding the code you have
above.

Why do you have two To: headers? That'll mess things up. remove the one from
the extra headers parameter.

---John Holmes...

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



Re: [PHP] Log transaction for audit

2004-08-05 Thread John W. Holmes
From: CHAN YICK WAI [EMAIL PROTECTED]

 I'm writing an application that requires log every transactions users
done,
 e.g. update which record, delete which record, something like that.

 I guess one way is whenever I issue a mysql_query(), I also insert this
 query in whole into another table together with the user name, so I can
log
 and retrieve it out for audit.

 Will you have that kind of experience? How can I do it comprehensively,
e.g.
 no too big additional coding effort, easy to manage, reliable, etc.

Sounds like you just need to write a wrapper for mysql_query() that logs
what's going on.

function my_mysql_query($query)
{
log_query($query);
return mysql_query($query);
}

and use my_mysql_query() everywhere instead of mysql_query.

---John Holmes...

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



[PHP] periodic file writing error (fputs)

2004-08-05 Thread Sarah Gray
Hello,

I am having a periodic problem that I cannot duplicate and wonder if
anyone has suggestions.

Once a sale is completed a record is written to a log file on the
server.

$filename = $dir. /. $logType._.$today..txt;
$fp = fopen($filename, a+);
fputs($fp, $logEntryStr);
fclose($fp);

The file is chmoded to 644.

About 3 out of 600 times, the log file is not written to.  The times
of day this happens are not consistent, and as I mentioned, I cannot
duplicate it when testing. I initially thought it was some kind of
error on the server, but I am beginning to think it is in my code.

Has anyone experienced anything like this or have any suggestions for
how to troubleshoot this?

Thanks,

Sarah

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



Re: [PHP] filling out HTML forms

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 13:43, John W. Holmes offered up the following 
tid-bit of information :
snip
 You can use cURL or one of the PEAR classes to have your PHP script fill
 out the form on the remote computer... will take some work, but it's
 possible.

 Actually, you could just simulate a POST / GET request to the file that
 handles the form processing instead of actually attempting to fill out
 the form. Again, cURL and some PEAR classes will help here.

 ---John Holmes...

But the OP would still have to have access to at least the HTML of the other 
form right?  cURL can't fill out form on another site if the HTML isn't set 
up to do it, can it?

like :
input type=text name=foo /
vs.
input type=text name=foo value=?php echo ( $foo ); ? /

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] apache/php: chunk is already free, page is already free

2004-08-05 Thread Jay Blanchard
[snip]
had no success on the apache list. apache logs also errors with 
sister-projects like php. I think this is not an apache issue but php. 
if you have errors like this it is always very difficult to locate the 
real source of the problem.

Any other hints?
[/snip]

Why do you think that this is a PHP problem? Can you offer any reason
other than after googling about this I know that only a few people have
the same problem but couldn't solve it. Most of them say, that this is a
memory issue of php (some of them used older versions like php 4.0.6). I
also dont think that the problem is because of phorum.org software,
apache or mysql. Maybe openbsd?

We didn't get a lot to go on here. Have you consulted with the
phorum.org people? Are the other sites on the server using PHP without
problems? Can you help narrow this down in any way?

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



Re: [PHP] Log transaction for audit

2004-08-05 Thread Jason Wong
On Friday 06 August 2004 01:47, John W. Holmes wrote:

 Sounds like you just need to write a wrapper for mysql_query() that logs
 what's going on.

 function my_mysql_query($query)
 {
 log_query($query);
 return mysql_query($query);
 }

 and use my_mysql_query() everywhere instead of mysql_query.

If that is indeed what is required just simply use MySQL's own logging system. 
Only feasible if you have control of the MySQL server, MySQL manual for 
details.

-- 
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
--
/*
Modesty:
The gentle art of enhancing your charm by pretending not to be
aware of it.
-- Oliver Herford
*/

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



RE: [PHP] periodic file writing error (fputs)

2004-08-05 Thread Jay Blanchard
[snip]
I am having a periodic problem that I cannot duplicate and wonder if
anyone has suggestions.

Once a sale is completed a record is written to a log file on the
server.

$filename = $dir. /. $logType._.$today..txt;
$fp = fopen($filename, a+);
fputs($fp, $logEntryStr);
fclose($fp);

The file is chmoded to 644.

About 3 out of 600 times, the log file is not written to.  The times
of day this happens are not consistent, and as I mentioned, I cannot
duplicate it when testing. I initially thought it was some kind of
error on the server, but I am beginning to think it is in my code.

Has anyone experienced anything like this or have any suggestions for
how to troubleshoot this?
[/snip]

How do you know that it is not being written to? Do the transactions
show up in a database or some other form? Is it possible to have
duplicate log entries? What is $today, a date stamp, time date stamp,
epoch time stamp?

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



Re: [PHP] filling out HTML forms

2004-08-05 Thread John W. Holmes
From: John Nichel [EMAIL PROTECTED]:
  You can use cURL or one of the PEAR classes to have your PHP script fill
  out the form on the remote computer... will take some work, but it's
  possible.
 
  Actually, you could just simulate a POST / GET request to the file that
  handles the form processing instead of actually attempting to fill out
  the form. Again, cURL and some PEAR classes will help here.

 But the OP would still have to have access to at least the HTML of the
other
 form right?  cURL can't fill out form on another site if the HTML isn't
set
 up to do it, can it?

 like :
 input type=text name=foo /
 vs.
 input type=text name=foo value=?php echo ( $foo ); ? /

You'd have to know what elements are in the form. You wouldn't actually fill
out the form, just create the appropriate request to the page that does the
form processing. As simple as a URL if it's method is get or using
cURL/PEAR classes/contexts to create the post request.

---John Holmes...

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



Re: [PHP] Log transaction for audit

2004-08-05 Thread John W. Holmes
From: Jason Wong [EMAIL PROTECTED]
 On Friday 06 August 2004 01:47, John W. Holmes wrote:

  Sounds like you just need to write a wrapper for mysql_query() that logs
  what's going on.
 
  function my_mysql_query($query)
  {
  log_query($query);
  return mysql_query($query);
  }
 
  and use my_mysql_query() everywhere instead of mysql_query.

 If that is indeed what is required just simply use MySQL's own logging
system.
 Only feasible if you have control of the MySQL server, MySQL manual for
 details.

True. http://dev.mysql.com/doc/mysql/en/Binary_log.html

I assume there's probably some application level information that'd need to
be logged also, that probably isn't contained in the query.

---John Holmes...

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



Re: [PHP] periodic file writing error (fputs)

2004-08-05 Thread John W. Holmes
From: Sarah Gray [EMAIL PROTECTED]
 Once a sale is completed a record is written to a log file on the
 server.
 
 $filename = $dir. /. $logType._.$today..txt;
 $fp = fopen($filename, a+);
 fputs($fp, $logEntryStr);
 fclose($fp);

Consider this:

1. User A completes a transaction.
2. Script A reads the log file
3. User B completes a transaction
4. Script B read the log file
5. Script A write the new line to what was read in #2
6. Script B write the new line to what was read in #4

Now what's in the file? Only what Script B wrote.

http://us2.php.net/flock

---John Holmes...

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



Re: [PHP] periodic file writing error (fputs)

2004-08-05 Thread Jason Wong
On Friday 06 August 2004 02:50, Sarah Gray wrote:

 I am having a periodic problem that I cannot duplicate and wonder if
 anyone has suggestions.

 Once a sale is completed a record is written to a log file on the
 server.

 $filename = $dir. /. $logType._.$today..txt;
 $fp = fopen($filename, a+);
 fputs($fp, $logEntryStr);
 fclose($fp);

 The file is chmoded to 644.

 About 3 out of 600 times, the log file is not written to.  The times
 of day this happens are not consistent, and as I mentioned, I cannot
 duplicate it when testing. I initially thought it was some kind of
 error on the server, but I am beginning to think it is in my code.

 Has anyone experienced anything like this or have any suggestions for
 how to troubleshoot this?

- Enable full error reporting for PHP.

- Incorporate some error checking code as per example in manual for fwrite().

-- 
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
--
/*
Q:  How many Zen masters does it take to screw in a light bulb?
A:  None.  The Universe spins the bulb, and the Zen master stays out
of the way.
*/

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



Re: [PHP] filling out HTML forms

2004-08-05 Thread John Nichel
On Thursday 05 August 2004 14:03, John W. Holmes offered up the following 
tid-bit of information :
 You'd have to know what elements are in the form. You wouldn't actually
 fill out the form, just create the appropriate request to the page that
 does the form processing. As simple as a URL if it's method is get or
 using cURL/PEAR classes/contexts to create the post request.

 ---John Holmes...

Okay...that makes sense.  I thought at first you were saying that cURL (or 
PEAR) had the ability to (pre)fill forms on other sites.  I was going to be 
pretty damn impressed. ;)

-- 
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Re: [PHP-DB] Eval a file, and it gives parse error because it uses a preg_match statement with \$

2004-08-05 Thread Josh Acecool M
5.0.0

Include WORKS, but using INCLUDE with PREG_REPLACE does NOT work, the text
you want to replace gets deleted and the INCLUDE includes on the top of the
page...

Justin Patrin [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 On Thu, 5 Aug 2004 09:51:10 -0700, Josh Acecool M
 [EMAIL PROTECTED] wrote:
  The files that are evaled work perfectly without being evaled.
 
  I dont think eval was meant for large files etc.
 
  Whats on that like: a preg_match that looks for \$variable = something;
 
  and thats the like it messes up on.
 
  Also, if the file which is evaled includes another file, the variables
from
  the included file wont get parsed or anything, and the variables set to
it
  by the first file, or the class dont work at all.
 

 What version of PHP are you using?

 Are you doing anything to the string before eval-ing it? You say that
 if you just include() is, it works fine. *Why* not just include it,
 then?

  John Holmes [EMAIL PROTECTED] wrote in message
  news:[EMAIL PROTECTED]
 
 
   Josh Acecool M wrote:
  var $The_Template_Sys;

$this - The_Template_Sys =
file_get_contents($The_Template_File);

$this - Sub_Template = TRUE;
Any ideas?
  
   I have an idea I said in a previous email!
  
   you say you're getting a parse error. How could anyone possibly help
you
   troubleshoot that parse error unless they had an example of what was
in
   the file being eval()'d??
  
   What is actually in the file that's failing the eval()??!?!?! What
line
   of the file is failing? What is on that line? What's on the couple of
   lines before it? What's on the couple of lines after that line that's
   failing? What does the line with the eval() call look like? Are you
   doing anything else with $this-The_Template_Sys before it's
  eval()'d??
  
   --
  
   John Holmes
  
   php|architect - The magazine for PHP professionals -
  http://www.phparch.com
 

 -- 
 DB_DataObject_FormBuilder - The database at your fingertips
 http://pear.php.net/package/DB_DataObject_FormBuilder

 paperCrane --Justin Patrin--


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



Re: [PHP] Re: str_replace() problem in PHP5 - RESOLVED

2004-08-05 Thread Justin Patrin
On Thu, 05 Aug 2004 07:21:35 -0700, Jon Bertsch [EMAIL PROTECTED] wrote:
 Curt and Justin,
 
 Thanks for the ideas. I resolved this by removing the str_replace() call
 from within a function that I was calling and running it in-line in the
 code. Since the html string was less than 500 char it seems unlikely that
 it was memory but that's also about the only thing that would be different
 between prod and dev environments so that's the best candidate for causing
 the problem (php.ini set at default 8M). There were no error messages at
 all, the script would just end and the logs showed nothing at all, as if it
 was never even called.
 
 Jon Bertsch
 

As I said, that sounds like a threading issue. Another difference
between dev and prod is load. Try using prefork apache 2 or apache
1.

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



Re: [PHP] Optimizing Tips

2004-08-05 Thread Justin Patrin
On Thu, 5 Aug 2004 14:27:56 +0200, Nicklas Bondesson [EMAIL PROTECTED] wrote:
 The Zend Optimizer only caches the compiled PHP output (HTML content) that
 should be sent to your client. You can always try it but I don't think you
 will gain that much on using it. It's worth trying though.

Actually, it caches the parsed PHP files so that you don't have to
re-parse the PHP files every time. AFAIK, it doesn't parse HTML
output. This is exactly what TurckMMCache does (and it's free :-).

 
 Nicke
 
 -Original Message-
 From: Vinayakam Murugan [mailto:[EMAIL PROTECTED] 
 Sent: den 5 augusti 2004 14:09
 To: Nicklas Bondesson
 Subject: Re: [PHP] Optimizing Tips
 
 On Thursday 05 Aug 2004 5:29 pm, you wrote:
  Will the majority of the visitors surf from within India? I think I
  will experience the site more slow than anyone from India. I'm surfing
  from Sweden and the Internet connection to India is not that good.
 
  I can always take a look inside the server if you give me an account to
 it.
 
  Nicke
 
 True. That could be a factor.
 
 I'm sorry but I am not authorized to part with my account details. Thanks
 for asking though.
 
 Would trying an optimizer like Zend help?
 
 --
 Warm Regards
 ~~~
 Vinayakam Murugan
 
 Tel: 91-22 - 2288 2163 Ext 105
 Fax Number: 91-22 - 2288 2809
 Mobile : 91-22-3101 8082
 
 http://www.TheArgonCompany.com
 
 Viruses getting you down?
 Get your virus protected mailbox at http://www.tassm.com
 
 Linux. The Choice of the GNU generation
 

-- 
DB_DataObject_FormBuilder - The database at your fingertips
http://pear.php.net/package/DB_DataObject_FormBuilder

paperCrane --Justin Patrin--

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



  1   2   >