[PHP] how uploaded files are managed and where they are stored on server

2002-12-11 Thread user
Our /usr/local/etc/php.ini has 'upload_tmp_dir  =
/data/www/php_uploads/'.  But uploaded files are actually stored in
/var/tmp.  Also seem they disappear from the server after being uploaded
very quickly and we don't have a crontab job running to clean them up
from time to time automatically.   I need to know how uploaded files are
managed by PHP server.  Any such information on line?

Thanks,

Bing


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




[PHP] Q: File not rewritable - why? Help needed.

2003-02-11 Thread user

Newbie question:

I try to modify a txt-file but get "not writable" error.
(just like in http://www.php.net/manual/en/function.fwrite.php )

I've tried to change the chmode but now I need some help.

All info welcome! Thanks in advance!

Paul Dunkel
--
[EMAIL PROTECTED]


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




[PHP] Re: File not rewritable - why? Help needed.

2003-02-12 Thread user
thank you for the reply


Chmod was just a try from my side to get it work.

I tried CHMOD 0777, and everything else, too. Didn't work. Could it be 
that the server doesn't allow writings at all? As you see, I am a newbie 
in these things.


>Remember to write to a file PHP (the user nobody or httpd) also needs Read
>and eXecute permisions on all the directories from the root all the way to
>the directory contaning the file.

How do I give those permissions?


What I try next, is the same PHP in a couple of another servers...


Yours,

Paul Dunkel
--
[EMAIL PROTECTED]


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



Re: [PHP] Re: File not rewritable - why? Help needed.

2003-02-12 Thread user


Awlad Hussain wrote:

try CHMOD 777


I tried that. It didn't help.

I also tried in two other servers with no result. I'm definetly doing 
something wrong :-(

More ideas?

Paul Dunkel
--
[EMAIL PROTECTED]


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



Re: [PHP] Re: File not rewritable - why? Help needed.

2003-02-12 Thread user


Marek Kilimajer wrote:



Also make sure server has read permission to directories.


I'm pretty sure that is the problem. How should I check that?

I've now tried my PHP in two other servers with no result. I'm definetly 
doing something wrong :-(

Paul Dunkel
--
[EMAIL PROTECTED]



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



[PHP] Smarty and FAI

2003-02-20 Thread user
Hi,

My provider is free.Fr
chmod is disabled

Is it possible to use Smarty on my web pages ?

thanks for your answer

Guillaume


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




[PHP] php 4.3.2 problem

2003-07-07 Thread user
Hi

We're trying to upgrade to php-4.3.2. when we install libphp.so
and restart apache, it fails to start with the error
"Invalid command 'php_admin_value', perhaps mis-spelled"
I don't understand what's wrong. The syntax of our httpd.conf is working
just fine with our current version (4.2.3).
Does php needs to be compiled with a special parameter in order
for php_admin_value and php_admin_flag (this also doesn't work for us on 
4.3.2)?

Appreciate the help..

-R

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


[PHP] problem with 4.3.2

2003-07-07 Thread user
After upgrading from 4.2.3 to 4.3.2 apache fail to load with an error:
"Invalid command 'php_admin_value', perhaps mis-spelled..."
php_admin_flag also fails.

I tried with and without php.ini.

php was compile with --with-apxs --with-mysql --with-gd --with-xml
--with-iconv --with-gettext --with-mcrypt --with-openssl --with-imap
--with-kerberos --with-imap-ssl --with-curl
I then tried the snapshot 200307070930 and had the same problem.

Then I put  around php_admin_value
and the problem "disapear". That tald me that for some reason the new
library is not being loaded by apache.
I rechecked the path of LoadModule, it's fine.
When I run ldd on libphp4.so, no library is missing.
The only different in the configs between our current version and 4.3.2
is the LoadModule path in apache.
I've run out of ideas, any help would be appriciated.

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


[PHP] How can I get info from an XML document

2003-03-21 Thread user
Hi,
I can't get the clue. My php page receives an XML document from which I
need to get the contents and attributes into php variables. I obvious 
have missed something important. Could someone help me with the 
following script (while watching the Bagdad bombings on CNN):

$xml=""; //if fact, I get the $xml from elsewhere
$xml.="";
$xml.="Mike Bosschaert";
$xml.="";
$xmlParser=xml_parser_create();
$parse_succes = xml_parse($xmlParser,$xml,"true");
xml_set_element_handler($xmlParser, "startElement", "endElement");
xml_set_character_data_handler($xmlParser, "characterData");
xml_parse($xmlParser, $datastring, true);
xml_parser_free($xmlParser);
?>
I want to create a variable $name, pointing to "Mike Bosschaert"
Thanks,
Mike

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


[PHP] Re: Emptying the browser cache

2003-06-16 Thread user
There is no way to do this in any programming language since it is not 
part of the http spec. There may be som client side vb hack that someone 
knows that works on IE for Windows but I doubt it. It is not very secure 
to allow web sites to control your browser's cache. Try looking into 
expire times on your responses (http feature) so your content does not 
get cached in the first place. Note that if you are paying for bandwith 
and have caps you will be mighty surprised next time the bill comes 
around. Caches are a good thing.
Tom

Don wrote:
Hi,

Is the a PHP command that will empty the browser's current cache?

Thanks,
Don


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


[PHP] how to call php from C?

2003-06-23 Thread user
Hello,
   I have a working C program that runs like a cgi
by sending back a web page. I would like include in it
some authentication code by checking

$au = $_SESSION['AuthenticatedUser']

previously set up by a php script.I don't like to recode
all in php because I expect a nasty performace slowdown. 

Can I call session_start() and so on from my C program?
Any example code?

Many thanks for replies, bye

    user(at)lngs(dot)infn(dot)it

 

   

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



[PHP] php function system() on win2k srv /iis

2003-06-26 Thread user
Hello,
   I performed some tests using the backticks operator 
and the system() call.
This is my.php :


 
uh  
 
 
 I am 
";
$k = sprintf( `dir $fldr` );
$k = str_replace ("<", "<", $k );
$k = str_replace (">", ">", $k );
$k = str_replace ("\n", "", $k );
echo "\$k = $k";
?>



this is the output:

I am SYSTEM 
$k = Volume in drive D is WIN2KSRV
Volume Serial Number is 58D7-73D6

Directory of d:\winnt

06/25/2003 05:36p  .
06/25/2003 05:36p  ..
05/30/2003 11:46a 21,107 Active Setup Log.txt
05/29/2003 05:14p  addins
05/29/2003 06:20p  Application Compatibility Scripts
05/30/2003 10:15a  AppPatch
12/07/1999 02:00p 1,272 Blue Lace 16.bmp
05/30/2003 04:40p  Cache
05/30/2003 01:40p 24,106 certocm.log
12/07/1999 02:00p 82,944 clock.avi
12/07/1999 02:00p 17,062 Coffee Bean.bmp
05/29/2003 04:27p 1,038 COM+.log
. 
and so on

My problem is that it works too much  ;-) 
because the SYSTEM account can read everywhere in my win partition.
Is it possible to have the command executed by the user
IUSR_machinename instead of SYSTEM ?
In this case I can set up proper right in order to prevent access
to certain sensitive folders

TIA, bye,
___   




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



[PHP] ignored php.ini?

2003-06-27 Thread user
Hello,
   I have php 4.3.2 running as isapi module on windows 2000.
I have a php.ini in d:\winnt

but when I edit it the output from

 

is as before.

Any hints? Many thanks in advance, bye
_

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



Re: [PHP] ignored php.ini?

2003-06-27 Thread user
---
> Is Windows installed on the D drive? Because you can't
> just make a WINNT folder on another drive, it must
> be in the actual folder the system is installed in.

  yes, Windows is on d:
  I am trying to set safe_mode = On
  
  d:\winnt\php.ini   edited and saved;
  
 claims  that safe_mode is  Off

  any idea? bye.


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



Re: [PHP] ignored php.ini?

2003-06-27 Thread user
>Restart?

 IIS restared from its mmc but phpinfo() tell me 
 that safe_mode is Off

 :-(

 thanks, bye

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



Re: [PHP] ignored php.ini?

2003-06-27 Thread user
>>Restart?
>
>IIS restared from its mmc but phpinfo() tell me 
>that safe_mode is Off

 I performed a strong restart and now the new settings
 in php.ini are in the output of phpinfo(). 
 Bye.
_


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



[PHP] Failing to Make MySQL Query on Submit

2002-10-28 Thread user
I'm having a problem getting my PHP script to talk to my database.  I'm 
attempting to use UPDATE with a PHP form to change records already in 
the database.  I'm able to pull the record with no problem and the 
script is sending the confirmation e-mail without a problem on submit 
but for some reason the MySQL query isn't being made.  I've even tried 
"dummy" queries just to see if the connection was being made, but it's 
not.  I'd appreciate any help.  Following is the code:


 // CONNECT TO DATABASE
$db = mysql_connect("localhost", "webmstr");
mysql_select_db("test",$db);
if ($submit) {
 // SEND INFO IN EMAIL
 mail("$email", "Picks", "Your entry has been changed.\nFirst Set 
Opener: $o1 \nFirst Set Wildcard: $w1 \nFirst Set Closer: $c1 \nSecond 
Set Opener: $o2 \nSecond Set Wildcard: $w2 \nSecond Set Closer: $c2 
\nEncore: $en \nAcoustic Song: $ac \nWildcard: $wc \nOne Time Played: 
$ot \nFirst Time Played: $nw \n\nGood Luck!\nhttp://www.otherones.net";, 
"From: [EMAIL PROTECTED]");
 // UPDATE THE DATABASE
 $sql = "UPDATE fantasytoo SET o1 = \"$o1\",w1 = \"$w1\",c1 = 
\"$c1\",o2 = \"$o2\",w2 = \"$w2\",c2 = \"$c2\",en = \"$en\",wc = 
\"$wc\",ot = \"$ot\" WHERE realname = \"$realname\" ";
}
if ($realname) {
// query the database
$sql = "select * from fantasytoo where realname = \"$realname\" and 
email = \"$email\"";
$result = mysql_query($sql);
while ($myrow = mysql_fetch_array($result)) {
printf($result);
?>
&email=">

 
  
Fantasy TOO - Fall 2002 Signups 
.



  
 ">
">

   Name: 
  


  E-mail
Address: 
  


  1st
Set Opener (8): 
  

  
?>

[What's 
This?]


   1st
Set Wildcard (4): 
  

  
?>

[What's 
This?]


   1st
Set Closer (6): 
  

  
?>

[What's 
This?]


   2nd
Set Opener (8): 
  

  
?>

[What's 
This?]


   2nd
Set Wildcard (4): 
  

  
?>

[What's 
This?]


   2nd
Set Closer (6): 
  

  
?>

[What's 
This?]


   Encore
(5): 
  

  
?>

[What's 
This?]


   Wildcard
(2): 
  

  
?>

[What's 
This?]


   One
Time Played (15): 
  

  
?>

[What's 
This?]


  

   

  
  

  

  


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



Re: [PHP] Re: Yet another question

2002-10-30 Thread user
Besides that there is no reason to include the file after the use of the 
variable. When i started writing php i saw in every other program that 
the include was the first line in every function that needs it.
Like :
function test() {

		include("file");
.



Peter Houchin wrote:
try it and see .. though I am pretty sure that it won't work  unless you
define the variable else where in the file b4 calling it. other wise the
variable will either be blank or give you an error saying undefined variable
if it's used before the include.



-Original Message-
From: Trasca Ion-Catalin [mailto:tic2000@;home.ro]
Sent: Thursday, 31 October 2002 10:56 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Yet another question


Yes, this works, but only if I include the file before the use of the
variable, but, what if I use the include() after the use of the variable?

--
Trasca Ion-Catalin
"Tjoumaidis" <[EMAIL PROTECTED]> wrote in message
news:3DBF8DE6.70701@;freemail.gr...


Yes if you include the file

include ("file");

then you can refer to any of the variables the file contains


Trasca Ion-Catalin wrote:


It's posible to call a variable from another file?

--
Trasca Ion-Catalin








--
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] ftok() not returning a valid SysV shared memory index?

2003-09-07 Thread user
I'm running 4.3.3, and have made sure to compile it with 
--enable-sysvshm.  The code works on PHP5, so I think it might be a 
problem with PHP4.

#! /usr/bin/php -q



$key= ftok("/etc/passwd", 'c');
$shmid  = shm_attach($key);
$shm_var = "Shared Memory Data";
shm_put_var($key, 25, $shm_var);
$shm_data = shm_get_var($key, 25);
echo "$key, $shmid, $shm_var, $shm_data\n";

shm_detach($shmid);

?>

When I try and run it, I get these errors:

Warning: 1661167266 is not a SysV shared memory index in 
/home/jason/dev/php/ipc/shm1.php on line 9
Warning: 1661167266 is not a SysV shared memory index in 
/home/jason/dev/php/ipc/shm1.php on line 10

Am I doing something wrong, or is this a problem with PHP?

Jason

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


[PHP] Error with Absolute URLs

2003-12-23 Thread user
Hi,

I keep getting errors on my websites, that contain absolute URLs, e.g. 
http://www.url.com/blah.html. With most, being in the folder of my 
website, it's fine, i can just add $_SERVER['DOCUMENT_ROOT'], but 
there's a script I use to display the network statistics of an IRC 
network, which is located on a different server, so i can't use the 
$_SERVER['DOCUMENT_ROOT'], I'm wondering if anyone has an answer to 
this. I'm almost to the stage of just asking the script owner if I can 
have it located locally, so i can use the $_SERVER['DOCUMENT_ROOT'] 
variable.

It was working fine until the server admin updated to PHP 4.3.4, but he 
is not the best with PHP/HTML programming, so he can't help much.

Hope someone can help.

Thanks!

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


[PHP] Re: newbie: extracting lines from a text file w/ php

2001-10-01 Thread user

Hi.
You should go on the forum php.db.



Sc wrote:

> Hi;
> 
> I am new to php and i need to extract specific lines of data from a plain
> text file and insert it into a sql db Can anyone give me some details
> on howto do this? or an example to read the specific line that i need?
> 
> Thanks.
> 
> 
> -sc
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Variable Scope with require_once

2009-04-27 Thread user

Hello, all.

I have a working app that runs in PHP 4.4.9 on the server.  I develop 
the app on my local environment, which runs PHP 5.2.6.


The setup is thus:

From my index, I have

require_once('config.php');
require_once('dbstuff.php');

config.php looks like this:



dbstuff.php looks like this:

  $dbh = mysql_connect($db_host, $db_user, $db_password) or die('Could 
not connect: ' . mysql_error());

}

...snipped...

?>

For some reason, the $db_host, $db_user, and so on defined in config.php 
are not accessible from dbstuff.php on my development environment.  I 
wlll get


[timestamp] [error] [client 127.0.0.1] PHP Notice:  Undefined variable: 
db_host in somepath\db_stuff.php on line whatever


which causes

'Could not connect: some MySQL error message that is obtained when 
attempting to login with a nonexistent user'


This works on the production environment (the one with PHP version 
4.4.9).  register_globals is Off in both environments.


What is going on, here?

Regards,
A. Wilson

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



[PHP] Re: Memory investigation

2010-03-03 Thread user
ON Linux I have kcacheGrind setup with Xdebug and I find it is a nice 
little thing to have. It won't tell you the memory consumed but it will 
find cycles and display object maps. if you have Kcachegrind it is 
likely you have valgrind installed.

http://www2.mandriva.com/
http://valgrind.org/
http://kcachegrind.sourceforge.net/html/Home.html
http://xdebug.org/
Larry Garfield wrote:
Hi folks.  I have a complicated PHP app that is eating up more memory than I 
think it should.  I have a couple of theories as to where it could be going, 
but I need some way to verify it.


There are a number of large data structures (mostly arrays) that get built up 
throughout the course of the request.  What I'd like to be able to do is at 
certain points check to see how much memory those data structures are using.  
Because they're not all built at once, the usual "check memory before, build, 
check after" routine won't work.  Plus, that gets screwed up by PHP's use of 
copy-on-write at times.


I know that it would result in essentially over-reporting, but I would ideally 
like to be able to ignore the copy-on-write issue and say "if this variable 
were the only thing in memory (and its dependents, of course, for a nested 
array), what would its memory usage be?  I just have no idea how to do that.


Anyone have a suggestion for how to accomplish that?

--Larry Garfield


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



[PHP] XML with PHP

2010-08-26 Thread user

Hi

I am trying to read XML files (invoices) from a directory and display 
them to the visitor. Each XML file contains several invoices. The 
visitor then clicks on the XML file (invoices). My PHP snippet should 
open the xml file and locate the appropriate invoice and display the 
content.


I have managed to list the directory contents using the following PHP 
snippet. The function call below DisplayBill($MemberId, $FileName, 
$StyleSheet) should take the memberid (login), the xml file name which 
has been clicked and the stylesheet to be used.


I now have the following doubts for which I need clarifications

Architecturally is it necessary the DisplayBill should be a seperate php 
file or can it exist as a function in the same file as the code below?


Should the Invoices be displayed as a web form for me to capture the 
user click to retrieve the appropriate file and invoice so that I can 
display it to the user.


I intend to parse the XML file using XPath (at this stage I am not sure 
if php supports Xpath and XQuery!)


Any help would be appreciated

Best regards

Sridhar

-

";
echo "";
While (($FileName = readdir($DirHandle)) !== false)
{
if ($FileName != "." && $FileName != "..")
{
if (strpos($FileName, "xml") !== false)
{
$BillYear = substr($FileName, 0, 4);
$BillMonth = substr($FileName, 5, 2);
switch ($BillMonth)
{
case "01":
$BillMonth = "January";
break;
case "02":
$BillMonth = "February";
break;
case "03":
$BillMonth = "March";
break;
case "04":
$BillMonth = "April";
break;
case "05":
$BillMonth = "May";
break;
case "06":
$BillMonth = "June";
break;
case "07":
$BillMonth = "July";
break;
case "08":
$BillMonth = "August";
break;
case "09":
$BillMonth = "September";
break;
case "10":
$BillMonth = "October";
break;
case "11":
$BillMonth = "November";
break;
case "12":
$BillMonth = "December";
break;
}
			echo "" . "$BillMonth" . " " . 
"$BillYear" . "" . "\n";

echo "";

}
}
}
echo "";
closedir($DirHandle);

$result = DisplayBill($MemberId, $FileName, $StyleSheet);

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



[PHP] File Upload MultiPart

2013-02-24 Thread user

Hello,

I have been looking how to upload big files more than 1GB , with php but 
it doesn't work well. I guess php POST multipart method is to memory 
consuming.
Is there a way , like in the apache.commons to catch the stream and 
handle it ?
I've looked at the rfc1867.c file implementation and it seems that this 
is where the memory goes really up. Is there a way we could change this ?


Kind Regards
Wim

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



[PHP] Extension : compiling several .C files ?

2004-04-20 Thread user
Hi,

I've learn how to compile a simple (with only one .C file) extension 
under Windows and Linux. And multi .C file compilation with Windows.

But how can I compile a PHP extension composed by several .C files ? I'm 
not an expert in GCC compilation. So perheaps I've missed something.

For linux, I use the information give by the php documentation

http://www.php.net/manual/fr/zend.creating.php

The example give in the doc is fine for one .c file, but does not works 
for several .C files.

Thx for helping me :).

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


[PHP] Re: Extension : compiling several .C files ?

2004-04-21 Thread user
Any help will be greatly appreciated. Perheaps someone has a link to a 
newsgroup or a forum where I can find an answer

thx

[EMAIL PROTECTED]

[EMAIL PROTECTED] wrote:
Hi,

I've learn how to compile a simple (with only one .C file) extension 
under Windows and Linux. And multi .C file compilation with Windows.

But how can I compile a PHP extension composed by several .C files ? I'm 
not an expert in GCC compilation. So perheaps I've missed something.

For linux, I use the information give by the php documentation

http://www.php.net/manual/fr/zend.creating.php

The example give in the doc is fine for one .c file, but does not works 
for several .C files.

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


[PHP] Help with SQLite and ADOdb

2004-02-21 Thread user
I'm working on a website whose hosting package doesn't include any db 
(except maybe gdbm).

I've install sqlite in the home directory.
The question is what adjustment do I have to make to my PHP script and ADOdb
in order for it to exicute SQLite in from the account home direcory?
TIA,
Davd
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Safe Mode

2004-02-21 Thread user
Lucas Gonze wrote:
On Saturday, Feb 21, 2004, at 09:18 America/New_York, 
[EMAIL PROTECTED] wrote:

Is it possible to set Apache in such a way that everyting is run under 
safe-mode, except for a directory and everything underneath in a 
virtual domain?


Very likely yes, if your admin permits it.  The place to look for an 
answer is in documentation for httpd.conf.

Good luck.

- Lucas
Can safe mode be turned off in the .htaccess file?

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


Re: [PHP] Safe Mode

2004-02-22 Thread user

Can safe mode be turned off in the .htaccess file?


I don't know the gallery script but setting safe_mode_include_dir should 
help. Ask the admin to set it to your directory for your virtual host. 
Another option would be to use ftp functions to upload the images to 
your directory, but you would have to rewrite the script.
According the safe-mode page http://us4.php.net/features.safe-mode in 
http.conf :

  php_admin_value open_basedir /docroot
# In  your case safe_mode_include_dir


Can "php_admin_value" be inlcuding in the *.php pages and/or .htaccess.

David

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


[PHP] [SQLite] safe_mode_gid or safe_mode_exec_dir

2004-02-22 Thread user
I want to be able to use SQLlite on my hosted (virtual) site.
SQlite will be placed in my  /home/www/bin.
And need to be exicutable by Apache user or group?
Would either safe_mode_gid or safe_mode_exec_dir accomplish this?

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


Re: [PHP] Safe Mode

2004-02-22 Thread user

According the safe-mode page http://us4.php.net/features.safe-mode in
http.conf :

  php_admin_value open_basedir /docroot
# In  your case safe_mode_include_dir

Can "php_admin_value" be inlcuding in the *.php pages and/or .htaccess.


manual > ini_set()

It would seem form the ini_set() comments that the answer to both is yet:

-
There is another possibility by changing PHP Settings!
If your Webspace is able to handle ".htaccess" files, you're able to 
change PHP_INI Settings through this file!

To disable register_globals you have to set:
php_value register_globals 0
If you wanna set other settings, feel free, because there is no problem!

These Settings are set before running the script, e.g. the results of 
register_globals, when setting a parameter in the URL like 
'foo.php?foo=stuff', is not present, $foo is unset.


If it´s not your server and therefore you want to hide the data in your 
session variables from other users, it´s very useful to set the 
session.save_handler in your scripts to shared memory with:

"ini_set('session.save_handler','mm')".

Remember: You have to set it in every script that uses the session 
variables BEFORE "session_start()" or php won´t find them.

David

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


[PHP] Embedded MySQL server (libmysqld)?

2004-02-23 Thread user
Howdy --
Would someone point or provide me with an example of PHP + libMysqld 
(Embedded MySQL server)?

 My problem is my churchs web site doesn't provide a MySQL database as 
a default package (add $15.95/mo)for a MySQL Db.

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


[PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread user
Adam Voigt wrote:
Check these guys out:

http://spenix.com/WebHostingPlans.aspx

Very cheap, very reliable, great features, and support is second to none
I've ever experienced, and before you ask, no I'm not now nor have I
ever been an employee or shareholder. =) Just a satisfied customer.
Admin --
There is no shortage of good cheap hosting package.
The choice of hosting providers is out of my hands.
What I'm looking for is a way to implement a  relational database in 
docuument_root of the web site (ie. /home/username)?

David

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


Re: [PHP] Re: [PHP-DB] Embedded MySQL server (libmysqld)?

2004-02-23 Thread user
Adam Voigt wrote:
Alright, well with any txt based system, your probably going to run into
problems with multi-users (multiple browsers) updating the DB.
Reguardless, if you must use txtbased, I recommend SQL-Lite, it supports
SQL statements, and is very small and very fast.
http://www.sqlite.com
Quoting myself(
What I'm looking for is a way to implement a  relational database in 
docuument_root of the web site (ie. /home/username)?
)
David
Adam,
Thanks for your repsone(s) now back the root of the problem.
As stated above I need to be able to run the database from with the home 
direcory/document root?

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


[PHP] Php shell_exec_ timeout

2004-11-11 Thread user
HI,
Does anybody know if its possible to execute a command through exec, 
shell exec, system  and if the program doesn't terminate in N seconds 
returns control to PHP ?

Thanks in advance
Rui Francisco
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] php broken pipe

2004-11-17 Thread user
I did and the result is the same.
Could this be a bug in the pcntl_fork or pcntl_wait ?
The error occours after i the child died. The connection to the database 
is closed.

Thanks
Rui Francisco
Greg Donald wrote:
On Tue, 16 Nov 2004 09:59:57 +, Rui Francisco <[EMAIL PROTECTED]> wrote:
I'm using a query in loop and go through all records to do some operations
in the middle of the script i fork(); to do other things
When i return to the parent process i try to make one update and i get
the following error
[nativecode=Unable to complete network request to host "127.0.0.1".
Error writing data to the connection. Broken pipe]

You might try pcntl_fork() instead.

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


[PHP] Re: PHP 5 MySql 4.1 issue - can't connect to mysql.sock

2004-12-19 Thread user
Barley wrote:
If I run the script from a shell prompt as root, it outputs "Yes". If I run
as any other user, it outputs "No." It also gives this error:
Warning: mysqli_connect(): Can't connect to local MySQL server through
socket '/var/lib/mysql/mysql.sock' (13)
Check permissions on /var/lib/mysql. From the sockets manpage:
NOTES
In the Linux implementation, sockets which are visible in the filesystem 
honour the permissions of the directory they are in. Their owner, group 
and their permissions can be changed. Creation of a new socket will fail 
if the process does not have write and search (execute) permission on 
the directory the socket is created in. Connecting to the socket object 
requires read/write permission. This behavior differs from many 
BSD-derived systems which ignore permissions for Unix sockets. Portable 
programs should not rely on this feature for security.

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


[PHP] gallery (4 in a row) // carefull newbie

2004-12-28 Thread user
Hi all
I am making a gallery for my Homepage. Now, I want to make little 
tumbnails of my work and make a table out of them. So, to not put them 
all in a row, what whould make the site unreadable, i have to put them 
in a little table, an i think 4 in each row would be ok.

I like to read out the pic's name etc. out of a mysql table. But how do 
make the script to write a  after it read out 4 entries of a mysql 
table?

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


[PHP] IMAP and make

2002-06-18 Thread php user

At this point in the make I get this error related to --with-imap and
--with-ssl-imap ...I believe

Making all in .
make[1]: Entering directory `/usr/lib/php-4.2.1'
/bin/sh /usr/lib/php-4.2.1/libtool --silent --mode=link gcc  -I.
-I/usr/lib/php-4.2.1/ -I/usr/lib/php-4.2.1/main -I/usr/lib/php-4.2.1
-I/usr/include/apache -I/usr/lib/php-4.2.1/Zend -I/usr/include/imap
-I/usr/libmcal/ -I/usr/lib/php-4.2.1/ext/mysql/libmysql
-I/usr/lib/php-4.2.1/ext/xml/expat  -DLINUX=22 -DDEV_RANDOM=/dev/random -DEAPI
-DEAPI_MM -I/usr/lib/php-4.2.1/TSRM -g -O2 -prefer-pic   -o libphp4.la -rpath
/usr/lib/php-4.2.1/libs -avoid-version -L/usr/bin/openssl/lib -L/usr/libmcal/ 
-R /usr/bin/openssl/lib -R /usr/libmcal/ stub.lo  Zend/libZend.la
sapi/apache/libsapi.la main/libmain.la regex/libregex.la
/usr/lib/php-4.2.1/ext/ctype/libctype.la /usr/lib/php-4.2.1/ext/ftp/libftp.la
/usr/lib/php-4.2.1/ext/gettext/libgettext.la
/usr/lib/php-4.2.1/ext/imap/libimap.la /usr/lib/php-4.2.1/ext/mcal/libmcal.la
/usr/lib/php-4.2.1/ext/mysql/libmysql.la /usr/lib/php-4.2.1/ext/pcre/libpcre.la
/usr/lib/php-4.2.1/ext/posix/libposix.la
/usr/lib/php-4.2.1/ext/session/libsession.la
/usr/lib/php-4.2.1/ext/standard/libstandard.la
/usr/lib/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lmcal -lcrypto -lssl
-lc-client -lcrypt -lintl -lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt -ldl
make[1]: Leaving directory `/usr/lib/php-4.2.1'

I received this error message-->

/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make: *** [all-recursive] Error 1

Mandrake 8.2 PPC
Had to compile own php for use with horde's imp also this is DSO configure.
I hope someone thinks this is a simple question.

Thank You,
-Eric

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




[PHP] IMAP and I make... and what do I get recursion :)

2002-06-18 Thread php user

At this point in the make I get this error related to --with-imap and
--with-ssl-imap ...I believe

Making all in .
make[1]: Entering directory `/usr/lib/php-4.2.1'
/bin/sh /usr/lib/php-4.2.1/libtool --silent --mode=link gcc  -I.
-I/usr/lib/php-4.2.1/ -I/usr/lib/php-4.2.1/main -I/usr/lib/php-4.2.1
-I/usr/include/apache -I/usr/lib/php-4.2.1/Zend -I/usr/include/imap
-I/usr/libmcal/ -I/usr/lib/php-4.2.1/ext/mysql/libmysql
-I/usr/lib/php-4.2.1/ext/xml/expat  -DLINUX=22 -DDEV_RANDOM=/dev/random -DEAPI
-DEAPI_MM -I/usr/lib/php-4.2.1/TSRM -g -O2 -prefer-pic   -o libphp4.la -rpath
/usr/lib/php-4.2.1/libs -avoid-version -L/usr/bin/openssl/lib -L/usr/libmcal/ 
-R /usr/bin/openssl/lib -R /usr/libmcal/ stub.lo  Zend/libZend.la
sapi/apache/libsapi.la main/libmain.la regex/libregex.la
/usr/lib/php-4.2.1/ext/ctype/libctype.la /usr/lib/php-4.2.1/ext/ftp/libftp.la
/usr/lib/php-4.2.1/ext/gettext/libgettext.la
/usr/lib/php-4.2.1/ext/imap/libimap.la /usr/lib/php-4.2.1/ext/mcal/libmcal.la
/usr/lib/php-4.2.1/ext/mysql/libmysql.la /usr/lib/php-4.2.1/ext/pcre/libpcre.la
/usr/lib/php-4.2.1/ext/posix/libposix.la
/usr/lib/php-4.2.1/ext/session/libsession.la
/usr/lib/php-4.2.1/ext/standard/libstandard.la
/usr/lib/php-4.2.1/ext/xml/libxml.la TSRM/libtsrm.la -lmcal -lcrypto -lssl
-lc-client -lcrypt -lintl -lcrypt -lresolv -lm -ldl -lnsl -lresolv -lcrypt -ldl
make[1]: Leaving directory `/usr/lib/php-4.2.1'

I received this error message-->

/usr/bin/ld: cannot find -lcrypto
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make: *** [all-recursive] Error 1

Mandrake 8.2 PPC
Had to compile own php for use with horde's imp also this is DSO configure.
I hope someone thinks this is a simple question. ...with a simple answere...

Thank You,
-Eric


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




[PHP] Combine 2 Db Columns with an Array?

2002-05-13 Thread PHP User

I am trying to find the best way to combine 2 columns in a MySQL Db call into
one by using an array. I’ve tried array_push, implode, explode, array_merge and
extract all with no luck. I feel I am close but have read all I can and still am
hitting a dead end.
I need to select a Title and Alternate title from a table, and then list the
results by BOTH the Title and Alternate Title. So the list that gets echoed out
would be a combined array of the Title column and the Alt_Title column. The idea
is to have each item listed twice, once by it’s title and once by it’s alternate
title.
I can not find a way to merge the 2 separate columns.
Here’s what I’m trying to do:

$result = mysql_query("SELECT Title, Alt_Title, Size, Price, More, Comment
ORDER BY title");

//magically combine the title & alt_title into on nice variable called
$Title
//or whatever
while ($db = mysql_fetch_array($result))
{
echo “$Title”;
}





Re: [PHP] Header() don't work

2001-10-18 Thread Web user

The original scripts of login.php have the line: require("lib.inc");, the
lib.inc is as below



After I deleted the require() line, and use myslq_connect() and
mysql_select_db() in the login.php,
the header() does work. So I think there must be some output while running
at the line of "return $handler;"

Regards
Mike








-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Help, need the scripts of processing the to-be-confirmed email.

2001-10-25 Thread Web user

I need to some help about example scripts on:
Question 1:
How to process the confirmation email by clicking the url given in the email
and by replying the email.

Question 2:
I know if using mail(), the "From" field of the mail sent out is always the
web host server's mail sendout server,
not from my own email box. How to send out the email which looks like
sending out from my own email box.
Question 3:
How to let MYSQL automatically delete the unactivated signups?


Thanks!
Mike











-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] What's the difference between mail() in PHP and sendmail?

2001-10-26 Thread Web user

What's the difference between mail() in PHP and sendmail?
Thanks!
Mike



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Executing a PHP file to write an html file

2001-03-31 Thread PHP User

Here is my problem.
I have a file, static.php
static.php writes to index.html by way of...
$filename = "/web/h16/docs/index.html";
$fp = fopen("$filename","w");
fwrite($fp, "\n");
etc..

If I hit static.php from the command line, index.html gets written just fine. 
static.php does it's job.

If I try to exec(), or  system() static.php from a browser the browser just hangs. eg. 

I add:
system ('/usr/local/bin/php web/h16/docs/index.html);
or
exec ('/usr/local/bin/php web/h16/docs/index.html);
To a file and get nothing. I tried with and without the absolute paths in the 
commands.

What I want to be able to do is every time I update a Db, at the same time I want the 
index page to be rewritten to reflect the changes in the Db. And I don't want to have 
to go to the command line everytime I want to rewrite the index page. So I would just 
hit "SAve" in the update.php page, it would save to the Db, which it does now, and at 
the same time it hits static.php and therefore rewrites index.html

I also tried header() but that was no good due to echo in the pages, gives that header 
already sent error.

Is there a funtion I am missing somehwere that does the job?

It's a Unix box running php 4.03, and the Db is MySQL

Thanks Much!!

-

*
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] max_execution_time && sleep()

2001-04-05 Thread PHP User

What is the deal with sleep(), does it break the 'max_execution_time' that is set in 
php.ini?

This is good, this is what I want, but I just want to double check that this is really 
happening.

I have an emial script that seems to run for about 15 minutes because I sleep() it 
between each email for a few seconds. It runs way longer than 'max_execution_time' is 
set for.

-

*
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Mail() Speed?

2001-04-05 Thread PHP User

Would opening a direct connection to sendmail be a bad thing to do in terms of speed 
and server time?
Right now I loop through an array of email addresses, and just send them each out with 
mail() would something like this be better or worse in terms of the amount of time and 
resources it uses on the server?

0) { return 1; } else { return 0; } }
?>


*
Sign up for these FREE offers and have the chance to win money and prizes!
Click Here http://winwith.chek.com/promotions.php3?partnerid=7"
*

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] HTTP 500 server error

