Re: [PHP] temporary image

2001-12-19 Thread Bogdan Stancescu
Hi! You may want to check out the tempnam() function -- it's under filesystem functions in the downloadable documentation. Bogdan hallo, my applications generates a html-page, with a link to an image. this image is created by the application, and should exist only temporarily - so it can

Re: [PHP] temporary image

2001-12-19 Thread Bogdan Stancescu
On the other hand if you want to keep track of the number of files generated you might want to try something like this: $i=1; $thePath=$temp_dir./$fileprefix; while (file_exists($thePath.$i)) { $i++; } $thePath.=$i; ($thePath stores a valid temp

Re: [PHP] How to open an existing Excel file(.xls) from PHP program

2001-12-19 Thread Bogdan Stancescu
There was a similar thread on the Midgard mailing list not long ago -- you may want to take a look for possible solutions: http://marc.theaimsgroup.com/?l=midgard-userm=100653565721944w=2 Hi, How to open an existing excel file(.xls) from PHP, and edit the contents of the particular

Re: [PHP] Size of array in bytes

2001-12-20 Thread Bogdan Stancescu
Had the same problem not long ago and I didn't find a simple solution either. My solution at the time was the painfully slow one - walking the array and storing strlen for both key and value. Since you have a large array, this probably doesn't do for you. A faster but less accurate solution

Re: [PHP] Convert tif -- jpg

2001-12-20 Thread Bogdan Stancescu
If you work under Linux you might want to check out the man page for mogrify and perform an ? exec(mogrify -format jpeg $filein $fileout); ? for example. Bogdan Please help me. I need convert image from tif format to the jpg format, exist any php function to do this ? Thank you

Re: [PHP] Global Arrays ?

2001-12-20 Thread Bogdan Stancescu
Sounds quite odd - you may try an echo(serialize($g_months)) in the function and see what you get... It may be that the code generating the option box has problems - this way you make sure $g_months is empty indeed. Bogdan Jason Rennie wrote: Hi all, I've got an array in the global scope

Re: [PHP] Global Arrays ?

2001-12-20 Thread Bogdan Stancescu
The first thing that comes to mind - if you say it's working with local variables - is trying to set it local prior to using it (i.e. insert a $loc_months=$g_months just below global $g_months and use the local variable from then on). It may be a bug in your PHP - walking an array with each

Re: [PHP] Re: Global Arrays ?

2001-12-20 Thread Bogdan Stancescu
Why is this needed in this case an not for local variables? You probably are right, I don't imply you aren't, but why is a reset needed in local scope when using global variables? Is it possible to start an each() in a function and continue it in another for global arrays? Philip Hallstrom

[PHP] Mommy, is it true that...?

2001-12-20 Thread Bogdan Stancescu
Hi everybody! Two things I consider urban myths about PHP (plus MySQL) - please let me know what you think of these: 1. The evil global variables Ok, the classic ? if ($pwd==GOODPASSWORD) { $lethimin=1; } [bullshit code] if ($lethimin) { echo(fread(fopen(/etc/passwd,r)));

[Fwd: [PHP] Number Format]

2001-12-20 Thread Bogdan Stancescu
Inadvertedly sent to me: Bas van Rooijen wrote: sprintf(%02d, $i); but you should indeed check out how this function works.. phantom wrote: I would like to format numbers to be a fixed width. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED]

Re: [PHP] Positioning HTML output in browser window

2001-12-20 Thread Bogdan Stancescu
Well, you can always code in a little Javascript, such as window.location='#lastpos'... Leland wrote: I tried generating a A NAME=lastpos/A in the orginal list, but I haven't been able to create the return link on the other page that will refrence this. I tried A

Re: [PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Bogdan Stancescu
Philip Hallstrom wrote: A definite possibility, but it does depend on the hacker in question knowing exactly how your script is written... True, but in a shared hosting environment this is very likely. ...not to mention open source code. However, the discussion was indeed oriented towards

Re: [PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Bogdan Stancescu
Well, the official point is rather obvious from my original e-mail. What I personally do is either forget about it -- again, see the original e-mail -- or, if for some reason high security is needed, I simply add 0 (zero) to numeral input fields and addslashes to strings. Bogdan [EMAIL

Re: [PHP] Re: Mommy, is it true that...?

2001-12-20 Thread Bogdan Stancescu
True, but in a shared hosting environment this is very likely. ...not to mention open source code. Oh yeah. Guess I had a mental lapse there. If you are using, say, a script downloaded from freshmeat.net and it happens to be poorly secured then obviously the entire free world is going

Re: [PHP] Re: Mommy, is it true that...?

2001-12-21 Thread Bogdan Stancescu
Oh yeah. Guess I had a mental lapse there. If you are using, say, a script downloaded from freshmeat.net and it happens to be poorly secured then obviously the entire free world is going to know how to exploit your copy of itduh Actually that's exactly what I had in mind.

Re: [PHP] Login Script

2001-12-21 Thread Bogdan Stancescu
This is your problem -- what do you expect this line to do? $sid (login($user, $pass)); Bogdan -- 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:

Re: [PHP] embed pdf.

2001-12-21 Thread Bogdan Stancescu
Embed as in...? To my knowledge there is no way to embed a PDF in a web page - you can see a PDF from the browser, but I don't know how a PDF could be embedded within an actual HTML page. Bogdan Webleycity wrote: Does anybody out there know how to embed pdf in a web page -- PHP General

Re: [PHP] Sendemail appends domain to mail function

2001-12-21 Thread Bogdan Stancescu
Or, better yet, try From: XYZ company xyz@mydomain; Bogdan Alex Vargas wrote: That's because XYZ company isn't a valid email address and sendmail fixes the address with the name of the server. If you'd put [EMAIL PROTECTED], you'd see that address unchanged. Alex. - Original Message

Re: [PHP] Question about CREATE_FUNCTION

2001-12-21 Thread Bogdan Stancescu
Why do you need this? To my knowledge you get the same behaviour with ? function create_function() { [body] } $test=create_function; $test; ? Bogdan Emile Bosch wrote: Dear list, Does anyone know how the internals of create function works? $test =

Re: [PHP] HELP TO VALIDATE CHECKBOXES

2001-12-21 Thread Bogdan Stancescu
while ($row = mysql_fetch_array($result)) { echo $row[name]; list($checked)=mysql_fetch_row(mysql_query(select user_id from User_Category where user_id='$current_user' and category_id='.$row[category_id].')); $checked=$checked? checked:; echo 'input type=checkbox name=cat[]

Re: [PHP] HELP TO VALIDATE CHECKBOXES

2001-12-21 Thread Bogdan Stancescu
Ummm, though of this after I sent the e-mail: you may even perform the line after list($checked)... with an if in the query and skip the line altogether. But that may be a little too much... :-) Bogdan Bogdan Stancescu wrote: while ($row = mysql_fetch_array($result)) { echo $row

Re: [PHP] Question about CREATE_FUNCTION

2001-12-21 Thread Bogdan Stancescu
Or, to actually prove your point in the original e-mail (I checked it and you're right): ? function echotest() { echo(Testing); } $test=echotest; ? If you now try ? $test; ? it won't do anything -- as you said, ? $test(); ? is the proper code. Something worth mentioning is that

Re: [PHP] Mommy, is it true that...?

2001-12-21 Thread Bogdan Stancescu
Yes, that's a very good one I didn't think of! One thing that I do know is dangerous is deleting rows based on an integer field with an unprocessed value; Ca-Boom! The entire table has been deleted. Don't you feel dumb! -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] Most secure way to send a password

2001-12-21 Thread Bogdan Stancescu
JavaScript doesn't implement any kind of one-way hashing. But that's for a good reason: suppose JavaScript encoded your password and sent it encoded to the server. The in-between hacker would retrieve the encoded password as it is sent to the server and simply pass that as the password - he

Re: [PHP] Most secure way to send a password

2001-12-21 Thread Bogdan Stancescu
As a side note, that's obviously the most insecure part of entering the password because it's the only time you enter the password. :-) The most insecure part of entering a password in a web form is when you click submit and your password is sent in plain text form to your next PHP

Re: [PHP] storing line breaks in a database

2001-12-21 Thread Bogdan Stancescu
Yes - implement the Nike solution: Just do it! You have no problems, simply insert the data from the input box in the table. You may want to display the results with nl2br() so you can see the line breaks in HTML afterwards. Bogdan Robin McKenzie wrote: I am storing comments in a MySQL db,

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

2001-12-21 Thread Bogdan Stancescu
To be exact, update table messages set views=views+1 where id=$msg_id Bogdan Bas Jobsen wrote: UPDATE $table views=views+1 picked up is counted!! Can anyone guide me as to how this can be achieved? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] Question about CREATE_FUNCTION

2001-12-21 Thread Bogdan Stancescu
Why do you draw the conclusion you're misunderstood? We are unable to answer your question about speed -- so aren't we allowed to have a separate discussion derrivated from your question? Bogdan Emile Bosch wrote: thx for al the help but i need some help of a php developer i guess cuz i am

Re: [PHP] php pop3 checker

2001-12-22 Thread Bogdan Stancescu
Check these out: http://www.horde.org/imp/ http://twig.screwdriver.net/ Also, make sure you search Google for security problems on them - I think IMP used to have some, but they seem to have fixed them since. M.E. Suliman wrote: Hi I need to create a way for users to a site to check

Re: [PHP] Function definition: how to make default argument an empty array?

2001-12-22 Thread Bogdan Stancescu
Can't test it now, but have you tried function makeyogurt ($flavour, $type = list()) I assume you need it to be an array because you want to either walk it or, more likely, perform an in_array() test on it and you found that passing non-array variables to in_array issues an error. If

Re: [PHP] Php Directory structures

2001-12-22 Thread Bogdan Stancescu
Just a suggestion: use exec(ls -1 root/articles/??_head.xml,$article_files) to find out the files -- then walk $article_files, parse the file and echo whatever you please. :-) Bogdan Martin Hughes wrote: Heya, Can PHP count the number of a certain ftile in a directory and then print the

Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Bogdan Stancescu
Make sure you close the accolade afterwords in PHP -- other than that, yes, it works just fine! For example this should work just fine: - ? for ($i=0;$i10;$i++) { if (!($i%3)) { ? Found a multiple of three! ? echo($i); ?br? } } ? -- Bogdan Robert Dyke wrote:

Re: [PHP] If/else conditional statement ...

2001-12-23 Thread Bogdan Stancescu
Took a better look at your code -- you've capitalized true -- that may be it. Bogdan -- 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] is_dir and cache problem ...

2001-12-23 Thread Bogdan Stancescu
I do the same with is_file() in several scripts and it works just fine without clearing the cache. Don't know about dirs but I can't see why it may be different - should use the exact same functions internally. On a side note, I'd rather recommend using a loop like ? global $mytmpdir; //

Re: [PHP] is_dir and cache problem ...

2001-12-23 Thread Bogdan Stancescu
Forgot a couple of double quotes and the mode for mkdir. Perfectionist, you see... :-) Bogdan ? global $mytmpdir; // usually /tmp -- you set this as you please globally $dd_prefix=$mytmpdir/temp_download_[project name here]; $i=0; while (is_dir($dd_prefix$i)) { $i++; }

Re: [PHP] strange empty array behavior being at in_array()

2001-12-24 Thread Bogdan Stancescu
Try in_array('pattern',array('')) and in_array(1,array(0)). The quirk you found is predictable, as we know how PHP behaves when converting strings to integer values... And 'pattern' evaluates to 0 -- '55pattern' for example doesn't match -- but then again, what kinda word is that? :-) HTH

Re: [PHP] strange empty array behavior being at in_array()

2001-12-24 Thread Bogdan Stancescu
RTFM: http://www.php.net/manual/en/language.types.type-juggling.php Peter Vereshagin wrote: Bogdan Stancescu wrote: Try in_array('pattern',array('')) and in_array(1,array(0)). The quirk you found is predictable, as we know how PHP behaves when converting strings to integer values

Re: [PHP] Fulltext-Search

2001-12-24 Thread Bogdan Stancescu
http://www.htdig.org/ Martin wrote: Hello! Does anybody know a good script to search the own web-server?! Would be nice if the script could display the whole sentence where the word was found... Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

Re: [PHP] relative path vs. INCLUDE() !!!!!

2001-12-24 Thread Bogdan Stancescu
This is a kind of a shit happens answer -- ummm... nope, there's no workaround. The only workaround is providing a global path variable and use that for all pages, but you probably already thought about that. Sorry for the bad news on Christmas! :-) Bogdan Arcadius A. wrote: Hello ! I've

Re: [PHP] Suggestion: Adding fmt like linebreak algorithm

2001-12-25 Thread Bogdan Stancescu
. // Usage example: // if (!isphpver(4.0.2)) // { // [do something] // } // Bogdan Stancescu [EMAIL PROTECTED], November 2001 function isphpver($minver) { $itis=2; // That is, undecided $minimum=explode(.,$minver); $current=explode(.,phpversion()); for ($i=0;(($isizeof

Re: [PHP] Mailling Lists

2001-12-26 Thread Bogdan Stancescu
I'm really unable to discuss the mailing-list topic because I have nil expertise in this field (apart from using them, that is). However, I'd strongly advise you to use something based on some kind of database system, because alternate methods of storing data (i.e. plain text files) are crippled

Re: [PHP] This makes NO SENSE!!!!!

2001-12-27 Thread Bogdan Stancescu
Most probably you have some kind of slashing in there. Check it out by also echoing $date from php and if nothing looks wrong, take a look at the source code. HTH Bogdan Chris Cocuzzo wrote: hey- ok. I have the following code. ?php if($submit) { echo(Input date: $datebr\n);

Re: [PHP] Re: Generate Alphabet

2001-12-27 Thread Bogdan Stancescu
I seriously doubt your code works -- have you tested it? I think the code you submitted will most probably output 1 2 3 4...24 25 26 (spaces are actually \n's). I never tested it though, so I may be mistaken. However, with just a few changes we get $letter='a'; $i=0; while ($letter'z') {

Re: [PHP] This makes NO SENSE!!!!!

2001-12-27 Thread Bogdan Stancescu
To whom is your question directed? From the looks of it, it seems you're asking me... If that's the case, why? Bogdan Andrey Hristov wrote: What PHP version do you use(4.1.0?) Regards, Andrey Hristov - Original Message - From: Bogdan Stancescu [EMAIL PROTECTED] To: Chris Cocuzzo

Re: [PHP] crack lib

2001-12-27 Thread Bogdan Stancescu
I also subscribe to the opinions against your objection. David has a very good point I would've made hadn't he beat me to it: 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. Bogdan Dennis Gearon wrote: If the

Re: [PHP] Can you fake a onClick?

2001-12-27 Thread Bogdan Stancescu
Yes: a href=javascript:CountIt('actual link here')Text/a And in ClickIt you'll have to append if (goto) { window.location=goto; } Obviously, you'll have to redefine ClickIt() to ClickIt(goto) I don't know if all the code is 100% accurate, but that's definitely the direction to go. You may

Re: [PHP] hotmail settings POP and SMTP under Mozilla

2001-12-27 Thread Bogdan Stancescu
You most probably 1. Have to ask about this somewhere else; 2. Won't be able to set it up -- Hotmail is M$ and, as such, it implements its own protocols. Bogdan ger wrote: Does anybody know how to set up my mail reader (Mozilla ) to be able to read and send mail with my HOTMAIL account ?

Re: [PHP] Can you fake a onClick?

2001-12-27 Thread Bogdan Stancescu
Uh, ok. You said my form contains a function, so... Well, yes, you can do that too -- in the ugly way: http://www.clipart.com/ (take a look at the links -- using out.php?un=location, where out.php contains CountIt(). Bogdan Douglas Harter wrote: Maybe I should have mentioned that CountIt is

Re: [PHP] Re: Generate Alphabet

2001-12-28 Thread Bogdan Stancescu
Philip Olson wrote: I seriously doubt your code works -- have you tested it? I think the code you submitted will most probably output 1 2 3 4...24 25 26 (spaces are actually \n's). I never tested it though, so I may be mistaken. Yes, it works. Test it before posting such doubts :)

Re: [PHP] Help on JavaScript Windows with PHP

2001-12-28 Thread Bogdan Stancescu
I don't know if this is it, but you may: 1. Replace print(returnwin=window.opener.navigate(urlLoc);\n); with print(window.opener.location='urlLoc';\n); 2. Try opening the pop-up widow with Netscape allowing the location input box to appear, click on Close e Update and, if it doesn't

Re: [PHP] Searching a string or similar

2001-12-28 Thread Bogdan Stancescu
if (strpos(SCRIPT LANGUAGE = Javascript,$input_string)===false) { echo(Yeah, right!); exit; } You'll have a lot of problems, though, because 1. You also need to check for script type=text/javascript; 2. You have to strtolower() both strings in order to eliminate capitalization differences;

Re: [PHP] Part II: Help on JavaScript Windows with PHP

2001-12-28 Thread Bogdan Stancescu
The way it looks to me, you do both the window opening sequence and the closing procedure twice: - Window opening: you specify window options (toolbar, status bar etc) once in the window.open() call and once in the actual window code; - Window closing: you perform the same actions once upon

[PHP] Security bulletin?

2001-12-28 Thread Bogdan Stancescu
Hello everybody! Apart from the usual best wishes for 2002, I have a question: does anyone know of a good security list/newsletter/bulletin for PHP? Actually, any kind of good source would be great, even if it's net security in general -- what I'm looking for is: 1. Mostly PHP security

Re: [PHP] More on Help on JavaScript Windows with PHP

2001-12-28 Thread Bogdan Stancescu
Hello, Carlos! 1. onUnload IS called by Netscape. Didn't test it with Konqueror, but I guess it's called as well; 2. My guess is that you have a problem with the function itself, that's why I strongly suggest you define it as a standalone function and use javascript: for debugging; 3. No,

Re: [PHP] Including files variables ...

2001-12-28 Thread Bogdan Stancescu
I may be repeating myself -- use the Nike solution: just do it! :-) Global variables are implicitly passed to includes. Please provide more info if that's not the case (not globals/globals somehow not being passed). Bogdan Evansville Scene wrote: I'm having problems passing variables into

Re: [PHP] Licensing??

2001-12-28 Thread Bogdan Stancescu
LOL! You may want to read this for clarification: http://www.gnu.org/philosophy/free-sw.html Bogdan Andrew V. Romero wrote: what do they get out of it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: [PHP] Licensing??

2001-12-28 Thread Bogdan Stancescu
Ok, I was misled by the manual copyright at http://www.php.net/manual/en/copyright.php -- anyway, it's the same sprit, I believe. Bogdan Rasmus Lerdorf wrote: Well, PHP is not under the GPL. But you still don't need to buy any sort of license. -- PHP General Mailing List

Re: [PHP] Templating solutions?

2001-12-29 Thread Bogdan Stancescu
A great solution for this kind of job is Midgard (www.midgard-project.org). It provides heaps of features oriented to solving all your possible problems -- user control/access; separate content and style templates, manages includes automatically so you don't have to fiddle around tens or hundreds

Re: [PHP] Quiz script

2001-12-29 Thread Bogdan Stancescu
Hello! Check these out -- they're not filtered as to only search PHP projects: http://freshmeat.net/search/?site=Freshmeatq=quizsection=projects The only PHP project in there is Duck. HTH Bogdan Indera wrote: I have been looking for a script that I can use to create online quizzes. I also

Re: [PHP] Including images from Internet

2001-12-30 Thread Bogdan Stancescu
If you're really serious about implementing this, it can be done using socket functions and basically creating a crippled browser's functions to only retrieve files. If you want to go on in this direction, I'm able to help -- just let me know what details you need. Bogdan Gaylen Fraley wrote:

Re: [PHP] mysql_fetch_array

2001-12-30 Thread Bogdan Stancescu
If everything else fails, you should consider using mysql_fetch_row() instead. Bogdan Greg Sidelinger wrote: Ok I have use mysql_fetch_array to dump the results of a select query with a join in it. if my tables contain a column with the same name how can I distinguish from them. -- PHP

Re: [PHP] Bit shifting conversion (Delphi - PHP)

2001-12-30 Thread Bogdan Stancescu
Why do you need word specifically? I personally had a hard time with PHP in the beginning exactly because I migrated from the Turbo Pascal/Dephi environment. Just learn how to deal with the new environment: use larger data types and shift right the byte in order to create a word and use logical

Re: [PHP] Including images from Internet

2001-12-30 Thread Bogdan Stancescu
Gaylen wrote: Check the validity of the link. This is inherent to the process -- no need to worry - you just have to include some error fallback code in the process. Check the size. If less than a particular size, then PHP will resize/resample it and display a stndard Avatar sized icon.

Re: [PHP] Testing: DON'T Ignore This Message

2001-12-31 Thread Bogdan Stancescu
It seems to work. I'll use this thread to ask an admin question: why doesn't the mailing list daemon add a reply-to address similar to the one I manually added here? Wouldn't it be more comfortable for all parties concerned? Bogdan John Monfort wrote: Test Cannot submit to list. Test --

Re: [PHP] Apache Error 500

2001-12-31 Thread Bogdan Stancescu
Out of curiosity, why would you ever need this kind of URL? And what would you expect Apache to do - issue a 404 error instead? Bogdan [EMAIL PROTECTED] wrote: if my url is like : test.php everything is ok, but when I use test.php/1, I get the Apache Internal 500 Error. -- PHP General

Re: [PHP] length of string

2001-12-31 Thread Bogdan Stancescu
Take a look at the maximum allowed memory size used by PHP -- too much in a hurry to provide a link. Approx. 8MB is the default. That's the limit for strings too. Bogdan Ray Todd Stevens wrote: I can't seem to find this anywhere in the manuals. What is the maximum length of a string?

Re: [PHP] Date aritmetic

2002-01-02 Thread Bogdan Stancescu
Not mentioning that you could've taken a look at http://www.php.net/manual/en/ref.datetime.php yourself, here goes: $days_diff=(mktime(0,0,0,$month2,$day2,$year2)-mktime(0,0,0,$month2,$day2,$year2))/86400; Bogdan Carlos Fernando Scheidecker Antunes wrote: Hello all, I would like to know if

Re: [PHP] Date aritmetic

2002-01-02 Thread Bogdan Stancescu
Well, actually $days_diff=(mktime(0,0,0,$month2,$day2,$year2)-mktime(0,0,0,$month1,$day1,$year1))/86400; but you probably got that... :-) Bogdan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To

Re: [PHP] Q: PHP3 / Read STDIN when missing Content-Type

2002-01-03 Thread Bogdan Stancescu
Your question intrigued me enough to start searching for an answer. Never did this myself, but you may try http://download.php.net/manual/en/html/function.fopen.html (fifth paragrapgh of explanations). Hope it works with Apache - I was unable to determine if this only works when you run PHP

Re: [PHP] RE: nested includes

2002-01-03 Thread Bogdan Stancescu
This can be solved partly with include_path setting in php.in or in apache's config files (even in .htaccess). You can just set include_path to your project's (or application's) root directory, and make all the paths relative to this directory in include() and require(). Or if you intend to

Re: [PHP] File Upload Question - Previewing .jpgs

2002-01-03 Thread Bogdan Stancescu
That's a browser/image type issue. If you're trying it with a JPEG image (as the message title suggests) then it's a browser issue -- your browser doesn't handle JPEG files due to local settings, and starts up the paint program instead. If you're trying with some other image type (such as TIFF

Re: [PHP] Modulus and floating point...

2002-01-04 Thread Bogdan Stancescu
You can consider doing this: $number=102.52; $fraction=$number-floor($number); $number=($number % 50)+$fraction; Basically it's the exact solution you're suggesting, just that you don't have to do any string stuff. PHP's behaviour is normal - modulus is generally intended for integers...

Re: [PHP] How to clear a populated array

2002-01-04 Thread Bogdan Stancescu
I don't know, does $Errors=array() work for you? Hope I understood your problem... Bogdan Carlos Fernando Scheidecker Antunes wrote: Hello All, I have a populated array that stores user input errors. I have been browsing the manual and some books and I couldn't find one thing. I've got

Re: [PHP] Stupid question alert

2002-01-04 Thread Bogdan Stancescu
Your question is not stupid - it's just uninformed, and that's easily understandable if you never used PHP. The concept is dynamically creating the page SERVER-SIDE. That is, use some databases or some nifty code to dynamically build a page using specific parameters. Unforunately for you, this

Re: [PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread Bogdan Stancescu
I suck big time at regular expressions, but have you tried str_replace(\r\nhtml\r\n, '', $string); ? Bogdan David Yee wrote: Hi guys. Quick regular expressions question here: I want to match: html but not: blah blah html Basically I want to wipe out lines beginning with the html

Re: [PHP] Quick regular expressions question / preg_replace

2002-01-04 Thread Bogdan Stancescu
Message - From: Bogdan Stancescu [EMAIL PROTECTED] To: David Yee [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 04, 2002 6:20 PM Subject: Re: [PHP] Quick regular expressions question / preg_replace I suck big time at regular expressions, but have you tried str_replace(\r

[Fwd: [PHP] Stupid question alert]

2002-01-04 Thread Bogdan Stancescu
: Bogdan Stancescu [EMAIL PROTECTED] Newsgroups: php.general To: tim at 10Kv [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Friday, January 04, 2002 6:17 PM Subject: Re: [PHP] Stupid question alert Your question is not stupid - it's just uninformed, and that's easily understandable if you never used

Re: [PHP] adding users on *nix

2002-01-05 Thread Bogdan Stancescu
I'm not sure how you'd go about doing that, but be warned that you're walking on very thin ice (security-wise) to allow such an action. You must be very extra super careful not to get hacked! Not only that you'll be potentially allowing hackers to create users on your machine, but at some time

Re: [PHP] check browser communication

2002-01-05 Thread Bogdan Stancescu
What do you mean exactly? You want to be able to monitor (as in see) the data being transacted by your browser with the server or is it something else you're after? Bogdan Daniel Urstöger wrote: Hiya ! A little offtopic this question, but really important .. I need to check all the

Re: [PHP] Plz help w/ php/MySQL

2002-01-05 Thread Bogdan Stancescu
Anthony Rodriguez wrote: The following php script successfully e-mails both messages but it doesn't update in the table scr_149 the column notified. Why? ?php $connection=mysql_connect(localhost,wagner,123) or die (No connection!); $db=mysql_select_db(sbwresearch_com,$connection) or die

Re: SV: [PHP] Re: Still need help with miscount

2002-01-05 Thread Bogdan Stancescu
I don't know if this is actually it, but the line $num_vals[$i] = mysql_fetch_array($result); seems strange to me - doesn't mysql_fetch_array return an array? You should try list($num_vals[$i]) = mysql_fetch_array($result); and see if you get any improvements... Daniel Alsén wrote: I have

Re: [PHP] Checking the season

2002-01-05 Thread Bogdan Stancescu
You could do a case() or if/elseif, check if it's spring, summer or autumn and leave the code for winter as default/else. Bogdan webapprentice wrote: Hi, Just need a sounding board to help me think this through. I want to check the current date to determine what season it is and display

Re: [PHP] distinct element from array

2002-01-06 Thread Bogdan Stancescu
$distincts=array(); while (list($key,$val)=each($yourarray) { if (!in_array($val,$distincts)) { $distincts[]=$val; } } Kancha . wrote: An array contains various values eg: list of fruits. Now i want to retrieve only unique fruits from the array. The array may contain duplicate

Re: [PHP] PHP4 and POP Email ?

2002-01-06 Thread Bogdan Stancescu
You may check out IMP for a program. The functions you're looking for are listed in the documentation under IMAP mail (it's a generic set of functions for both IMAP and POP). Bogdan Jason Caldwell wrote: Is there a way I can * download * emails and save them to disk (as individual emails)

Re: [PHP] PHP Parsing Efficiency

2002-01-06 Thread Bogdan Stancescu
There may be a difference but even if it is, it's so small you shouldn't consider it. Imagine how much it takes for a (generally) cached document to be checked for ? or ?php or whatever you're using... Don't bother with this one! Bogdan Marvin Sanders wrote: Newbie question: Is there any

Re: [PHP] bcc

2002-01-06 Thread Bogdan Stancescu
What do you mean? Supported in what way? (I take it you're referring to the e-mail blind carbon copy feature). Bogdan Deependra B. Tandukar wrote: Greetings ! Is Bcc supported in PHP? Looking forward to hearing from you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

[Fwd: Re: [PHP] bcc]

2002-01-06 Thread Bogdan Stancescu
Inadvertedly only sent to me... Original Message Subject: Re: [PHP] bcc Date: Mon, 7 Jan 2002 11:46:07 +0800 From: Jimmy [EMAIL PROTECTED] To: Bogdan Stancescu [EMAIL PROTECTED] References: [EMAIL PROTECTED]00b701c1972b$68cae5c0$[EMAIL PROTECTED] [EMAIL PROTECTED] Is Bcc

Re: [PHP] Regarding mail function

2002-01-07 Thread Bogdan Stancescu
Gee, Sandeep, what a great reply! I wish I got this kind of support when I asked a question on this list too! Balaji, sorry, man, I don't know how to help you - I was just touched by Sandeep's reply and wanted to point it out for everybody to see just how helpful we are in these parts. Tet

Re: [PHP] Designer adrift in a sea of code - please point me towards land...

2002-01-08 Thread Bogdan Stancescu
Hi! I noticed you've been repeatedly posing this message. The reason why nobody answers is because your question is a little strange. The answer is yes, you could have something like [file whatever.php] div id=haiti style=position:absolute; left:752px; top:321px; width:166px; height:162px;

Re: [PHP] Redirecting to a URL

2002-01-08 Thread Bogdan Stancescu
Use headers as suggested or use javascript if you want to be able to notify the user about the redirection. Bogdan Robert MacCombe wrote: Hi, how do I redirect to a different URL, e.g. as a result of an IF condition being true. I'm basically looking for a PHP version of the ASP -

[PHP] Checking mail origin?

2002-01-08 Thread Bogdan Stancescu
Hi all! I'm working on a free software package due to be launched on freshmeat some time soon (next month most probably). The program is a project development environment, somewhat similar to phpGroupWare but, I like to think, better and with less bugs. Due to the nature of the project I need

Re: [PHP] Checking mail origin?

2002-01-08 Thread Bogdan Stancescu
Billy Harvey wrote: Bogdan, a technique I've used in the past may work for you. When someone wants to upload something, I have them request a cookie by sending a blank email to a specific address. This automatically generated cookie is good for some limited time (whatever works for you),

Re: [PHP] Checking mail origin?

2002-01-08 Thread Bogdan Stancescu
Thanks for all the suggestions! I found something which suits me just fine based on your ideas - wanted to share it. The system separates most of the elements in the database (including the e-mails) based on project. That means that the users are notified when a project is created and given a

Re: [PHP] I'm new - one page to another

2002-01-08 Thread Bogdan Stancescu
Use a href=link.php?var=$val -- make sure you use rawurlencode() on $val if you expect it to contain special characters that can't be passed via URL (such as spaces or ampersands). Bogdan universal2001 wrote: Hi! I'm new to PHP and I have tried to find the answer to my questions but I

Re: [PHP] php,sockets-help!

2002-01-09 Thread Bogdan Stancescu
Plus, isn't your request content-type: application/x-www-form-urlencoded? And another thing, since you send all the headers HTTP 1.1 compatible, why don't you use it instead of 1.0? Bogdan Sandeep Murphy wrote: Hi, I am opening a socket on a remote server(weblogic) and sending my username

Re: [PHP] Array Creation

2002-01-09 Thread Bogdan Stancescu
while (!feof ($fp)) { $line = fgets($fp, 4096); $data = explode(,, str_replace(\, , $line)); //using str_replace to get rid of quote marks //following line to see if data is correct echo $data[0]. .$data[1].br; $theArray[$data[0]]=$data[1]; } fclose($fp);

Re: [PHP] Array Creation

2002-01-09 Thread Bogdan Stancescu
Also, make sure you get rid of the space at the beginning of $data[1] - the space after the comma gets in there, so either use trim() or just trim the first character programatically ($data[1]=substr($data[1],1)). Bogdan Jamison Roberts wrote: What I have is a text file that has data in the

Re: [PHP] PHP and Images stored in mysql

2002-01-09 Thread Bogdan Stancescu
My way around this is using two fallback stages: for one you test mysql_num_rows() after performing the query. If that's 0, use a default image placed in the database beforehand. If that also returns a null mysql_num_rows() then echo an image (probably the same default) from a known location in

Re: [PHP] Interesting Problem

2002-01-09 Thread Bogdan Stancescu
It's obviously more effective to do it in MySQL, but you shouldn't have any real processing problems even if you don't find an appropriate solution using MySQL exclusively, because you'd have the two arrays ordered by MySQL, so all you'll have to do would be something like

Re: [PHP] External Function

2002-01-13 Thread Bogdan Stancescu
As Jason said, include() is what you should look for and, as Mike said, you should also take a look at include_once() and require_once(). Obviously, require() is another option. However, you should be aware that txt files are displayed as plain text when accessed, so if any sensitive data is in

  1   2   3   4   >