[PHP] trailing carriage return in file

2003-10-08 Thread Alex Ciurea
hello guys,

I don't know how can I eliminate from a file the trailing ? "\n"

I have a file that ends-up with one ore more 

it looks like this:




BeginOfFile
data here
[]
end of data




EndOfFile




after data I have one or more  (the file don't ends immediately)

i don't know how to match, using preg_replace() the '\n' character...

it's something like "/n/" ?

thanks,



>>>>>>>>>>>>
Have a nice day ! (And I'm sure that tomorrow will be better than today!)
Alex Ciurea Greets You
www.netonwave.com

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



[PHP] php&javascript live-clock

2003-10-07 Thread Alex Ciurea
hello,

is it possible to show the live-clock from the server machine, using php and
javascript, without having to make refresh of that page?


there are scripts in javascript to display a clock, but it's the clock from
client machine, not from server...

php can obtain the live clock of the server, but how can I keep this
information realtime...?


thanks,
alex

>>>>>>>>>>>>
Have a nice day ! (And I'm sure that tomorrow will be better than today!)
Alex Ciurea Greets You
www.netonwave.com


>>>>>>>>>>>>
Have a nice day ! (And I'm sure that tomorrow will be better than today!)
Alex Ciurea Greets You
www.netonwave.com

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



Re: [PHP] is my server working

2003-06-15 Thread Alex Ciurea
oh, I see. My bad, my mistake...

I also have had problems with apache/php in the past. The apache couldn't
parse the php files. All the php tags were interpreted as normal text and
displayed to the browser.

So, try :
>>>>>>
phpinfo();
>>>>>>
into one of your php files.

it should work if your apache/php server is configured properly.


Good luck!


Alex Ciurea Greets You
www.netonwave.com
- Original Message -
From: "Lars Torben Wilson" <[EMAIL PROTECTED]>
To: "Alex Ciurea" <[EMAIL PROTECTED]>
Cc: "php mailinlist" <[EMAIL PROTECTED]>; "Khoo Merry"
<[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 11:18 AM
Subject: Re: [PHP] is my server working


> On Sun, 2003-06-15 at 01:07, Alex Ciurea wrote:
> > try to use echo instead of print()   :
> >
> > >>>>>>
> > echo $myString;
> > >>>>>>
> >
> > or, if u realy want to use the print function, try this:
> >
> > >>>>>>
> > print("$myString", %s);
> > >>>>>>
> >
> > maybe will work
> >
> > 
> > Alex Ciurea Greets You
> > www.netonwave.com
>
>
> I think you might be getting confused with printf(). In that case, the
> above would be:
>
>   printf("%s", $myString);
>
> In any event, the choice will have no impact here. It simply appears
> that the original poster has not got PHP installed properly, or else
> the system is not configured to pass that page of through PHP.
>
>
>   http://www.php.net/print
>   http://www.php.net/printf
>
>
> --
>  Torben Wilson <[EMAIL PROTECTED]>+1.604.709.0506
>  http://www.thebuttlesschaps.com  http://www.inflatableeye.com
>  http://www.hybrid17.com  http://www.themainonmain.com
>  - Boycott Starbucks!  http://www.haidabuckscafe.com -
>
>
>
>
> --
> 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] is my server working

2003-06-15 Thread Alex Ciurea
try to use echo instead of print()   :

>>>>>>
echo $myString;
>>>>>>

or, if u realy want to use the print function, try this:

>>>>>>
print("$myString", %s);
>>>>>>

maybe will work


Alex Ciurea Greets You
www.netonwave.com


- Original Message -
From: "Khoo Merry" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 15, 2003 8:09 AM
Subject: [PHP] is my server working


> I'm using windows me, server apache 1.3 for php.
> I had wrote this code and tried it at local host, but the php code didn't
work. The code is like this:
>
>  $Greet = "Hello World"
> $Today = date("l F d, Y");
> ?>
> 
> 
> Today's date is
>  print("$Today\n");
> print("$Greet");
> ?>
> 
> 
> Istead of print
> Today's date is Sunday June 14, 2003
> Hello World
> The out put is only "Today's date is". Is my server working with php?
> I am really appreciate if anyone can answer my problem.
> Thank you.
>
> merry
>
>
>
> -
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!





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



Re: [PHP] This line does not execute...

2003-06-04 Thread Alex Ciurea
Ok Tod, this is what I understood so far:

1) image.php should generate for you a barcode;

2) you placed an echo statement inside image.php and nothing happens

Marek have good ideea: try to see the html source code, the code that is
interpreted by your browser.

the executable file ./image.php probably don't run.
try to see, from your shell (i think you use linux) if u can run a php
script. e.g.:  ./myscript.php


- Original Message -
From: "Todd Cary" <[EMAIL PROTECTED]>
To: "Alex Ciurea" <[EMAIL PROTECTED]>
Cc: "php mailing" <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 6:22 PM
Subject: Re: [PHP] This line does not execute...


> Alex -
>
> The code I placed in the messsage is a copy and paste of the code from
> the sample.php script provided by the author of the barcode class and it
> agrees with the demo he has on his site.
>
> The "error" is that nothing is happening which I interpret as the file,
> image.php is not being accessed (I put an Echo statement inside it and
> it does not execute).  Here is the complete block of code:
>
>   if ($obj) {
>
>  if ($obj->DrawObject($xres)) {
>  echo " src='./image.php?code=" . $barcode . "&style=" . $style . "&type=" .
> $type . "&width=" . $width . "&height=" . $height . "&xres=" . $xres .
> "&font=" . $font . "'>";
>
>  // My debug code - this line executes!
>  echo " color='#FF'>Success: Barcode = " . $barcode .
> "";
>  } else {
>  echo "" .
> ($obj->GetError()) . "";
>
>  // My debug code
>  echo " color='#FF'>Problem; Barcode = " . $barcode .
> "";
>  }
>   } else {
> // My debug code
> echo "Obj is
> false; Barcode = " . $barcode . "";
>   }
>
>
> Alex Ciurea wrote:
>
> >did u made copy&paste with your code?
> >
> >yes? then why don't you try to use the path='image.php?blahblahmoreblah'
> >
> >
> >no? then please give us more details about the error you're getting...
> >
> >good luck,
> >Alex
> >
> >
> >- Original Message -
> >From: "Todd Cary" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Tuesday, June 03, 2003 6:03 PM
> >Subject: [PHP] This line does not execute...
> >
> >
> >
> >
> >>I am trying to get the Sample Barcode to run on my server, however the
> >>following line does not execute:
> >>
> >> echo "";
> >>
> >>To see if it is executing, I have an "Echo" statement in the script.
> >>
> >>The image.php file is in the same directory as the other script files.
> >> What am I missing here?
> >>
> >>Todd
> >>--
> >>
> >>
> >>
> >
> >.
> >
> >
> >
>
> --
>
>


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



Re: [PHP] This line does not execute...

2003-06-04 Thread Alex Ciurea
oh I see, you want to execute that image.php script ?


- Original Message -
From: "Alex Ciurea" <[EMAIL PROTECTED]>
To: "php mailing" <[EMAIL PROTECTED]>; "Todd Cary"
<[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 6:07 PM
Subject: Re: [PHP] This line does not execute...


> did u made copy&paste with your code?
>
> yes? then why don't you try to use the path='image.php?blahblahmoreblah'
> 
>
> no? then please give us more details about the error you're getting...
>
> good luck,
> Alex
>
>
> - Original Message -
> From: "Todd Cary" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, June 03, 2003 6:03 PM
> Subject: [PHP] This line does not execute...
>
>
> > I am trying to get the Sample Barcode to run on my server, however the
> > following line does not execute:
> >
> >  echo "";
> >
> > To see if it is executing, I have an "Echo" statement in the script.
> >
> > The image.php file is in the same directory as the other script files.
> >  What am I missing here?
> >
> > Todd
> > --
> >
>
>
> --
> 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] This line does not execute...

2003-06-04 Thread Alex Ciurea
did u made copy&paste with your code?

yes? then why don't you try to use the path='image.php?blahblahmoreblah'


no? then please give us more details about the error you're getting...

good luck,
Alex


- Original Message -
From: "Todd Cary" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 03, 2003 6:03 PM
Subject: [PHP] This line does not execute...


> I am trying to get the Sample Barcode to run on my server, however the
> following line does not execute:
>
>  echo "";
>
> To see if it is executing, I have an "Echo" statement in the script.
>
> The image.php file is in the same directory as the other script files.
>  What am I missing here?
>
> Todd
> --
>


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



[PHP] PHP WEB module doesn't execute php console scripts?

2003-03-05 Thread Alex Ciurea
Hello,

I have a linux-debian machine. I've installed the php-module for the apache web 
server, and I've realized that my php scripts (launced from console) doesn't work.

What should I install in order to make working those php-scripts ?

I know that's a silly q, but this is the first time when I heard about php web module 
(can you imagine?) and I have no idea



Anyone coould help me ?

Thanks alot,
Alex




Re: [PHP] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea

Oh, I get it Jason,

it's okay the idea of mysqldump


Now i see it's more efficient mysqldump rather than my stupid thought.


10x alot,
Alexoiul


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 3:27 PM
Subject: Re: [PHP] Need some help in "exec"-attack


> On Monday 13 January 2003 21:13, Alex Ciurea wrote:
> > Hi,
> >
> > I think I've solved the problem
> >
> > group owner of the dest_dir must be apache !!!
>
> NB if mysql is running whilst you're copying the files then you could end
up
> with incorrect backups.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Q: How many marketing people does it take to change a lightbulb?
> A: I'll have to get back to you on that.
> */
>
>
> --
> 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] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea
:( Yes I've realised that.

It seemed to me that is more efficient to make a copy of that files, rather
than a mysqldump.

but Yes, in order to access files of the mysql directory, I have to give to
the webserver all the rights, solution that I don't aproove, for security
reasons.





- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 3:08 PM
Subject: Re: [PHP] Need some help in "exec"-attack


> On Monday 13 January 2003 19:53, Alex Ciurea wrote:
> > Hi all,
> >
> > this is my situation:
> > I want to execute some comands using 'shell_exec':
> >
> > $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
> > /usr/dest_dir;cd /usr/dest_dir;ls -la");
> > echo "$command";
> >
> > Actually, these commands:
> > 1)ls -la /usr/dest_dir
> > 2)cp -R /usr/source_dir/1.php /usr/dest_dir
> > 3)cd /usr/dest_dir
> > 4)ls -la
> >
> > This is what I get:
> >
> > total 8
> > drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> > drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> > total 8
> > drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> > drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> >
> > the first 3 lines, before the 'cp' command
> > the last 3 lines, after the 'cp' command.
> >
> > As you can see, no changes.
> >
> > I've looked in the logs of the apache webserver and i've found this
line:
> >
> > cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
> >
> > Note: source_dir and dest_dir are both owned by mysql
>
> Presumably you're trying to backup a mysql database. In a standard setup
the
> database files are only accessible to the 'mysql' user. Your webserver,
under
> normal circumstances, would not be able to access those files. Once you
get
> over this hurdle, the second problem is that your destination directory is
> not writeable by any user other than mysql.
>
> In short you're better off using mysqldump to backup your databases.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> "Consequences, Schmonsequences, as long as I'm rich."
> -- "Ali Baba Bunny" [1957, Chuck Jones]
> */
>
>
> --
> 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] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea
Hi,