2001-08-29 Thread Web user

It always gets HTTP 500 server error, when I  try to run the php scripts on Windows98 
SE + PWS4.0. 
THE PHP installed is Ver 4.06 -win32, as a server module.

However I get a screen full of html codes when  I run c:\php\php.exe -i in MS-DOS 
command line

So what's problem with the installation or configuration?
Thanks

BAKER



[PHP] mysql_fetch_array() doesn't work

2001-09-25 Thread Web user

System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98


http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] mysql_fetch_array() doesn't work

2001-09-26 Thread Web user

System: PHP4.06 + Mysql3.23.41 Win32 + Apache 1.3.20 Win32 + Win98

When PHP is running at the line: $arr=mysql_fetch_array($res);
The IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]"

What's the problem wiht mysql_fetch_array() or other?
What does the T_STRING' or `T_VARIABLE' or `T_NUM_STRING' mean?

THANKS
Mike


The full code below:
----

User
Added timeStatus";
$num=mysql_num_rows($res);
for($i=0; $i<$num; $i++) {
$arr=mysql_fetch_array($res);   /* HERE is line where the error occurs!!!
*/
echo "
$arr['user_name']>";
echo "$arr['time']";
echo "$arr['status']";
echo "$arr['comment']";
}

echo "";

echo "";  /* show others in multi-pages */
for($i=0; $i<$pages; $i++){
echo "
echo ($i+1)."";
echo "  ";
}
echo "";

?>


-
create table users (
user_id int not null auto_increment primary key,
user_name varchar(30),
time datetime,
status tinyint(1),
comment text,
sign tinyint(1) default '1'
);







-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mysql_fetch_array() doesn't work

2001-09-30 Thread Web user

Hello,
First, Thank you all for your help!
I  finally found the reason for why does  the IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]"

It is because the echo (including print) doesn't work at the line below,
echo "";
showing the error info as I mentioned. ( but it should work according to PHP
books)

It only works when  the $arr['user_id'] is out of the quotes.
echo "";
then IE showed no error any longer.

So I have to let all $arr['key']  out of the quotes, then the scripts are
Ok.

Regards
Mike

















-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Re: mysql_fetch_array() doesn't work

2001-09-30 Thread Web user

Hello,
First, Thank you all for your help!
I  finally found the reason for why does  the IE always show info as below:
"Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
`T_NUM_STRING' in c:\program files\apache
group\apache\htdocs\web\site1\list.php on line --[the number of line]"

