[PHP] null as function argumnent?

2004-12-08 Thread Bas Jobsen
Hi, I want to use a ?: statement. If not true de default function argument have to be used. How to do this ? function test($test='default') { echo $test; } test(($value==1)?'no default':null); ? What do i have to pass instead of null to get default print? Tnx, Bas -- PHP General Mailing

[PHP] error reporting linenumber and filename

2003-06-16 Thread Bas Jobsen
Hi, Running the code below, shows an errror in line 2 as expected. How do i get the linenumber of the function call? 3 here. ? function test($x){if($x!='a')trigger_error('error: call test with argument 1 equals a',E_USER_ERROR);} test('b'); ? Best regards, Bas -- PHP General Mailing List

Re: [PHP] error reporting linenumber and filename[Scanned]

2003-06-16 Thread Bas Jobsen
name ( __FILE__ ) and the line number which produced the error. I'm not sure that there is a way beyond this to show the line within the function but I don't see that this would be necessary - at least not for resolving errors. HTH, Michael Egan -Original Message- From: Bas Jobsen

Re: [PHP] Help inserting compressed data into a mysql database

2003-06-16 Thread Bas Jobsen
extract from database $data = @gzinflate(stripslahes($data)); Op maandag 16 juni 2003 18:03, schreef u: Hi, I am trying to insert compressed data into a database. Inserting it in seems to work file: $data = addslashes(gzdeflate($data, 9)); insert into database For the most part it works

Re: [PHP] categorise list

2003-06-09 Thread Bas Jobsen
$letter=''; $while($row=mysql_fetch_array($result)) { if($letter!=$row[name][0]) { echo $row[name][0].'br'; $letter=$row[name][0]; } echo $row[name].'br'; } Op maandag 09 juni 2003 12:41, schreef u: I am dispalying data from mysql database using the codes below:

Re: [PHP] convert seconds to hours, minutes, seconds

2003-06-04 Thread Bas Jobsen
function secondstohours($seconds) { /* [EMAIL PROTECTED] */ $sec=$seconds%3600; return (($seconds-$sec)/3600).':'.($sec/60).':'.($sec%60); } echo secondstohours(7500); Op dinsdag 03 juni 2003 14:38, schreef u: Hello everybody, I have a value 178607, which is stored as

Re: [PHP] Correct number format (curency)

2003-02-20 Thread Bas Jobsen
Example 1.000,00 1000.00 1,000.00 I would like to convert those to a single format 1000.00 ? function money($money) { /* written by [EMAIL PROTECTED] */ $money=str_replace(array(',','.'),'',$money); $money=substr($money,0,strlen($money)-2).'.'.substr($money,-2); } $money='1.000,00';

Re: [PHP] recursion?????

2003-02-14 Thread Bas Jobsen
not tested Basically, have the form action call itself hince the recursion. Any suggestion/examples? ? $field1=false; if(isset($_POST['submit'])) { /*check*/ if(isset($_POST['field1']) $_POST['field1']=='okay')header('Location: registration.php'); else $field1=true; } ? form

Re: [PHP] array_search() problem