I think I've solved the problem

group owner of the dest_dir must be apache !!! 



- Original Message - 
From: "Alex Ciurea" <[EMAIL PROTECTED]>
To: "php mailing" <[EMAIL PROTECTED]>
Sent: Monday, January 13, 2003 1:53 PM
Subject: [PHP] Need some help in "exec"-attack


> Hi all,
> 
> this is my situation:
> I want to execute some comands using 'shell_exec':
> 
> $command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
> /usr/dest_dir;cd /usr/dest_dir;ls -la");
> echo "$command";
> 
> Actually, these commands:
> 1)ls -la /usr/dest_dir
> 2)cp -R /usr/source_dir/1.php /usr/dest_dir
> 3)cd /usr/dest_dir
> 4)ls -la
> 
> This is what I get:
> 
> total 8
> drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> total 8
> drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
> drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
> 
> the first 3 lines, before the 'cp' command
> the last 3 lines, after the 'cp' command.
> 
> As you can see, no changes.
> 
> I've looked in the logs of the apache webserver and i've found this line:
> 
> cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
> 
> Note: source_dir and dest_dir are both owned by mysql
> 
> Another thing :
> 
> cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied
> 
> The path begin with a back tick . Is that normal?
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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] Need some help in "exec"-attack

2003-01-13 Thread Alex Ciurea
Hi all,