It is because the echo (including print) doesn't work at the line
below,
echo "";
showing the error info as I mentioned. ( but it should work according to PHP
books)

It only works when  the $arr['user_id'] is out of the quotes.
echo "";
then IE showed no error any longer.

So I have to let all $arr['key']  out of the quotes, then the scripts are
Ok.

Regards
Mike















-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Session and header() errrors

2001-10-04 Thread Web user

Why do the errors occur while running the scripts below? It seems that the
errors occured at the part of session and header(). Please give me some
advice!
Thank you!

Mike

System: PHP4.06 + Apache 1.3.20 Win32 + Win98 (the session configurations
are default in php.ini)

when the 1.php is running, the IE shows errors info as below :
-
Warning: Cannot send session cookie - headers already sent by (output
started at c:\program files\apache group\apache\htdocs\web1\html-head.inc:9)
in c:\program files\apache group\apache\htdocs\web1\1.php on line 3

Warning: Cannot send session cache limiter - headers already sent (output
started at c:\program files\apache group\apache\htdocs\web1\html-head.inc:9)
in c:\program files\apache group\apache\htdocs\web1\1.php on line 3

Warning: open(/tmp\sess_96ae897bcb501486860552d2df862863, O_RDWR) failed: m
(2) in c:\program files\apache group\apache\htdocs\web1\1.php on line 3
session_id: 96ae897bcb501486860552d2df862863


