[PHP] Re: fopen/fgets

2003-03-06 Thread Adrian Ciutureanu
you close the input file in while loop ( fclose($fp); ) Bryan Koschmann - Gkt [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Can someone give me a hand here? I am really lost as to what is going on. I have a file that looks like this user1,Store 1 - ABC street user2,Store 2 -

[PHP] crypt() MD5 problem on PHP 4.2.3

2003-02-24 Thread Adrian Ciutureanu
hi all, ?php echo 'pre' . 'CRYPT_STD_DES ' . CRYPT_STD_DES . \n . 'CRYPT_EXT_DES ' . CRYPT_EXT_DES . \n . 'CRYPT_MD5 ' . CRYPT_MD5 . \n . 'CRYPT_BLOWFISH ' . CRYPT_BLOWFISH . '/pre'; echo crypt('clear_pass', '$1$salt1234$'); ? // outputs CRYPT_STD_DES 1 CRYPT_EXT_DES 0

[PHP] Apache 2 and PHP

2002-08-21 Thread Adrian Ciutureanu
At http://www.php.net/ChangeLog-4.php#4.2.0 there is a note (Note: Apache2 support is EXPERIMENTAL.) Is this note still justified for PHP/4.2.2? Is it about security? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Apache 2

2002-08-20 Thread Adrian Ciutureanu
Hi, There is a note at http://www.php.net/ChangeLog-4.php for Version 4.2.0 (Note: Apache2 support is EXPERIMENTAL.) Is it still justified? adu -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Session problem

2002-05-24 Thread Adrian Ciutureanu
All you have to do is to call session_name(EmailSess); session_start(); in rest of pages. BTW: You don't really need to call session_name() Manisha [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am facing so many problems - first file lock and now for

[PHP] Re: validating user input

2002-04-24 Thread Adrian Ciutureanu
No validating user input is needed if you are using OCIBindByName. See also the Avertisment at www.php.net/OCIBindByName [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi the M.L. I have to validate forms user inputs before the construction of my query to my

[PHP] Re: From where was function called?

2002-04-23 Thread Adrian Ciutureanu
You can use the 'magic constants' __FILE__ and __LINE__ For example, if you have an editor that can replace the newline \n character, you can replace all \n with \nerror_log(__FILE__ . '[' . __LINE__ . ']'); Nico Van Der Dussen [EMAIL PROTECTED] wrote in message

[PHP] How to get allocated memory?

2002-04-22 Thread Adrian Ciutureanu
I get the PHP Fatal error: Allowed memory size of N bytes exhausted and I want to check free memory at some point in a script. How can I do that? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: deleting lines in a textfield

2002-04-22 Thread Adrian Ciutureanu
?php $file_name = 'test.txt'; $line_no_to_delete = 2; $f = fopen($file_name, 'rw+'); $s = explode(\n, fread($f, filesize($file_name))); unset($s[$line_no_to_delete - 1]); fseek($f, 0); fputs($f, implode(\n, $s)); fclose($f); ? Kris Vose [EMAIL PROTECTED] wrote in message [EMAIL

[PHP] Re: adding numbers to a file

2002-04-22 Thread Adrian Ciutureanu
?php $file_name = 'test.txt'; $new_value = rand(1000, 100); $f = fopen($file_name, 'rw+'); $s = explode(\n, fread($f, filesize($file_name))); $s[1] = substr($s[1], 0, 11) . $new_value; fseek($f, 0); fputs($f, implode(\n, $s)); fclose($f); ? Craig Westerman [EMAIL PROTECTED] wrote in message

[PHP] Re: [HELP] redirect browser pass variable !

2002-04-21 Thread Adrian Ciutureanu
{ header(Location: http://www.XXX.edu/index.php?variable=$variable;); exit;} Joe [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am using header function to redirect browser. { header(Location: http://www.XXX.edu/index.php;); exit;} Although it can

[PHP] Re: Comparrison

2002-03-27 Thread Adrian Ciutureanu
http://php.net/ereg Ron [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... How would I compare to variables where I would want one variable to equal only part or some of the other variable? Here is the code ? if ($HTTP_USER_AGENT !== %MSIE 5.5%) { print You

[PHP] Re: ImagePNG problem

2001-08-21 Thread Adrian Ciutureanu
you have GD 2.0.1 and PHP 4.0.6 or later for creating true-color PNGs, per the manual: http://php.net/manual/en/function.imagecreatetruecolor.php -Andy -Original Message- From: Adrian Ciutureanu [mailto:[EMAIL PROTECTED]] Is there any way to tell ImagePNG() to create PNG24

[PHP] ImagePNG problem

2001-08-20 Thread Adrian Ciutureanu
Is there any way to tell ImagePNG() to create PNG24 images instead of PNG8 images? Seems that ImageCreateFromPNG() can read PNG24, but ImagePNG() writes only PNG8. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

[PHP] Re: WSIWYG Editor using PHP?

2001-07-26 Thread Adrian Ciutureanu
All messages in this thread reffers to applications for edit PHP/HTML. The question was about a WSIWYG Editor for HTML files that runs in browser, not an application that you install and edit local files! Did anybody click on the link to EZEdit? Bob Clingan [EMAIL PROTECTED] wrote in message

[PHP] Re: WSIWYG Editor using PHP?

2001-07-25 Thread Adrian Ciutureanu
EZEdit editor works 99% on client (JavaScript) and it works only in a IE5+ browser. You'll need ColdFusion only for remote file acces (commands like insert picture). Bob Clingan [EMAIL PROTECTED] wrote Does anyone know of any WSIWYG editors that you can plug into a site using PHP. I recently

[PHP] Re: String Comparison

2001-07-25 Thread Adrian Ciutureanu
Note that using strings without quotes generates a warning that is not displayed in the default configuration of PHP. The message looks like Warning: Use of undefined constant anyString - assumed 'anyString' in test.php on line 3 (line 3: echo anyString;) If you want to see these warnings, set

[PHP] Re: Client Machine Name

2001-07-25 Thread Adrian Ciutureanu
http://php.net/manual/en/language.variables.predefined.php $REMOTE_HOST = gethostbyaddr($REMOTE_ADDR); Dominic [EMAIL PROTECTED] wrote It's there anyway to find out the client machine name by using php? Thanks! Dominic -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[PHP] Re: Example forms

2001-07-24 Thread Adrian Ciutureanu
--- example.php --- ?=$myText? form method=post action=./example.php input type=text name=myText value=?=$myText?br input type=submit /form Denis Croombs [EMAIL PROTECTED] wrote in message 004701c11426$b94b7f10$[EMAIL

RE: [PHP] removing lines from array

2001-07-23 Thread Adrian Ciutureanu
? $recordsarray = file (../auto/records); $remove = schopf.net ; while(list($i, $line) = each($recordsarray)) { if(ereg($remove, $line)) { unset($recordsarray[$i]); } } $newFileContent = implode('',

RE: [PHP] Check for exist function

2001-07-23 Thread Adrian Ciutureanu
http://php.net/require_once -Original Message- From: ROsen [mailto:[EMAIL PROTECTED]] Sent: 23 iulie 2001 14:17 To: [EMAIL PROTECTED] Subject: [PHP] Check for exist function Hi, How can I check, thath some function is declared and to do not declare it second time ( with

RE: [PHP] formating numbers to two decimal points - money - best ways

2001-07-18 Thread Adrian Ciutureanu
? $c = 12.3456; echo number_format($c, 2); ? http://php.net/number_format -Original Message- From: Tim Olsen [mailto:[EMAIL PROTECTED]] Sent: 18 iulie 2001 10:52 To: [EMAIL PROTECTED] Subject: [PHP] formating numbers to two decimal points - money - best ways

RE: [PHP] Output (Urgent!)

2001-07-17 Thread Adrian Ciutureanu
How do you know it worked? :) -Original Message- From: Morten Winkler Jørgensen [mailto:[EMAIL PROTECTED]] Sent: 17 iulie 2001 12:54 To: [EMAIL PROTECTED] Subject: Re: [PHP] Output (Urgent!) How you want to get a value from client side to php on the same page? Well.

RE: [PHP] Adding elements to an array

2001-07-17 Thread Adrian Ciutureanu
$MyArray['BUYVAL'] = 1.23; -Original Message- From: Sharat Hegde [mailto:[EMAIL PROTECTED]] Sent: 17 iulie 2001 13:11 To: [EMAIL PROTECTED] Subject: [PHP] Adding elements to an array Hello, I have a requirement to add elements to an associate array dynamically based on

RE: [PHP] regexp. king needed (is it possible ???)

2001-07-17 Thread Adrian Ciutureanu
? $s = 'somthing opentag1 .any content in between .. closetag1 somthing else'; $opentag = 'opentag1'; $closetag = 'closetag1'; $other_content = 'the other content'; $content = ereg_replace(.*$opentag, '', ereg_replace($closetag.*, '',

RE: [PHP] how to strip just the img tag from html file?

2001-07-16 Thread Adrian Ciutureanu
$printerFriendlyContent = eregi_replace('img[^]*', '', $htmlContent); You can also use $printerFriendlyContent = eregi_replace('src=[^]*', 'src=images/spacer.gif', $htmlContent); to preserve formatting (spacer.gif = 1x1 px transparent) -Original Message- From: [EMAIL PROTECTED]

RE: [PHP] Rename a File?

2001-07-12 Thread Adrian Ciutureanu
http://php.net/rename -Original Message- From: Randy Johnson [mailto:[EMAIL PROTECTED]] Sent: 13 iulie 2001 20:53 To: Randy Johnson; Chris Lambert - WhiteCrown Networks; [EMAIL PROTECTED] Subject: [PHP] Rename a File? How do I rename a file on Linux in PHP? Thanks Randy

RE: [PHP] charset

2001-07-12 Thread Adrian Ciutureanu
http://www.w3.org/TR/WD-html40-970708/charset.html -Original Message- From: Mark Lo [mailto:[EMAIL PROTECTED]] Sent: 12 iulie 2001 08:46 To: [EMAIL PROTECTED] Subject: [PHP] charset Hi, What will the problem if i don't specific what charset to use in the metal tag. And

RE: [PHP] associative arrays

2001-07-12 Thread Adrian Ciutureanu
$result = mysql_db_query(database,select item1, item2 from table); while ($row = mysql_fetch_array($result)) { $myArray[$row['item1']] = $row['item2']; } -Original Message- From: Martin Lucas [mailto:[EMAIL PROTECTED]] Sent: 12 iulie 2001 16:25 To: '[EMAIL PROTECTED]'

RE: [PHP] Array problem in PHP. Please help.

2001-07-12 Thread Adrian Ciutureanu
foreach($oldArray as $a)) { list($key, $value) = each($a); $newArray[$key] = $value; } -Original Message- From: Michael Champagne [mailto:[EMAIL PROTECTED]] Sent: 12 iulie 2001 17:37 To: PHP General Mailing List Subject: [PHP] Array problem in PHP. Please help.

RE: [PHP] Variables

2001-07-11 Thread Adrian Ciutureanu
That's IMPOSIBLE! -Original Message- From: James Bartlett [mailto:[EMAIL PROTECTED]] Sent: 11 iulie 2001 05:27 To: [EMAIL PROTECTED] Subject: Re: [PHP] Variables I have tried that also...it still does not want to work... - Original Message - From: Dallas K.

RE: [PHP] Getting the title of a web page

2001-07-11 Thread Adrian Ciutureanu
? $f = fopen($fileName, 'r'); $s = fread($f, 1024); fclose($f); $pageTitle = eregi_replace('.*title', '', eregi_replace('/title.*', '', $s)); ? -Original Message- From: Heiko Wilms [mailto:[EMAIL PROTECTED]] Sent: 11 iulie 2001 13:32 To: [EMAIL

RE: [PHP] Cookie Expiry Dates?

2001-07-11 Thread Adrian Ciutureanu
int setcookie (string name [, string value [, int expire [, string path [, string domain [, int secure]) expire = time() + 3600*24*30; Note that 'expire' is the client relative to GMT time. So, if the client has the local time set to 01/01/1985, your cookie will be born dead ;)

RE: [PHP] Re: Cookie Expiry Dates?

2001-07-11 Thread Adrian Ciutureanu
you probably mean $cookie_expire = time() + 86400 * 365; -Original Message- From: James Holloway [mailto:[EMAIL PROTECTED]] Sent: 11 iulie 2001 16:02 To: [EMAIL PROTECTED] Subject: [PHP] Re: Cookie Expiry Dates? Hi Jeff, Yes, use time() Example 86400 seconds in a

RE: [PHP] http header

2001-07-10 Thread Adrian Ciutureanu
Use $HTTP_REFERER http://php.net/manual/en/language.variables.predefined.php -Original Message- From: Jack [mailto:[EMAIL PROTECTED]] Sent: 11 iulie 2001 01:23 To: [EMAIL PROTECTED] Subject: [PHP] http header Dear all folks, I want to get the url of the previous page that my

RE: [PHP] Getting any possible value inside an array

2001-07-09 Thread Adrian Ciutureanu
http://php.net/array_unique -Original Message- From: Aaron Bennett [mailto:[EMAIL PROTECTED]] Sent: 8 iulie 2001 08:52 To: [EMAIL PROTECTED] Subject: [PHP] Getting any possible value inside an array Hi everyone... Does someone have a quick and dirty way of returning _any_

RE: [PHP] Help with a variable

2001-07-09 Thread Adrian Ciutureanu
http://php.net/isset -Original Message- From: James Bartlett [mailto:[EMAIL PROTECTED]] Sent: 9 iulie 2001 14:44 To: [EMAIL PROTECTED] Subject: [PHP] Help with a variable Hi, Is there some way that I can check to see if a variable is present? e.g. if (variable is not

RE: [PHP] mysql, interbase, etc

2001-07-09 Thread Adrian Ciutureanu
http://www.PostgreSQL.org -Original Message- From: kachaloo [mailto:[EMAIL PROTECTED]] Sent: 9 iulie 2001 16:58 To: [EMAIL PROTECTED] Subject: [PHP] mysql, interbase, etc Hi, Which db supports trigers and stored procedures and is also free ? I thought mysql supports

RE: [PHP] $phpvar = javascriptvar???

2001-07-06 Thread Adrian Ciutureanu
You probably want to make statistics for web pages. The most common way to do that is to use a PHP script that outputs an image and writes to a database some data. The code may look like this: /** stat.php / ? $query = INSERT INTO stats (id,

RE: [PHP] Security of PHP code

2001-07-05 Thread Adrian Ciutureanu
$allowed_path = '/www/sites/mysite/teaching'; $file = realpath($file); if(ereg(^$allowed_path, $file)) { // it's OK } else { // possible attack! } -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 4 iulie 2001 15:29 To: [EMAIL PROTECTED]

RE: [PHP] Parse URL parameters

2001-07-05 Thread Adrian Ciutureanu
?=a1 = '$a1'bra2 = '$a2'? :) -Original Message- From: Andy [mailto:[EMAIL PROTECTED]] Sent: 5 iulie 2001 10:20 To: [EMAIL PROTECTED] Subject: [PHP] Parse URL parameters How can I parse parameters sent with the URL of an pgp site? Example: I call the site with

RE: [PHP] Security of PHP code

2001-07-05 Thread Adrian Ciutureanu
http://php.net/realpath $allowed_path = '/www/sites/mysite/teaching'; $file = realpath($file); if(ereg(^$allowed_path, $file)) { // it's OK } else { // possible attack! } -Original Message- From: Steve Werby [mailto:[EMAIL PROTECTED]] Sent: 5 iulie 2001 02:22 To:

RE: [PHP] verifying that a dropdown was selected

2001-07-05 Thread Adrian Ciutureanu
select size=1 name=month option value=0 selectedSelect month option value=1January . . . /select . . . if(!$month) { // please select month } else { // month selected } -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED]] Sent: 5

[PHP] optimal code

2001-07-05 Thread Adrian Ciutureanu
Is any of the versions below more effective? /** Version 1 **/ ? if($condition) { // some big code } else { // other big code } ? /** Version 2 **/ ? if($condition) { include 'file_with_some _big_code.php'; } else { include

RE: [PHP] Security of PHP code

2001-07-05 Thread Adrian Ciutureanu
This is a good code. Read http://php.net/realpath -Original Message- From: Christopher Ostmo [mailto:[EMAIL PROTECTED]] Sent: 5 iulie 2001 19:57 To: Adrian Ciutureanu Cc: [EMAIL PROTECTED] Subject: RE: [PHP] Security of PHP code Adrian Ciutureanu pressed the little lettered

RE: [PHP] Security of PHP code

2001-07-05 Thread Adrian Ciutureanu
An observation: I presume (in my code) that $allowed_path is a root of an allowed path. So, files in subfolders of allowed_path are also allowed. -Original Message- From: Christopher Ostmo [mailto:[EMAIL PROTECTED]] Sent: 5 iulie 2001 19:57 To: Adrian Ciutureanu Cc: [EMAIL PROTECTED

[PHP] RE: Deleting a string from a text file

2001-07-04 Thread Adrian Ciutureanu
? $textFileName = 'filename.txt'; $strToDel = the_string; $s = implode('', file($textFileName)); $p = strpos($s, $strToDel); $len = strlen($strToDel); if($p) { $s = substr($s, 0, $p) . substr($s, $p+$len);

[PHP] RE: Processing checkboxes in Dynamic tables

2001-07-04 Thread Adrian Ciutureanu
Variables that are not checked are not send by default. Try the code below and see what variables are posted. form method=get action=chkbox.html ?for($i = 0; $i 10; $i++):? input type=checkbox name=p?=$i? value=1p?=$i?br ?endfor? input type=submit /form To process variables you may use

[PHP] php-general subscription test

2001-07-04 Thread Adrian Ciutureanu
Hi all, This is only a test. Sorry for any inconvenience. adu -- 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]

RE: [PHP] capatalising letters

2001-07-04 Thread Adrian Ciutureanu
http://php.net/manual/en/function.ucwords.php -Original Message- From: Jamie Saunders [mailto:[EMAIL PROTECTED]] Sent: 4 iulie 2001 14:57 To: [EMAIL PROTECTED] Subject: [PHP] capatalising letters Hi, I've got a list of strings in the following format: item one item two

RE: [PHP] preg_match

2001-07-04 Thread Adrian Ciutureanu
try ereg('^([a-z,A-Z,0-9]|_|-|\.)+@([a-z,A-Z,0-9]|_|-|\.)+\.([a-z,A-Z,0-9]|_ |-|\.){2,3}$', $email) -Original Message- From: Daniel Reichenbach [mailto:[EMAIL PROTECTED]] Sent: 4 iulie 2001 15:05 To: Php-General Subject: [PHP] preg_match Hy, i've got a string which looks

RE: [PHP] Security of PHP code

2001-07-04 Thread Adrian Ciutureanu
Here is something that happend to me: I forgot to tell Apache that .inc files must be parsed by PHP. All works fine if you include a .inc file, but if somebody guess .inc file name, he can see the content of that file! -Original Message- From: David A Dickson [mailto:[EMAIL PROTECTED]]

RE: [PHP] javascript var on a php var...

2001-07-04 Thread Adrian Ciutureanu
window.location = 'http://url?yourVar=' + yourVar; -Original Message- From: Romeo Manzur [mailto:[EMAIL PROTECTED]] Sent: 5 iulie 2001 07:56 To: [EMAIL PROTECTED] Subject: [PHP] javascript var on a php var... hi, I want to know how could I save a javascript variable on a php

[PHP] sessions and cache

2001-07-02 Thread Adrian Ciutureanu
Hi, I have a problem: if I use session_start(), the page will not cache. Is that normal? Adrian CIUTUREANU Software Developer -- 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

RE: [PHP] sessions and cache

2001-07-02 Thread Adrian Ciutureanu
Thanks a lot! It works. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: 2 iulie 2001 16:43 To: [EMAIL PROTECTED] Subject: Re: [PHP] sessions and cache Hi Adrian! On Mon, 02 Jul 2001, Adrian Ciutureanu wrote: Hi, I have a problem: if I use

RE: [PHP] file upload

2001-07-02 Thread Adrian Ciutureanu
Try this: --upload.php-- ?php if (is_uploaded_file($userfile)) { move_uploaded_file($userfile, $new_location/$userfile_name); } else { echo Possible file upload attack: filename '$userfile'.; } ? -Original Message- From: Wilbert Enserink [mailto:[EMAIL