2002-09-12 Thread Bas Jobsen
Hi I'm runing a PHP Version 4.0.4pl1 on Solaris 8 X86 on apache, and I'm trying to search an array From the manual: array_search (PHP 4 = 4.0.5) send earlier to this list: Re: [PHP] Array - Match From: Bas Jobsen [EMAIL PROTECTED] To: N. Pari Purna Chand [EMAIL PROTECTED], [EMAIL PROTECTED

Re: [PHP] array_search() problem

2002-09-12 Thread Bas Jobsen
What I was looking for was finding out what was the index of thet value, lets say I have a array with some values like (23, 56, 45, 47) and i don't know where the walue I'm looking for is indexed in the array and I want to find out what the indexnumber is, how would that be possable ?

Re: [PHP] split() - not working in this case

2002-09-08 Thread Bas Jobsen
? function split_addresses($addr) { $ad = array(); $ad = split(,,$addr); return $ad; } $tos=array(); $to = abcd [EMAIL PROTECTED], efgh [EMAIL PROTECTED]; $tos=split_addresses($to); echo $tos[1]; ? echos efgh [EMAIL PROTECTED] ?? Whats the problem? Maybe you output to a browser and don't

Re: [PHP] Array - Match

2002-09-07 Thread Bas Jobsen
? $sub = abcd; $subs[] = cde; $subs[] = iyu; $subs[] = abc; $subs[] = xyx; $match=false; foreach($subs as $value) { if($sub==$value){$match=true; break;} } if($match) echo 'found!'; else echo 'not found!'; //or better use //for PHP 4 if(in_array($sub,$subs))echo 'found!'; else echo 'not

Re: [PHP] String operation

2002-09-04 Thread Bas Jobsen
$string3 = str_replace($string1,'',$string2); ??? Op woensdag 04 september 2002 17:04, schreef Richard Fox: Hi Given string1 = /home/web/ string2 = /home/web/www/index.php How can I elegantly do an exclusive or of string1 with string2, that is, I want to end up with string3 =

Re: [PHP] limit in a loop function to prevent server load

2002-09-03 Thread Bas Jobsen
Op dinsdag 03 september 2002 10:46, schreef u: hi there i was wondering if there was a way to limit the ammount of items in a loop to execute sleep then execute the rest of the items to prevent server load ? for($i=0;...) { if($i0$i%100==0)sleep(10); } -- PHP General Mailing List

Re: [PHP] wordwrap function (that skips html tags)

2002-09-03 Thread Bas Jobsen
Hello, What's your php version? Take at look at: http://www.php.net/manual/en/function.wordwrap.php and http://www.php.net/manual/en/function.strip-tags.php b.e. $str='http://www2.snm-hgkz.ch/~rieger/notepool/addnote.php'; echo wordwrap(strip_tags($str),8,'br',1); i you can't use wordwrap(),

Re: [PHP] greeting based on time

2002-09-03 Thread Bas Jobsen
? $hour=date('H'); switch(true) { case ($hour 12): echo 'Good Morning';break; case ($hour 18): echo 'Good Afternoon'; break; default:echo 'Good Night'; break; } ? Op dinsdag 03 september 2002 13:01, schreef Javier Montserat: really

Re: [PHP] Refering to an object from within an array variable in another class

2002-09-03 Thread Bas Jobsen
Any insight appreciated. In a best case if someone can add in the required ''s to the following code that would be great. ?php echo 'pre' ; error_reporting ( E_ALL ) ; class Foo { var $bars = array() ; function

Re: [PHP] How do I call a CGI script from PHP?

2002-08-26 Thread Bas Jobsen
PHP page, nothing fancy. .In SSI, I just use the #exec cgi= line--is $test = `path_to_your_cgi 21`; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] problem with using link variables

2002-08-25 Thread Bas Jobsen
If the variable provnum contains text such as: hello there urlencode($provnum); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Count number of rows in table.

2002-08-25 Thread Bas Jobsen
$sql = select count(*) from table_name WHERE .; $result = mysql_query($sql) or die(mysql_error); $row = mysql_fetch_row($result); $rowCount=$row[0]; or $sql = select count(*) from table_name WHERE .; $result = mysql_query($sql) or die(mysql_error); $rowCount=mysql_result($result);

Re: [PHP] Help with matchng strings

2002-08-25 Thread Bas Jobsen
$lista=array(1,2,3,4,5,6,7,8,9); $listb=array(4,6,8); $listc=array_intersect($lista,$listb); $listd=array_diff($lista,$listb); Op maandag 26 augustus 2002 01:48, schreef Rasmus Lerdorf: array_intersect() will give you listC directly. Just feed it list A and B. Then you can take a copy of

Re: [PHP] Eregi_replace

2002-08-22 Thread Bas Jobsen
eregi_replace('a href[^]+','',$string); Op donderdag 22 augustus 2002 14:42, schreef Roman Duriancik: How to create pattern for function eregi_replace to replace in html document every html tag a href= for empty string. Thanks roman -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] array_splice()

2002-08-21 Thread Bas Jobsen
$test=array('a'=1,'b'=2,'c'=3); foreach ($test as $key=$value) { if ($value==2) unset($test[$key]); } or $test=array('a'=1,'b'=2,'c'=3); $i=0; foreach ($test as $key=$value) { if ($value==2) array_splice($test,$i,1); $i++; } Op woensdag 21 augustus 2002 12:17, schreef u:

Re: [PHP] Exiting from an include or required file

2002-08-21 Thread Bas Jobsen
Do: FILE A: ?php if (empty($_POST['search_criteria')) { echo You must provide search criteria; // exit the include file here But how? } else { echo You have provided serach criteria; } ? Op woensdag 21 augustus 2002 16:39, schreef Henry: Hi All, I would like to exit from

Re: [PHP] !--#exec cgi= equivalent in PHP

2002-08-20 Thread Bas Jobsen
echo `PATH_TO_PERLSCRIPT.CGI 21`; Op dinsdag 20 augustus 2002 09:47, schreef Peter Janett: I'm converting over some .shtml files that call an external Perl script with the following format: !--#exec cgi= PATH_TO_PERLSCRIPT.CGI -- I'm not sure what php function to use, as I'm returning the

Re: [PHP] quick ereg() question

2002-08-17 Thread Bas Jobsen
if (ereg(((\.)(php|inc))$,$o0o) !ereg(\/\.\., $o0o)){ Op zaterdag 17 augustus 2002 23:53, schreef eriol: I checked the manual and it's comments as well as google, but didn't find the simple answer i'm wanting.. I have the following line in a show php source code page: if

Re: [PHP] preg_match help?

2002-08-17 Thread Bas Jobsen
preg_match(/.*b[^]+(.*)font face=\Verdana\ size=\3\.*/, $contents,$story); echo $story[1]; preg_match always return a array. The first element ($array[0])contains your complete regexp. The next ($array[1])one the first match between () etc. Don't use ! but / Op zondag 18 augustus 2002

Re: [PHP] fopen and sort by date modified

2002-08-14 Thread Bas Jobsen
Op woensdag 14 augustus 2002 13:04, schreef electroteque: hi there i was wondering how i could fopen a directory and then sort the files by date modified is there a way ? ?php // Note that !== did not exist until 4.0.0-RC2 $dir='/home'; if ($handle = opendir($dir)) { echo Directory

Re: [PHP] [Class] Behaviour global variables

2002-08-14 Thread Bas Jobsen
$TEST= new TEST; $a=3; $b=4; $TEST-Show(); works, fine better to use $GLOBALS['a'] instead of global $a Op woensdag 14 augustus 2002 15:27, schreef Tim Stoop: Hi there, I'm forgetting something, but I can't seem to get to it... Consider the following Class. class Test { var $a;

Re: [PHP] how many files are in a directory

2002-08-14 Thread Bas Jobsen
Op woensdag 14 augustus 2002 20:00, schreef Harry.de: does anybody now a way in php to read out, how many files are in a directory ?php // Note that !== did not exist until 4.0.0-RC2 clearstatcache(); $dir='/home/'; if ($handle = opendir($dir)) { echo Directory handle: $handle\n;

Re: [PHP] error reporting

2002-08-14 Thread Bas Jobsen
start your file with : error_reporting(E_ALL); Op woensdag 14 augustus 2002 20:09, schreef Georgie Casey: rite, without access to the php.ini file, how can i get php to print all errors on my web server. it runs linux -- Regards, Georgie Casey [EMAIL PROTECTED]

Re: [PHP] regex match problem

2002-08-14 Thread Bas Jobsen
To Match: Tue, Jul 29, 2003 $pregmatchstring=/([\s])*(Renewal\DDate|Registered\sthrough|Expires|Record \sExp ires|Domain\sExpires|Expiry\sDate)([\D\s]*)(.*)/i; You can change the last part of $pregmatchstring in: Expiry\sDate)([\D\s]*|\w{3},\s\w{3}\s\d{2},\s\d{4})(.*)/i; You can feed

Re: [PHP] Array question

2002-08-14 Thread Bas Jobsen
How can I echo the name of the of the second array (subArray)? The name for value ?php $test=array ( 'a'=array('1','2'.'3'), 'c'=array('6','5'.'4'), 'd'=array('8','9'.'10'),

Re: [PHP] problem with $_POST

2002-08-14 Thread Bas Jobsen
Op woensdag 14 augustus 2002 20:57, schreef Adam Williams: Does anyone know why it is not working with $_POST but works fine with $_GET? I don't know, but maybe you has to put around POST, method=POST. It works then with GET, cause that's default. Maybe something else is wrong, so method

Re: [PHP] [Class] global again, not working?

2002-08-14 Thread Bas Jobsen
Hi, do -- echo $data[0]*$data[1]); return ($data[0]*$data[1]); -- i think its empty. In the first place, i thought it was maybe impossible to call a class-functions in your constructor. (Cause the class function don't exists at the moment you call your constructor). But the code below showed

Re: [PHP] file_get_contents ( string filename [, int use_include_path])

2002-08-14 Thread Bas Jobsen
string filename The name of the file. b.e test.html or $_SERVER['DOCUMENT_ROOT'].'test.html' int use_include_path Optional 1 true or 0 (or nothing) false the file above is in my default include path. Manual: you can use the optional second parameter and set it to 1, if you want to search for

Re: [PHP] SESSION Security

2002-08-14 Thread Bas Jobsen
Op donderdag 15 augustus 2002 01:03, schreef u: So, if somebody gets an ftp account somehow, he will be able to get session vars via a system() command? You holds him in its own dir by the chroot setting of you ftpserver. via a system(); you mean if they upload a php file? prevent that with

Re: [PHP] mysql_num_rows($Result)

2002-08-14 Thread Bas Jobsen
In your database design you need the following every username/pass comb is unique. so a query like ... WHERE username='$testvalue' AND password='$testvalue2' Have to give you one row for a good user/passcombination ALWAYS. And 0 rows for a wrong combination. If NOT your design doesn;t fit

Re: [PHP] Include/require and the HTML Code

2002-08-14 Thread Bas Jobsen
Can anybody tell me why I get a Parse error: parse error, unexpected '}' in /usr/local/apache/htdocs/logbook/Functions.inc on line begin and end your include files with ? and ? ? function HtmlHeader() { ? bllaalla ? return; } ? -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Template and Replacement

2002-08-13 Thread Bas Jobsen
http://www.php.net/manual/en/function.str-replace.php In PHP 4.0.5 and later, every parameter to str_replace() can be an array. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] newbie array question

2002-08-13 Thread Bas Jobsen
Op dinsdag 13 augustus 2002 20:50, schreef Alexander Ross: If I have a string variable that is already of the form ('item','item2','item3') [including the parens and quotes in the string], is there an easy way to change that variable into an array?? Array($var) doesn't work. Thanks ?

Re: [PHP] Read file dates for most recent

2002-08-13 Thread Bas Jobsen
Op dinsdag 13 augustus 2002 23:25, schreef Mike Davis: I need to read a directory full of PDF files, and get the file date of the most recent. Can someone get me started? ?php // Note that !== did not exist until 4.0.0-RC2 $dir='/home/allop/'; if ($handle = opendir($dir)) { echo Directory

Re: [PHP] no HTML in a form textarea field

2002-08-13 Thread Bas Jobsen
http://www.php.net/manual/en/function.strip-tags.php Op woensdag 14 augustus 2002 02:24, schreef Roger Thomas: i presented my visitor to fill up some description about themselves via HTML's textarea FORM element. how do i block them from entering unwanted HTML tags into the textarea field?

Re: [PHP] passing an array in a link

2002-08-11 Thread Bas Jobsen
print a href=\/myscript.php?keylist=.str_replace( ,+,implode(+,$keylist)).\link/a ; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Good Damn

2002-08-11 Thread Bas Jobsen
if ($Result) { if(mysql_num_rows($Result)0) Op zondag 11 augustus 2002 16:32, schreef Sascha Braun: $Query = SELECT * FROM basket_db WHERE session_id = '$PHPSESSID'; $Result = mysql_query($Query, $connect); if ($Result) { while ($arrResult = mysql_fetch_array($Result, MYSQL_ASSOC)) {

Re: [PHP] Problem with $PHP_SELF on PWS

2002-08-11 Thread Bas Jobsen
form action=?php $PHP_SELF; ? form action=?=$PHP_SELF? or form action=?php echo $PHP_SELF; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem with echo

2002-08-11 Thread Bas Jobsen
Op zondag 11 augustus 2002 16:42, schreef Kristoffer Strom: Got a problem when echo:ing a variable containing alot of text. When echoing it backslashes (\) every apostrophe (') and quote (). This I don't like. And I can't use HTMLSPECIALCHARS or HTMLENTITIES since the text has alot of html

[PHP] why true?

2002-08-11 Thread Bas Jobsen
echo ('test'==0); gives 1 why? Thanks, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] mkdate error?

2002-08-11 Thread Bas Jobsen
YOU use $parsed_date[2] in stead of $parsed_end_date[2] Op maandag 12 augustus 2002 00:01, schreef jc: The following bit of code completely baffles me as to why it doesn't work. I am doing a very simple validation where I check to see if the end date field of an inputted record is an older

Re: [PHP] Asking for help...

2002-08-08 Thread Bas Jobsen
Op donderdag 08 augustus 2002 23:22, schreef Ashley M. Kirchner: DELETES another field and resubmits. At this point, that variable was already registered, and deleting the value from the form has no effect. The old value is still there and gets submitted. I need to check

Re: [PHP] Creating variables...

2002-08-02 Thread Bas Jobsen
That same script also gets a value ($step) from another one. Now I need to figure out which $var_list# to use based on this $step value. Any suggestion on how to do this? ${'var_list'.$step} -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] shorter way to write include function?

2002-07-31 Thread Bas Jobsen
Hello, i have /include/dotest.php: ? function dotest() {echo 'test';} ? and test.php: ? include('/include/dotest.php'); dotest(); ? Us there a shorter way to write out that. I mean something like include::dotest; Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Speed issues.

2002-07-28 Thread Bas Jobsen
?: hallo ?=$string?, dit is hetbr?=\n?? $k=1; $string='test'; I found: The fastest way to print was 3) Second came 1) (no much difference) and the slowest way 2) (about 2 times slower). I haven't tested printf(trtd Best regards, Bas Jobsen Op zondag 28 juli 2002 09:56, schreef Yves Vrancken

[PHP] string comparison

2002-07-27 Thread Bas Jobsen
Hello, When should i prefer strcmp() above == or !=? I have test it out (see code below). But a == comparison seems to be faster always. First i thought is was cause, if(strcmp($1,$2)!=0), needs two comparisons (strcmp and !=). But even if($1!=$2) is faster then if(strcmp($1,$2)). Thanks, Bas

Re: [PHP] String Manipulation

2002-07-25 Thread Bas Jobsen
Maybe something like: eregi('([a-z]*)( *)(\(*)([a-z]+)( *)(\)*)([a-z]*)',$string,$matches); echo $matches[4]; Op donderdag 25 juli 2002 17:13, schreef Mike: Hello all, I know that this has probably been discussed before and that you will tell me to go through all the back messages on the list

Re: [PHP] an array_key_exists() substitute for php 4.0 4.1 ?

2002-07-25 Thread Bas Jobsen
http://www.php.net/manual/en/function.array-key-exists.php: Note: The name of this function is key_exists() in PHP version 4.0.6. Op donderdag 25 juli 2002 18:53, schreef David D: hello all, I download a gni script path2vars that manipulate query_string for web crawlers. But I have php

[PHP] unset array here?

2002-07-25 Thread Bas Jobsen
Hello, I have this example code: function doprint($a){foreach($a as $value)echo $value;} doprint(array('1','test','hello','and')); Question, is the array in memory after the function call? So, should it be better to use this: function doprint($a){foreach($a as $value)echo $value;}

Re: [PHP] redirecting after login

2002-07-23 Thread Bas Jobsen
Umm...I hope register_globals is off... And if not. form action=http://www.yourdomain.com/yourpage.php; method=post input type=text name=username input type=submit /form Can be used from every server to login. Op dinsdag 23 juli 2002 12:42, schreef John Holmes: why don't u do something

Re: [PHP] Can a form submit to two PHP form processers in succession?

2002-07-22 Thread Bas Jobsen
//post to this script if($value_found_in_database) include('error_document.php'); else include('handling_script.php'); Op maandag 22 juli 2002 16:59, schreef DonPro: Hi, I'm not sure how to do this but I have a form which I wish to do the following. When the uses clicks the submit button,

[PHP] no-cache konqueror/opera

2002-07-16 Thread Bas Jobsen
Hello, How do i make a page which isn't cached for konqueror/opera browers? Now i have: $now = gmdate('D, d M Y H:i:s') . ' GMT'; header('Expires: ' . $now); header('Last-Modified: ' . $now); header('Cache-Control: no-store, no-cache, must-revalidate,pre-check=0, post-check=0, max-age=0');

Re: [PHP] activating php scripts via cron

2002-07-16 Thread Bas Jobsen
Instead of a second version, you can call your script via lynx: TERM=vt100 0 * * * * lynx -dump http://www.domeinnaam.nl/yourscript.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] substr_count() and regex

2002-03-17 Thread Bas Jobsen
? function count_hebrew($string) { $i=0; while(preg_match(/[à-ú]/,$string)) { $string=preg_replace(/[à-ú]/,,$string,1); $i++; } return $i; } $hebrew_characters=??? àhhjúkkk; $number_of_hebrew_characters=count_hebrew($hebrew_characters); echo $number_of_hebrew_characters; ? Op zondag 17

[PHP] where is http_cookie ?

2002-03-16 Thread Bas Jobsen
Hello, I have installed php 4.1.2. as a cgi module. But http_cookie isn't set. I don' know whats wrong. You can find the output of phpinfo() at http://www.tgp2stats.com/test.php Tnx, Bas Jobsen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net

Re: [PHP] where is http_cookie ?

2002-03-16 Thread Bas Jobsen
://www.tgp2stats.com/test. php Tnx, Bas Jobsen -- 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] write to specific place in file

2002-03-15 Thread Bas Jobsen
First read it, then split and then write it. $fp=fopen($file,r); $content=fread($fp,filesize($file)); fclose($file); $parts=explode($splitsign,$content); $fp=fopen($file,w); fwrite($fp,$parts[0].$insert.$splitsign.$parts[1]); fclose($file); Op vrijdag 15 maart 2002 19:09, schreef John P.

Re: [PHP] Real world regex

2002-03-04 Thread Bas Jobsen
For another I need to get the 3rd opening table row tr tag after the 7th opening table tag. not tested: (table[^]+.*){6}(table[^]+)([ ]*)(tr[^]*)(.*){2}(tr[^]*)(.*) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Probably basic but seems advanced to me, PHP/SQL generation.

2002-02-28 Thread Bas Jobsen
while ($row=mysql_fetch_row($result)) { echo 1 $row[0] for($x=1; $xcount($row); $x++) if(!empty($row[$x])) { echo $x+1; echo .$row[$x]; } } Op donderdag 28 februari 2002 14:40, schreef DARCY,MATTHEW (Non-HP-UnitedKingdom,ex2): Hello PHP'ers. First of all - scince joining this list I have

Re: [PHP] excluding files

2002-02-28 Thread Bas Jobsen
if (($file_name != .) ($file_name != ..) !eregi([a-z0-9]+pv\.html,$file)) Op donderdag 28 februari 2002 16:32, schreef Craig Westerman: while ($file_name = readdir($dir)) if (($file_name != .) ($file_name != ..)) $file_list .= $file_name; } This excludes . and .. files. How

Re: [PHP] Probably basic but seems advanced to me, PHP/SQL genera tion.

2002-02-28 Thread Bas Jobsen
the || $i==0 where are the column title being displayed for each row ?? as I see it there should be a seperate table per record. Each table containing the field name on the left and then the data on the right. Is that clear to you ? Matt. -Original Message- From: Bas Jobsen

[PHP] fsockopen and HTTP Authorization

2002-02-27 Thread Bas Jobsen
Hello, I try to do a HTTP Authorization with a fsockopen, but it doesn't seem to work. Who can help? $user and $passwd are set well, my code: -- $auth=base64_encode($user.:.$passwd); $header=GET /pa2/ HTTP/1.0\r\n\r\n; $header.=Accept: text/html\r\n; $header.=Authorization: Basic $auth\r\n\r\n;

Re: [PHP] CGI

2002-02-26 Thread Bas Jobsen
in index.php, you can do: ? if (action==cgi) header(Location: cgi-bin/cgiscripts/.$scripts); ? or ? if (action==cgi) echo `./cgi-bin/cgiscripts/${scripts} 21`; ? Op dinsdag 26 februari 2002 15:30, schreef u: Hey I have some cgi files who are in the /usr/lib/xxx/cgi-bin/ directory How can i

Re: [PHP] CGI

2002-02-26 Thread Bas Jobsen
Well, okay. It was an example. Then do: if (action==cgi file_exists($script)) Op dinsdag 26 februari 2002 16:00, schreef bvr: Please note that plain this: or ? if (action==cgi) echo `./cgi-bin/cgiscripts/${scripts} 21`; ? is not a good idea, because it allows a visitor to run arbitrary

Re: [PHP] INT function?

2002-02-20 Thread Bas Jobsen
$z = intval($x / $y); Op donderdag 21 februari 2002 02:06, schreef James Taylor: Just curious what the function is to convert x into an integer if it's a float Say for example I have something like this $x = 7; $y = 3; $z = $x / $y; I want $z to equal 2. In perl it would be $z =

[PHP] test for cookies, without reloading

2002-02-17 Thread Bas Jobsen
Hello, Is there a way to test for cookies enabled/disabled, without reload the page and test for the preset cookie? echo setcookies(test); seems to be 1 always. Tnx, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] arrays with form data?

2002-02-13 Thread Bas Jobsen
? List($text,$number)=explode(|,$FORM_ITEM); ? form method=post action=? echo $php_self; ? input type=radio name=FORM_ITEM value=TextHere|5 input type=radio name=FORM_ITEM value=OtherText|10 /form Op woensdag 13 februari 2002 23:04, schreef Police Trainee: good evening gentlemen. I am

Re: [PHP] Help with query

2002-02-09 Thread Bas Jobsen
$number=mysql_num_rows(mysql_query(SELECT DISTINCT date FROM $table)); Op zaterdag 09 februari 2002 13:41, schreef Daniel Alsén: Hi, i can´t seem to get my head to wake up... How would i do to count how many different values that exists in a mysql field? Ie i have a date-field and need to

Re: [PHP] Regex function needed

2002-02-07 Thread Bas Jobsen
Op donderdag 07 februari 2002 23:58, schreef Michael Kimsal: Looking for a regex (preg or ereg) to remove all 1, 2 and 3 character words. ? $string=over deze regex loop ik nu al de hele dag en een uur te piekeren. 't wil niet! of wel! l'a.; $string= .$string; while

[PHP] add value to serialized array?

2002-02-05 Thread Bas Jobsen
Hi, At start test.txt contains a serialized array with value one and two. a:2:{i:0;s:3:one;i:1;s:3:two;} after one run this is: a:3:{i:0;s:3:one;i:1;s:3:two;i:2;s:4:tree;} But the last row prints nothing. Why? Tnx, Bas ? $array=array(); $fp=fopen(test.txt,r); flock($fp,1);

Re: [PHP] add value to serialized array?

2002-02-05 Thread Bas Jobsen
Hello, OKay, when i replace the last rows with: $fp=fopen(test.txt,r); flock($fp,1); $array=array_merge($array,unserialize(fread($fp,filesize(test.txt; flock($fp,3); fclose($fp); it works. But now i want to place this in a class, and it goes wrong again. Hope you can help, thanks, Bas

[PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Bas Jobsen
Hello, Thanks all. I will rename the second function. Now if have: if($wat==naam)$temp=make_naam($this); else if($wat==anderenaam)$temp=make_anderenaam($this); //etc.. But i would prefer something like $temp=make_$wat($this); How can i do this? Tnx, Bas -- PHP General Mailing List

Re: [PHP] variable function call (Re: [PHP] unset a function?)

2002-01-31 Thread Bas Jobsen
Hello, $func = make_ . $wat; $temp = $$func($this); I think one $. $func = make_ . $wat; $temp = $func($this); will work Bas Op donderdag 31 januari 2002 12:17, schreef u: Hoi Bas, $func = make_ . $wat; $temp = $$func($this); bvr. On Thu, 31 Jan 2002 11:55:12 +0100, Bas Jobsen

Re: [PHP] COS function

2002-01-31 Thread Bas Jobsen
Cause there is no exact representation of PI, you get a floatingpoint representation of nearly zero. Try: echo intval(cos(0.5*pi())); echo printf(%.1f,cos(0.5*pi())); Op donderdag 31 januari 2002 13:39, schreef michael Rabbitte: I was wondering about the cos fuction in PHP when I try to get

[PHP] unset a function?

2002-01-30 Thread Bas Jobsen
Hello, I have this: ? include(file1); function_somename(); include(file2); function_somename(); ? file1 and contain a function definition, but the function in both files had the same name. This will give Cannot redeclare . So can i unset the function before the second include? Tnx, Bas

Re: [PHP] unset a function?

2002-01-30 Thread Bas Jobsen
Hi, ? function bas() {echo hello 1;} bas(); unset(bas); function bas() {echo hello 2;} bas(); ? output: parse error, expecting `T_VARIABLE' or `'$'' Op woensdag 30 januari 2002 21:51, schreef Rick Emery: what happened when you tried unset()? -Original Message- From: Bas Jobsen

Re: [PHP] unset a function?

2002-01-30 Thread Bas Jobsen
Hi, Thanks all. I will rename the second function. Bas -- 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] strange problem

2002-01-18 Thread Bas Jobsen
No idea, but a fella on this list told me [] had been deprecated in favour of {} Maybe that has something to do with it? Maybe: $a[${'%coding'}] = 'red'; this works: ? ${'%coding'}='blue'; $a[${'%coding'}]='red'; echo $a[blue];//print red ? -- PHP General Mailing List

[PHP] find the fake users

2001-12-28 Thread Bas Jobsen
Hello, On this list yesterday: As long as these tools are out there, it should keep all of us on our toes, and programming with security constantly on our minds. Today i have tested, Smart HitBot (http://www.hitbot.f2s.com/). Bad stuff for stats, toplist, searchengines etc. Now i want filler

Re: [PHP] phpmyadmin blob blues

2001-12-28 Thread Bas Jobsen
In config.inc.php: -- // In browse mode... $cfgShowBlob = FALSE; // display blob field contents -- Maybe put it on TRUE? Op vrijdag 28 december 2001 16:52, schreef Paul S.: I had been using blob for a lot of mysql text fields, even email address as well as other data. all of a

Re: [PHP] Counting Views on records in DB!

2001-12-21 Thread Bas Jobsen
UPDATE $table views=views+1 Op vrijdag 21 december 2001 21:38, schreef Thomas Edison Jr.: Hi, I was just going through some Message Board system and noticed that there is a Views column which gives how many times the Message has been viewed. I created a similar message board, where

[PHP] call php with javascript

2001-11-27 Thread Bas Jobsen
Hi, i have test.php: ? echo test; ? to call this in the html, i use SCRIPT LANGUAGE=Javascript SRC=test.php/script this works fine for IE, but is there an alternative for Netscape to do this? Tnx, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] Safe mode and dir permissions

2001-11-16 Thread Bas Jobsen
Hello, You can't change permissions in safe_mode. and for every new people inserted the system creates a Directorie and will upload things Maybe you give the new people something like a autonumbered userid. So you can created the dirs /userid0/, /userid1/ etc. already by hand. -

Re: [PHP] PHP Redirect / header(location: )

2001-11-09 Thread Bas Jobsen
Am I doing something wrong? Thank you. You may print nothing before the redirect header! ? echo hello; header(Location: go); exit; #wrong! ? ? ? header(Location: go); exit; echo hello; #oke, but hello isn't print ? ? - Original Message - From: phantom [EMAIL PROTECTED] To: [EMAIL