Warning: Cannot add header information - headers already sent by (output
started at c:\program files\apache group\apache\htdocs\web1\html-head.inc:9)
in c:\program files\apache group\apache\htdocs\web1\1.php on line 9

-
The scripts of 1.php: (1.php and 2.php are under the same base directory)
";
sleep(10);
header("Location: 2.php");
require("html-foot.inc");
?>

-
The scripts of html-head.inc:



page title



-
The scripts of html-foot.inc:











-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Email Forms

2004-07-15 Thread PHP User
Hi,

I am trying unsuccessfully to set up an email form and as far as I know my
code is fine, but it won't send. I suspect that it's because my server
requires authentication.

Running my script on my Windows machine I get the following.

Warning: mail() [function.mail  ]: SMTP
server response: 550 not local host myhost.ca, not a gateway in...

On Linux I don't get a specific error message, the mail just never shows up.

I am in the right ballpark here with the authentication, and if so, how can
I get around this..?

Thanks



[PHP] Need help with line breaks in a textarea form

2004-07-15 Thread PHP User
Hi,

I have been trying to format the textarea output and have come across some
code that almost does what I need, but I still have one small problem.

Look at the text below that was input into my textarea:

Now is the time for all young men to come to the aid of the party. Now is
the time for all young men to come to the aid of the party.
Testing
Now is the time for all young men to come to the aid of the party. Now is
the time for all young men to come to the aid of the party.
Testing.