this is my situation:
I want to execute some comands using 'shell_exec':

$command=shell_exec("ls -la /usr/dest_dir;cp -R /usr/source_dir/1.php
/usr/dest_dir;cd /usr/dest_dir;ls -la");
echo "$command";

Actually, these commands:
1)ls -la /usr/dest_dir
2)cp -R /usr/source_dir/1.php /usr/dest_dir
3)cd /usr/dest_dir
4)ls -la

This is what I get:

total 8
drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..
total 8
drwxr-xr-x2 mysqlmysql4096 Jan 13 13:29 .
drwxr-xr-x   18 mysqlmysql4096 Jan 13 12:25 ..

the first 3 lines, before the 'cp' command
the last 3 lines, after the 'cp' command.

As you can see, no changes.

I've looked in the logs of the apache webserver and i've found this line:

cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied

Note: source_dir and dest_dir are both owned by mysql

Another thing :

cp: cannot create regular file `/usr/dest_dir/1.php': Permission denied

The path begin with a back tick . Is that normal?










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




[PHP] Can I Copy a directory using PHP?

2003-01-13 Thread Alex Ciurea
Hello,

I want to write a script that makes a backup of a database directory.

Actually, to copy all database files to another directory.
I've figured that I have to use the "copy" function of the PHP, but the
function doesn't works only with files?



Is it possible to copy the entire directory to another location, using PHP?
I presume that is more "resource-friendly" than to copy the directory
file-by-file.


Thanks and best regards,
Alexoiul


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




[PHP] easy spliting

2002-12-18 Thread Alex Ciurea
Hi,

I know it is easy but I can't figure how I should do

I want to split a string from position  1 to 9, from 10 to 36, from 37 to 54 and so 
on...

how can I do this?


is there a function who does this?


Regards,

Alx