When I print this out to my webpage it has a line break before and after the
word Testing. I want it to be a wysiwyg - so in the case above there should
be no extra line breaks. It should look exactly as typed.

The code I tried to change the \n to  are:

$text2= nl2br ($text); 
or
$text2 str_replace("\n","",$text);

This is what I have in my form.



Thanks, any help is appreciated.

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



RE: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread PHP User
 
Thanks for the info John, but your suggestion produces the same output. Look
at the source below to see what it produces.

Now is the time for all young men to come to the aid of the party. Now is
the time for all young men to come to the aid of the party.

Testing

Now is the time for all young men to come to the aid of the party. Now
is the time for all young men to come to the aid of the party.

Testing

After 'party' and 'Testing' I hit enter twice, but as you can see above it
adds a 3rd and 4th ...

Suggestions?

Thanks


-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2004 2:00 AM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Need help with line breaks in a textarea form

PHP User wrote:

> Hi,
> 
> I have been trying to format the textarea output and have come across 
> some code that almost does what I need, but I still have one small
problem.
> 
> Look at the text below that was input into my textarea:
> 
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing.
> 
> When I print this out to my webpage it has a line break before and 
> after the word Testing. I want it to be a wysiwyg - so in the case 
> above there should be no extra line breaks. It should look exactly as
typed.
> 
> The code I tried to change the \n to  are:
> 
> $text2= nl2br ($text);
> or
> $text2 str_replace("\n","",$text);
> 
> This is what I have in my form.
> 
> 



--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

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



RE: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread PHP User
 
John,

Something came to mind as soon as I sent my last email, and it seems to
work. Not sure it will work in every circumstance but the few tests I tried
seemed ok. This is what I did. I added the two following lines to my script.

$text=str_replace("\n","",$text);
$text=str_replace("","",$text);

Thanks for your input

CR

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2004 2:00 AM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Need help with line breaks in a textarea form

PHP User wrote:

> Hi,
> 
> I have been trying to format the textarea output and have come across 
> some code that almost does what I need, but I still have one small
problem.
> 
> Look at the text below that was input into my textarea:
> 
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing
> Now is the time for all young men to come to the aid of the party. Now 
> is the time for all young men to come to the aid of the party.
> Testing.
> 
> When I print this out to my webpage it has a line break before and 
> after the word Testing. I want it to be a wysiwyg - so in the case 
> above there should be no extra line breaks. It should look exactly as
typed.
> 
> The code I tried to change the \n to  are:
> 
> $text2= nl2br ($text);
> or
> $text2 str_replace("\n","",$text);
> 
> This is what I have in my form.
> 
> 



--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

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



RE: [PHP] Need help with line breaks in a textarea form

2004-07-16 Thread PHP User
John,

If I just echo $text on the webpage now, everything shows as it should.

HOWEVER, another problem I didn't even clue into until now. This form gets
emailed to a specified address and all I get in my email is one long line
with no line breaks. How do I fix this? I was reading a thread in a web
based group you were having with another person, but none of your
suggestions there worked.   

Suggestions

Thanks again...

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 16, 2004 12:14 PM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Need help with line breaks in a textarea form

PHP User wrote:
> Something came to mind as soon as I sent my last email, and it seems 
> to work. Not sure it will work in every circumstance but the few tests 
> I tried seemed ok. This is what I did. I added the two following lines to
my script.
> 
> $text=str_replace("\n","",$text);
> $text=str_replace("","",$text);

Okay... let's say you have $text that is text that was entered into a
textarea. To put it _back into_ a textare, you simply need to do this:



That's it. If you want to display $text to the user outside of a ,
then you do this:

echo nl2br(htmlentities($text));

If you want to insert $text into a database and magic_quotes_gpc is enabled,
you do this:

$query = "INSERT INTO yourtable (textcolumn) VALUES ('$text')";

If magic_quotes_gpc is not enabled (you can check with
get_magic_quotes_gpc(), btw), then you'd use this:

$text = addslashes($text);
$query = "INSERT INTO yourtable (textcolumn) VALUES ('$text')";

If you'd like to extract the winning lottery numbers from $text, you
simply...

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

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



[PHP] Line breaks again....

2004-07-21 Thread PHP User
Hi,

I have managed to get the line breaks to show up on my site no problem, but
I still get one long line when it is sent to my email. I have looked and
looked and have read all the stuff I could find on \r\n, so I'm not sure
where to go from here since it's not working...

Suggestions are appreciated.

Thanks, Beauford


RE: [PHP] Line breaks again....

2004-07-21 Thread PHP User
I am using Outlook 2003 in text mode to view messages (which is what I
want). This is the relevent code...

 Code for input from form .

$text=str_replace("\n","\r\n",$text);  
* this replaces \n before the email is sent. Not sure this is necessary or
right, but nothing else I have tried works either *

if($mail->Send()) * email gets sent
{

$text=str_replace("\n","",$text); 
$text=str_replace("","",$text); 
* these two lines make it display properly on my site *

. Code to display message 

Thanks

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: July 21, 2004 6:36 PM
To: PHP User
Cc: PHP
Subject: Re: [PHP] Line breaks again

PHP User wrote:

> I have managed to get the line breaks to show up on my site no problem,
but
> I still get one long line when it is sent to my email. I have looked and
> looked and have read all the stuff I could find on \r\n, so I'm not sure
> where to go from here since it's not working...

Are you viewing HTML email or plain text? Using \r\n or \n will work 
fine in most email viewers. Are you sure you're not stripping the \n 
from the text to show it with  in HTML and then screwing up the 
presentation in email? Hard to tell what you're doing without any 
code... hint hint...

-- 

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

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



RE: [PHP] smpt server requiring authentication

2004-07-22 Thread PHP User
I had the same problem and found a script - phpmailer-1.72 - that works
great. Very little configuration to setup, and I have it working on a Linux
and Windows platform.

Beauford 

-Original Message-
From: Chris Hunt [mailto:[EMAIL PROTECTED] 
Sent: July 22, 2004 3:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] smpt server requiring authentication

Hi,

anyone know how to configure php's outgoing mail to use a smtp server that
requires authentication?

thanks for any help,

cheers,

Chris

-- 
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] cuRL script won't submit

2008-04-02 Thread Test User
why will this script not submit the form - it does input data into the form - 
but not submit it. below is the script and then the html form.. thanks

#!/usr/bin/php
http://192.168.10.10/?link=answer&l=c&qid=25AA98zRa";;);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 
"link=answer&qid=25AA98zRa&.crumb=x88&textarea=here+ya+go&prev_ans_page=&e=0&sumbit1=Sumbit");
$result = curl_exec ($ch);
curl_close ($ch);
echo $result;
?>

/// below is the HTML form 
\\\















  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


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



Re: [PHP] cuRL script won't submit

2008-04-02 Thread Test User
I added more info below and corrected the spelling of a word - very sorry to 
add more to your already full mailbox

why will this script not submit the form - it does input data into the form - 
but not submit it. below is the script and then the html form.. thanks

#!/usr/bin/php
http://192.168.10.10/?link=answer&l=c&qid=25AA98zRa";;);
curl_setopt ($ch, CURLOPT_POSTFIELDS, 
"link=answer&qid=25AA98zRa&.crumb=x88&textarea=here+ya+go&prev_ans_page=&e=0&submit1=Submit");
$result = curl_exec ($ch);
curl_close ($ch);
echo $result;
?>

/// below is the HTML form 
\\\















  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


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






  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com

Re: [PHP] cuRL script won't submit

2008-04-02 Thread Test User
many thanks.. I have been working on this for weeks!
now I have to figure out how to extract that dynamic URL from the form before I 
post..

- Original Message 
From: Daniel Brown <[EMAIL PROTECTED]>
To: Test User <[EMAIL PROTECTED]>
Cc: php-general@lists.php.net
Sent: Wednesday, April 2, 2008 8:54:16 AM
Subject: Re: [PHP] cuRL script won't submit

On Wed, Apr 2, 2008 at 9:24 AM, Test User <[EMAIL PROTECTED]> wrote:
> why will this script not submit the form - it does input data into the form - 
> but not submit it. below is the script and then the html form.. thanks
>
[snip!]
>  curl_setopt($ch, 
> CURLOPT_URL,"http://192.168.10.10/?link=answer&l=c&qid=25AA98zRa";;);
[snip!]
>  /// below is the HTML form 
> \\\
>
>   onsubmit="this.submit1.disabled=true;" method="post" name="template_form">
[snip!]

Because you're submitting it to the wrong page.  What you're doing
will submit to the default (index) page in that directory, as opposed
to the form action.  Change this:

curl_setopt($ch,
CURLOPT_URL,"http://192.168.10.10/?link=answer&l=c&qid=25AA98zRa";;);
curl_setopt ($ch, CURLOPT_POSTFIELDS,
"link=answer&qid=25AA98zRa&.crumb=x88&textarea=here+ya+go&prev_ans_page=&e=0&submit1=Submit");

To this:

curl_setopt($ch,
CURLOPT_URL,"http://192.168.10.10/question/act;_lt=Aktsgb5HMZ0vBEUSHj_3I1YdzKIX;_lv=3";);
curl_setopt ($ch, CURLOPT_POSTFIELDS,
"link=answer&qid=25AA98zRa&.crumb=x88&textarea=here+ya+go&prev_ans_page=&e=0&submit1=Submit");


Also, note two things:

1.) I removed the semicolon from the end of the CURLOPT_URL
value (between the quotes and parentheses).
2.) The form action looks like it's most likely dynamic, so
you'll have to think of a workaround yourself if it is.

-- 

Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283





  

You rock. That's why Blockbuster's offering you one month of Blockbuster Total 
Access, No Cost.  
http://tc.deals.yahoo.com/tc/blockbuster/text5.com


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



[PHP] Servlet/PHP integration

2004-03-12 Thread dba user
I am sorry, if this message is a duplicate post. (I unwittingly press some key and the 
page got refreshed before completing my post).
 
I am trying the Servlet/Php integration. I installed php with java support. But, I do 
not see "php_java.jar" in any of the directories. I have 
"/usr/local/php4/lib/php/phpsrvlt.jar" though. I am wondering why I did not have the 
php_java.jar file? How do I verify I got php installed with java support? [I did not 
get any error message during make install].
 
Also, when I tried to acess the test.php, as http://my-server:8080/examples/test.php , 
I get the error "Class not found. net.php.servlet". I copied the "phpsrvlt.jar" under 
../server/lib of tomcat. If this is not correct, where would I copy the phpsrvlt.jar? 
Also, does the CLASSPATH of the tomcat should have this jar included? Should it have 
the LD_CONFIG set in the startup script?
 
Thanks.


-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

RE: [PHP] Servlet/PHP integration

2004-03-12 Thread dba user
Thanks Vail,
 
I was following http://us4.php.net/manual/en/ref.java.php#java.servlet and the README 
from php install at sapi/servlet/README. I am new to php and servlet. My friend has a 
requirement to integrate some php stuff into his existing java. I tried to get it 
setup as described in sapi/servlet/README. But, I am not sure whether I can invoke it 
directly from tomcat as in my previous example. 
 
As you said, I will stay tuned to the forum.
 
Regards.

"Vail, Warren" <[EMAIL PROTECTED]> wrote:
in order to execute code under http://my-server:8080/ doesn't it have to be
a java class?

Since PHP was never written in JAVA, that I know of, I suspect it will never
be a class file, and that may explain why you don't find a "php_java.jar".
What you will find is a php_java.so or php_java.dll (depending on your
platform) that executes under PHP which executes usually on an apache
server, usually as a cgi at port 80 (try
http://my-server:80/examples/test.php).

I may be wrong here, but PHP can invoke Java modules, only if it first
invokes the JRE to execute those modules, conversely a Java module could
invoke PHP modules if it first invokes the PHP runtime environment. Whether
you like it or not, Java and PHP run pretty much as equals, each in their
own environment, and the only way they can co exist is you invoke their
runtime environment first. Java runtime has no ability to run PHP code that
I know of and PHP has no ability to interpret the java byte code without
invoking a JRE to do it. When you read the manuals, the authors usually try
to imply that it is more tightly integrated than it really is, but I think
you will find it is pretty much as I've described here. If others disagree,
you will probably hear about it here as well, stay tuned.

http://www.php.net/manual/en/ref.java.php

Warren Vail



-Original Message-
From: dba user [mailto:[EMAIL PROTECTED]
Sent: Friday, March 12, 2004 2:36 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Servlet/PHP integration


I am sorry, if this message is a duplicate post. (I unwittingly press some
key and the page got refreshed before completing my post).

I am trying the Servlet/Php integration. I installed php with java support.
But, I do not see "php_java.jar" in any of the directories. I have
"/usr/local/php4/lib/php/phpsrvlt.jar" though. I am wondering why I did not
have the php_java.jar file? How do I verify I got php installed with java
support? [I did not get any error message during make install].

Also, when I tried to acess the test.php, as
http://my-server:8080/examples/test.php , I get the error "Class not found.
net.php.servlet". I copied the "phpsrvlt.jar" under ../server/lib of tomcat.
If this is not correct, where would I copy the phpsrvlt.jar? Also, does the
CLASSPATH of the tomcat should have this jar included? Should it have the
LD_CONFIG set in the startup script?

Thanks.


-
Do you Yahoo!?
Yahoo! Search - Find what you're looking for faster.

-
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster.

[PHP] LDAP and referrals

2004-12-12 Thread List User
Hello!

Currently I'm playing with LDAP referrals in a PHP application and
I've reached a point, where it's not clear if there's some kind of
misunderstanding on my side, or if there's a problem either in the
PHP functions or the OpenLDAP server here...

The attached mini script tries to access the local LDAP and searches
for objects containing the uid attribute. The LDAP tree contains two
referrals which point to an external server which definitively has additional
objects containing uid attributes. The plan is to get all objects that contain
the uid attribute - from all trees.

I'm trying to make use of the rebind feature. Since there's no propper
documentation on "how to use" this function, I've been trying several
methods till this moment (anonymous bind for testing), the external
servers get connected, but the search query doesn't seem to show
any ambitions to get executed.

Do I need to do everything manualy (get_first_reference, etc.) or am I
just blind? Any hints would be greately appreciated :-)

Component information:
PHP: 4.3.9 (Debian sarge)
OpenLDAP: 2.1.30 (Debian sarge)

I'm not sure if this should go to php-db instead - if so, sorry :-)

Greetings,
Cajus


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

Re: [PHP] LDAP and referrals

2004-12-12 Thread List User
Whoops.  For some reason I've attached the wrong file. Here's the correct one.

Cajus
#!/usr/bin/php4 -q
ldap://[^/]+)/.*$!', '\\1', $referral);
if (!($ds= ldap_connect($server))){
echo "reconnect failed - ";
return ($ldap);
}
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 1);
ldap_set_rebind_proc($lds, "rebind");
if (!ldap_bind($ds)){
echo "rebind failed - ";
return ($ldap);
}
echo "rebind to $server - ";
return ($ds);
}



# M A I N  #

echo "Opening connection to $server - ";
$ds= @ldap_connect($server);

if ($ds) {
echo "success\n";

echo "Setting up link parameters - ";
ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($ds, LDAP_OPT_REFERRALS, 1);
echo get_error($ds)."\n";

echo "Setting rebind proc - ";
ldap_set_rebind_proc($ds, "rebind");
echo get_error($ds)."\n";

echo "Binding - ";
if (!($r= @ldap_bind($ds))){
echo get_error($ds)."\n\n";
exit (2);
}
echo "success\n";
} else {
echo get_error($ds)."\n\n";
exit (1);
}

echo "Performing search with base '$base' and filter '$filter'\n";
echo "* starting search - ";
$sr=   @ldap_search($ds, $base, $filter, array('uid', 'cn'), 0, 0, 0, 
LDAP_DEREF_ALWAYS);
echo get_error($ds)."\n";
if (!$sr){
exit (3);
}

$info= ldap_get_entries($ds, $sr);
echo "* getting entries - ";
echo get_error($ds)."\n";
if (!$info){
exit (4);
}
for ($n= 0; $n<=$info['count']; $n++){
if (!isset($info[$n]['uid'][0])){
continue;
}
echo "  ".$info[$n]['dn']."\n";
}


echo "Closing connection...\n";
ldap_close($ds);
?>

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

[PHP] {Virus!} [EMAIL PROTECTED]

2005-07-04 Thread farcry-user
Atención: Este mensaje contenía uno o más anexos que han sido eliminados
Atención: (letter.zip).
Atención: Por favor, lea el(los) anexo(s) "VirusWarning.txt" para más 
información.

Your message was not delivered due to the following reason:

Your message could not be delivered because the destination server was
unreachable within the allowed queue period. The amount of time
a message is queued before it is returned depends on local configura-
tion parameters.

Most likely there is a network problem that prevented delivery, but
it is also possible that the computer is turned off, or does not
have a mail system running right now.

Your message was not delivered within 4 days:
Server 83.131.228.15 is not responding.

The following recipients did not receive this message:


Please reply to [EMAIL PROTECTED]
if you feel this message to be in error.

Este es un mensaje del Servicio de Protección de Virus para Correo
Electrónico MailScanner
--
El archivo anexado original "letter.zip"
se considera que ha sido infectado por un virus y el mismo
ha sido reemplazado por este mensaje de aviso.

Si desea recibir una copia del archivo anexado original *infectado*, 
por favor envíe un correo electrónico al departamento de soporte 
incluyendo este mensaje. Alternativamente, puede llamar a dicho
departamento de, teniendo el contenido de este mensaje a mano.

El Mon Jul  4 19:09:12 2005 el analizador de virus dijo:
   F-Prot: letter.zip->letter.exe  Infection: W32/[EMAIL PROTECTED]

Nota para el departamento de soporte: Revisar en the MailScanner en 
/var/spool/MailScanner/quarantine
(mensaje j6508viN026484).
--
Postmaster

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

[PHP] PHP && mySQL

2001-02-07 Thread PHP user
HI!

I am Japanese in Tokyo.
How about you? I still have a question.

initial condition
1)  three are many *html in my SQL ex:xxx.html,and yyy.html 
2)I have domain ex: abc (ex: http://www.abc.com)
3)database  name : aaa
4)table name :bbb


I want to try next step.
when I type in URL from brouze ,ex http://www.abc.com/xxx.html .
I can get xxx.html from my SQL.
when I type in URL from brouze ,ex http://www.abc.com/yyy.html
I can get yyy.html from my SQL.
How can I do this?
Is it posible to create it?


Please answer for me.


Thank you
yui

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]