[PHP] Inner Join or 2nd Query...?

2005-05-11 Thread Mark Sargent
Hi All, with wanting to show both product types(Switch, Router etc) and Makers(Cisco, Avaya, etc) on the one page in select boxes, I was wondering, do you use 2 seperate queries to the database or do you inner join to get all in 1..? I have set up different tables with related id's etc. So, to

Re: [PHP] fgets fails after fopen succeeds

2005-05-11 Thread Richard Lynch
On Tue, May 10, 2005 7:42 pm, Thomas Powell said: Printing $fh printed a 1. My original file mode was just r, I changed to r+ to see if I'd get permissions problems. The file handle seems to be fine. fgets just doesn't like it. This is an adaptation of the following code, which works fine

Re: [PHP] Session cookies in firefox

2005-05-11 Thread Richard Lynch
On Tue, May 10, 2005 7:04 pm, Kirsten said: I'm using php sessions with cookies. I realized that Firefox shared cookies between different instances (unlike IE that when someone open a new bank window a new session is created). That's because IE stupidly creates a whole new program/process on

Re: [PHP] base64_encode in URLs

2005-05-11 Thread Richard Lynch
On Tue, May 10, 2005 8:50 pm, Joe Harman said: Hey just curious if it's okay to encode variables that are passed in URLs with base64_encode??? since, I am going to pass a email address in the URL, I would like to protect the email address from typical people I dunno if every character that

Re: [PHP] base64_encode in URLs

2005-05-11 Thread Joe Harman
HA... Thanks for your thoughts... I am actually using this for a broadcast email system... I just use a PHP image generator to make a 1 x1 gif... the image generator script takes a variable for color then I added another one for email address to keep stats on who has opened the message ex.

Re: [PHP] Strange characters

2005-05-11 Thread Richard Lynch
On Tue, May 10, 2005 9:43 pm, Carl Furst said: I have a question about an odd phenomenon. It doesn't have much to do with PHP except that I used strtr to solve it, and it maybe that the problem is being caused by a setting in PHP, but I would like to get some more background info as to why

[PHP] SQL Date guru in the house?

2005-05-11 Thread mwestern
Hi All, I have a small problem. I have a project in which someone has got three integer fields for holding the date. DD, MM, in an sql database.I now have to have a page that inputs two dates and select records between those two dates. If I had a date field in the table it

Re: [PHP] protect your CSS files, and possibly other extenstions as well...

2005-05-11 Thread Richard Lynch
You could do all this... Or you could just move the files outside your web tree and change your include path. [shrug] On Tue, May 10, 2005 9:03 pm, Kit DeKat said: $const = get_defined_constants(); if( !isset($const[SOME_CONSTANT]) || ($const[SOME_CONSTANT] !=

Re: [PHP] Strange characters

2005-05-11 Thread Petar Nedyalkov
On Wednesday 11 May 2005 07:43, Carl Furst wrote: I have a question about an odd phenomenon. It doesn't have much to do with PHP except that I used strtr to solve it, and it maybe that the problem is being caused by a setting in PHP, but I would like to get some more background info as to why

Re: [PHP] Session cookies in firefox

2005-05-11 Thread Petar Nedyalkov
On Wednesday 11 May 2005 05:04, Kirsten wrote: I'm using php sessions with cookies. I realized that Firefox shared cookies between different instances (unlike IE that when someone open a new bank window a new session is created). Has anyone found a solution to this problem? Maybe detecting

[PHP] how to test paralelly?

2005-05-11 Thread Mario Lopez
Hi, I would like to measure how much users per minute can handle my php script, mysql db and apache server also, would like to determine how much users can be served at the same time and how script execution time changes in this case if i run a script like: $id = rand(1,70); $file =

Re: [PHP] Password encryption and password retrieval

2005-05-11 Thread Deep
Hi, Thank you every one for responding to my mail and giving valuable comments and suggestions for it. Thanx, ..Deeps.. --- Deep [EMAIL PROTECTED] wrote: Hi evryone, I want to implement a site where i would like to encrypt the password of the users and store it into mysql

Re: [PHP] SQL Date guru in the house?

2005-05-11 Thread Petar Nedyalkov
On Wednesday 11 May 2005 09:17, [EMAIL PROTECTED] wrote: Hi All, I have a small problem. I have a project in which someone has got three integer fields for holding the date. DD, MM, in an sql database.I now have to have a page that inputs two dates and select records between

[PHP] PHP file-system functions

2005-05-11 Thread anshul
This script lists all files/directories in '.' directory. I wanna pass some querystring with anchor around directories listed, so that if a user clicks a directory-link, all the files in it are listed. How? Please help. ?php $directory='.'; $handle=opendir($directory); echo realpath($directory);

RE: [PHP] SQL Date guru in the house?

2005-05-11 Thread Mark Rees
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: 11 May 2005 07:17 To: php-general@lists.php.net Subject: [PHP] SQL Date guru in the house? Hi All, I have a small problem. I have a project in which someone has got three integer fields for holding the

[PHP] MySql injections....

2005-05-11 Thread virtualsoftware
Hi, This is not the proper list to put this question but i hope you can help me. Does anyone know a good tutorial about mysql injections? Thanks a lot for your help

RE: [PHP] SQL Date guru in the house?

2005-05-11 Thread Shaw, Chris - Accenture
Matthew, Depending on what database, you should have a TO_DATE() or DATE() function that you can cast your dd/mm/ to a date field in the select statement. select to_date(, mm, dd) mydate from dual where mydate = '11/05/2005' and mydate = '11/04/2005' Look in the help files or the

[PHP] imap_open with variable fails

2005-05-11 Thread Michael Baas
Hi, I'm using imap_open and the script works fine on my server with 4.3.11. Now as user with 4.3.10 reported that the script does not work. He finally got it working by replacing my variable-names in the imap_open-command with strings containing exactly the same data (except for the leading

Re: [PHP] SQL Date guru in the house?

2005-05-11 Thread M. Sokolewicz
Petar Nedyalkov wrote: On Wednesday 11 May 2005 09:17, [EMAIL PROTECTED] wrote: Hi All, I have a small problem. I have a project in which someone has got three integer fields for holding the date. DD, MM, in an sql database.I now have to have a page that inputs two dates and select

[PHP] Re: MySql injections....

2005-05-11 Thread M. Sokolewicz
[EMAIL PROTECTED] wrote: Hi, This is not the proper list to put this question but i hope you can help me. Does anyone know a good tutorial about mysql injections? Thanks a lot for your help what's there to make a tutorial about? :| If you can get out of a value via a variable, then that means

RE: [PHP] Inner Join or 2nd Query...?

2005-05-11 Thread Mark Rees
Hi All, with wanting to show both product types(Switch, Router etc) and Makers(Cisco, Avaya, etc) on the one page in select boxes, I was wondering, do you use 2 seperate queries to the database or do you inner join to get all in 1..? I have set up different tables with related id's etc. So,

Re: [PHP] MySql injections....

2005-05-11 Thread Bostjan Skufca @ domenca.com
Probably you mean about prevening mysql injections - or not? :) Bostjan On Wednesday 11 May 2005 11:38, [EMAIL PROTECTED] wrote: Hi, This is not the proper list to put this question but i hope you can help me. Does anyone know a good tutorial about mysql injections? Thanks a lot for your

Re: [PHP] String manipulation out of the box solution?

2005-05-11 Thread Merlin
Richard Lynch wrote: On Tue, May 10, 2005 5:58 am, Merlin said: I am writing an internal full text search engine and do have trouble in outputting the text in an apropriate way. Problem is that if there is more than one word I cant handle the text cropping. For example: Search term: php germany

RE: [PHP] MySql injections....

2005-05-11 Thread Mikey
Hi, This is not the proper list to put this question but i hope you can help me. Does anyone know a good tutorial about mysql injections? Thanks a lot for your help http://phpsec.org HTH, Mikey -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] MySql injections....

2005-05-11 Thread virtualsoftware
I have a site and the other days i received a message from a guy that told me my site is vulnerable to mysql injections. I do not know how can i prevent this. The server is not configured or it's all about the script? - Original Message - From: Bostjan Skufca @ domenca.com [EMAIL

Re: [PHP] protect your CSS files, and possibly other extenstions as well...

2005-05-11 Thread Kit DeKat
Richard Lynch wrote: You could do all this... Or you could just move the files outside your web tree and change your include path. [shrug] This is probably true, but I was thinking of a virtual hosting environment where its easier to maintain the code when its all in a sub-directory named by

RE: [PHP] Strange characters

2005-05-11 Thread Carl Furst
Yeah, the solution I use was posted to the user comments on the strtr command page which is also documented as a better solution than str_replace except for the one caveat that it will only try and change a character once, and some of the hex codes on that page don't really work, because the

[PHP] php resultset restart??

2005-05-11 Thread angelo
Hi all. i've checked the PHP manual but can't find a function for this, perhaps I'm missing something. I get a resultset and loop through it but this is in a loop so it only executes the first time. is this because the resultset is at the end? is there a way to tell PHP to start at the

Re: [PHP] MySql injections....

2005-05-11 Thread Chris Ramsay
Read Chris' article here: http://shiflett.org/articles/security-corner-apr2004 This should explain everything to you - and yes it's down to the scripts you run. Chris R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] MySql injections....

2005-05-11 Thread Jay Blanchard
[snip] I have a site and the other days i received a message from a guy that told me my site is vulnerable to mysql injections. I do not know how can i prevent this. The server is not configured or it's all about the script? [/snip] PHP Security - http://www.shiflett.org -- PHP General Mailing

Re: [PHP] Re: A couple questions about templating

2005-05-11 Thread Rory Browne
Anyways, I restructered my code, and as far as I can see there is nothing wrong with the code, except for that it simply doesn't work :) That's usually considered a fairly serious problem. I'm probably missing something blatently obvious but I'll post it and maybe someone can spot why this

[PHP] Generating a php file

2005-05-11 Thread Dan Rossi
Hi there I am trying to generate a php file, which has variables that i need to have in it ie $_SERVER but not actually be parsed as they need to be in the actual script. I also need to send some variables to assign values to other variables in the script. How is this possible ? I have tried

[PHP] protect your CSS files, and possibly other extenstions as well...

2005-05-11 Thread Rory Browne
Sorry Richard if you received this twice. Okay let me get this straight: You protect your includes by making sure that they have a protected string defined? You pass JS and CSS through PHP, and output a 404 unless they've got a HTTP_REFERER variable set to whatever you want it to be? I guess

RE: [PHP] include remote class

2005-05-11 Thread PHP
if i goto the url i see nothing(normal) as it is just parsing the class and no output. my include seems to parse the PHP but is not delivering the class functions to instantiate. the manual mentions that remote includes with classes or functions wont work but i saw one workaround mentioned on the

Re: [PHP] MySql injections....

2005-05-11 Thread Ryan A
Hey, I had the same questions a little while back, and from the advise i got on this list I checked out the PEAR:DB class and ADODB...I went with the ADODB solution and have not regretted it since. Check both of them out for your needs. Cheers, Ryan On 5/11/2005 12:50:14 PM, Bostjan Skufca @

RE: [PHP] protect your CSS files, and possibly other extenstionsas well...

2005-05-11 Thread Mark Rees
Richard Lynch wrote: You could do all this... Or you could just move the files outside your web tree and change your include path. [shrug] This is probably true, but I was thinking of a virtual hosting environment where its easier to maintain the code when its all in a sub-directory

[PHP] pointing to localhost from remote server

2005-05-11 Thread George Pitcher
Hi, I have a system running on my main server containg separate user and staff interfaces to the same MySQL databases. Part of my process involves spawning off pdf front covers to a local directory, grabbing files from an archive on a networked pc and adding them together to ftp back to the

Re: [PHP] php resultset restart??

2005-05-11 Thread Chris Boget
i've checked the PHP manual but can't find a function for this, perhaps I'm missing something. I get a resultset and loop through it but this is in a loop so it only executes the first time. is this because the resultset is at the end? is there a way to tell PHP to start at the beginning of

Re: [PHP] php resultset restart??

2005-05-11 Thread Burhan Khalid
[EMAIL PROTECTED] wrote: Hi all. i've checked the PHP manual but can't find a function for this, perhaps I'm missing something. I get a resultset and loop through it but this is in a loop so it only executes the first time. is this because the resultset is at the end? is there a way to tell PHP to

Re: [PHP] Session cookies in firefox

2005-05-11 Thread Kirsten
Here's a solution: It's not a problem. It's the way it's SUPPOSED to be. :-) It's actually a BETTER browser because of that. I found dozens of firefox related sites that say that this is one of the good things IE has (like showModalDialog). Maybe it's just me, but it sounds to me like you

Re: [PHP] php resultset restart??

2005-05-11 Thread Philip Hallstrom
i've checked the PHP manual but can't find a function for this, perhaps I'm missing something. I get a resultset and loop through it but this is in a loop so it only executes the first time. is this because the resultset is at the end? is there a way to tell PHP to start at the beginning of the

[PHP] kannel library

2005-05-11 Thread Catalin Trifu
Hi, Has anyone knowledge about a kannel (www.kannel.org) php library to deal with sms and binary content messages such as wap push and nokia smart messages ? Catalin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP][SOLVED] include remote class

2005-05-11 Thread PHP
got it working... $poo = file_get_contents(http://mysite.com/class.php;); eval($poo); where class.php has no ? ? -Original Message- From: PHP [mailto:[EMAIL PROTECTED] Sent: Wednesday, May 11, 2005 8:12 AM To: [EMAIL PROTECTED] Cc: PHP LIST Subject: RE: [PHP] include remote class if i

Re: [PHP] php resultset restart??SOLVED

2005-05-11 Thread Angelo Zanetti
great thanks guys, exactly what we're looking for!!! Philip Hallstrom wrote: i've checked the PHP manual but can't find a function for this, perhaps I'm missing something. I get a resultset and loop through it but this is in a loop so it only executes the first time. is this because the

Re: [PHP] Inner Join or 2nd Query...?

2005-05-11 Thread Mark Sargent
Mark Rees wrote: Hi All, with wanting to show both product types(Switch, Router etc) and Makers(Cisco, Avaya, etc) on the one page in select boxes, I was wondering, do you use 2 seperate queries to the database or do you inner join to get all in 1..? I have set up different tables with related

Re: [PHP] base64_encode in URLs

2005-05-11 Thread Brandon Ryan
Joe, this may be a little off topic, but most modern email clients wont show images in HTML unless the user clicks to show images manually. This could fool your automatic counting and email verification. On 5/11/05, Joe Harman [EMAIL PROTECTED] wrote: HA... Thanks for your thoughts... I am

Re: [PHP] Inner Join or 2nd Query...?

2005-05-11 Thread Kristen G. Thorson
I don't understand what you're trying to do. Do you want two separate list boxes, one for product types and one for makers? If so, use two queries. Use the same block of code you have for product types to populate the makers box. If that's not what you're looking for, you need to describe

FW: [PHP] SQL Date guru in the house?

2005-05-11 Thread Shaw, Chris - Accenture
We could help him if he said what database he is using. Chris. -Original Message- From: Kristen G. Thorson [mailto:[EMAIL PROTECTED] Sent: 11 May 2005 15:42 To: Shaw, Chris - Accenture Subject: Re: [PHP] SQL Date guru in the house? * This e-mail

[PHP] marking words bold

2005-05-11 Thread Merlin
Hi there, I am trying to mark words inside a sentence bold. Problem is, if there is an overlap it does not work anymore. I am using this code: $t = str_replace($word, b$word/b, $text); For eample: Mark those words bold: adventure in singapore Text: My adventure flying to singapore The problem

Re: [PHP] include remote class

2005-05-11 Thread Dan Rossi
im doing include('http://www.mysite.com/class.php'); and then i create new instance but i get error - cannot instantiate non-existant class how can i get this remotely hosted class file to be defined? If you surf to that URL, do you see PHP source, or do you see HTML/nothing? You may want to

Re: [PHP] base64_encode in URLs

2005-05-11 Thread Joe Harman
Hey Thanks Brandon... I know that does happen, so the stats is just suppose to approximate.. thanks for point that out Cheers Joe On 5/11/05, Brandon Ryan [EMAIL PROTECTED] wrote: Joe, this may be a little off topic, but most modern email clients wont show images in HTML unless the user clicks

[PHP] str_replace on words?

2005-05-11 Thread Merlin
Hi there, I am trying to strip some words from a sentence. I tried it with str_replace like described here: http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_using_str_replace.htm Unfortunatelly it does not work the way I want, because if I want to replace the word in all

Re: [PHP] Session cookies in firefox

2005-05-11 Thread Jason Wong
On Wednesday 11 May 2005 13:26, Richard Lynch wrote: On Tue, May 10, 2005 7:04 pm, Kirsten said: I'm using php sessions with cookies. I realized that Firefox shared cookies between different instances (unlike IE that when someone open a new bank window a new session is created). That's

Re: [PHP] marking words bold

2005-05-11 Thread Philip Hallstrom
Hi there, I am trying to mark words inside a sentence bold. Problem is, if there is an overlap it does not work anymore. I am using this code: $t = str_replace($word, b$word/b, $text); For eample: Mark those words bold: adventure in singapore Text: My adventure flying to singapore The problem

RE: [PHP] marking words bold

2005-05-11 Thread Murray @ PlanetThoughtful
I am trying to mark words inside a sentence bold. Problem is, if there is an overlap it does not work anymore. I am using this code: $t = str_replace($word, b$word/b, $text); For eample: Mark those words bold: adventure in singapore Text: My adventure flying to singapore The problem

[PHP] Freelance Work - London N1

2005-05-11 Thread bubba
We're looking for a freelancer to work ON-SITE IN LONDON on a PHP/MySQL content management system for 4-5 weeks, starting in approx. 10 days time. Experience of building bespoke CMS systems is essential. If you're interested, please send your CV, rates and relevant URLs that you've worked on via

Re: [PHP] marking words bold

2005-05-11 Thread Marek Kilimajer
Merlin wrote: Hi there, I am trying to mark words inside a sentence bold. Problem is, if there is an overlap it does not work anymore. I am using this code: $t = str_replace($word, b$word/b, $text); For eample: Mark those words bold: adventure in singapore Text: My adventure flying to singapore

[PHP] Saving of buffers, from a security standpoint

2005-05-11 Thread Colin Ross
I am working on a bit of code for credit-card processing, so please keep in mind, security of the data is essential.. On part of it i wish to use a buffer, but i wonder if that data is saved anywhere on the running system (as a temp file, etc), or is it just held in the system's memory? My

Re: [PHP] marking words bold

2005-05-11 Thread Stephen Johnson
Include a space in your str_replace statement. For instance $t = str_replace( $word , B $word /B, $text); That should prevent the problem your having and ensure only individual words are bolded. ?php /* Stephen Johnson c | eh The Lone Coder http://www.thelonecoder.com [EMAIL PROTECTED]

RE: [PHP] str_replace on words?

2005-05-11 Thread Jay Blanchard
[snip] Does anybody know how to do this on just words? [/snip] explode the string into an array of words and then apply the function to the array value. Then implode the string into a new string. http://www.php.net/explode http://www.php.net/implode -- PHP General Mailing List

Re: [PHP] str_replace on words?

2005-05-11 Thread Duncan Hill
On Wednesday 11 May 2005 17:13, Merlin wrote: Hi there, I am trying to strip some words from a sentence. I tried it with str_replace like described here: http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_text_string_us ing_str_replace.htm Unfortunatelly it does not work the way I

RE: [PHP] str_replace on words?

2005-05-11 Thread Mikey
Hi there, I am trying to strip some words from a sentence. I tried it with str_replace like described here: http://www.totallyphp.co.uk/code/find_and_replace_words_in_a_t ext_string_using_str_replace.htm Unfortunatelly it does not work the way I want, because if I want to replace the

Re: [PHP] str_replace on words?

2005-05-11 Thread Brent Baisley
I think that's a bad example you read. It doesn't describe how to search on a word it describes how to search on a string, which is what you ended up doing. For things like this I use arrays. Assuming your words are separated by spaces, you can get an array of all the words by doing:

Re: [PHP] MySql injections....

2005-05-11 Thread Bostjan Skufca @ domenca.com
it depends by having register_globals set to on (server config) it is usually easier to create sql-injection exploit, but it is not required. What is true is that well written script will defend/sustain such attacks regardles how server is configured (unless configuration is really f*cked

[PHP] Re-initiating an autostarted session

2005-05-11 Thread Ville Mattila
Hi there, I have some problems with PHP session handling. I have set to .htaccess file that PHP will start sessions and use cookies only automatically. Everything works fine until I need to re-initiate the session (give a new session ID and destroy the old one). For some reason, the old

[PHP] Re: SQL Date guru in the house?

2005-05-11 Thread Manuel Lemos
Hello, on 05/11/2005 03:17 AM [EMAIL PROTECTED] said the following: I have a small problem. I have a project in which someone has got three integer fields for holding the date. DD, MM, in an sql database.I now have to have a page that inputs two dates and select records between

Re: [PHP] MySql injections....

2005-05-11 Thread tg-php
Don't forget your native database escaping function. PHP has this one for MySQL, for example: mysql_real_escape_string() That should properly escape everything that could be used against MySQL to perform an injection. There should be some equivalent commend in the various database connection

Re: [PHP] str_replace on words?

2005-05-11 Thread tg-php
As mentioned in the making words bold thread, works aren't always separated by spaces. Sometimes they end a sentence so are followed by a period or other punctuation. Sometimes you have strings like and/or where they're separated by the forward slash, etc. You really have to do some kind of

Re: [PHP] marking words bold

2005-05-11 Thread tg-php
That's a good first step, but I think you're going to have to go with the regex for this one. What happens if one of the words he wants to highlight is near punctuation? $t = str_replace( $word , B $word /B, $text); This wouldn't work if you had: $text = I'm going to the store.; $word =

[PHP] expand array into function arguments?

2005-05-11 Thread Christopher J. Bottaro
You can do this in Python: code def myFunc(arg1, arg2, arg): #do something myList = [1, arg, 5] myFunc(*myList) # calls myFunc(1, arg, 2) code Can that be done in PHP, and if so, how? Thanks for the help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] DOMXML for Release 4.1.2

2005-05-11 Thread Richard Williams
Hi My ISP is still running release 4.1.2 Where can I find documention for the DOMXML functions for this release? Regards Richard Williams -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Re-initiating an autostarted session

2005-05-11 Thread Jason Barnett
Ville Mattila wrote: ... session_destroy(); session_regenerate_id(); session_write_close(); Header(Location: ...); exit; For my point of view, this should do exactly what I like to do: destroy the old session data, generate a new one, write them and redirect the user to next page. And you're

Re: [PHP] Re-initiating an autostarted session

2005-05-11 Thread Leif Gregory
Hello Ville, Wednesday, May 11, 2005, 12:32:07 PM, you wrote: V session_destroy(); V session_regenerate_id(); V session_write_close(); V Header(Location: ...); V exit; I honestly don't know if it's the right way, but I ran into a similar issue a while back. I did it this way:

[PHP] Generating a php file

2005-05-11 Thread Rory Browne
You can start by clarifying. I had to read your message three times before I got a vague understanding. What I'm hearing is that you want to put something like ?php $msg = get_message(); ? into a string? You are having difficulty doing this because you are finding that your string contains the

Re: [PHP] Re: SQL Date guru in the house?

2005-05-11 Thread tg-php
Sorry, don't have time to look up the specifics.. and I've worked with a number of different flavors of SQL, so not sure the syntax or capabilities of the system you're using, but maybe try something like this: SELECT * FROM blah WHERE DATE(mm, dd, yyy) BETWEEN $date1 AND $date2 Basically

Re: [PHP] Saving of buffers, from a security standpoint

2005-05-11 Thread Brent Baisley
You can't be assured that the data is stored only in RAM. Just about all systems use some sort of swap space, so what is stored in memory could end up on disk in a swap file. Of course, if someone is able to access the swap files on your computer, you're probably dead already. PHP also stores

RE: [PHP] marking words bold

2005-05-11 Thread Murray @ PlanetThoughtful
Include a space in your str_replace statement. For instance $t = str_replace( $word , B $word /B, $text); That should prevent the problem your having and ensure only individual words are bolded. Not the best solution if Merlin's code needs to account for the possibility of target

RE: [PHP] expand array into function arguments?

2005-05-11 Thread Murray @ PlanetThoughtful
-Original Message- From: Christopher J. Bottaro [mailto:[EMAIL PROTECTED] Sent: Thursday, 12 May 2005 5:13 AM To: php-general@lists.php.net Subject: [PHP] expand array into function arguments? You can do this in Python: code def myFunc(arg1, arg2, arg): #do something

Re: [PHP] expand array into function arguments?

2005-05-11 Thread tg-php
There's probably some clever answer to this like Just do myFunc($myList) and it'll automatically parse out the arguments.. because PHP does clever things like that sometimes. But if anything, you can do something like this: $myList = array(1, arg, 5); myFunc($myList); function

Re: [PHP] str_replace on words?

2005-05-11 Thread AC
I whipped this together, it should work ok. You'll want to clean it up, but you get the gist. ?php /* AC Was here */ $str=I'm going to the store to buy some stuff.; $bold=array(store,some,stuff); function boldWord($str,$bold) { if(isset($str)) { foreach($bold as $b) { echo $b

[PHP] Re: marking words bold

2005-05-11 Thread AC
Merlin wrote: Hi there, I am trying to mark words inside a sentence bold. Problem is, if there is an overlap it does not work anymore. I am using this code: $t = str_replace($word, b$word/b, $text); For eample: Mark those words bold: adventure in singapore Text: My adventure flying to singapore

Re: [PHP] Generating a php file

2005-05-11 Thread Dan Rossi
On 12/05/2005, at 6:03 AM, Rory Browne wrote: You can start by clarifying. I had to read your message three times before I got a vague understanding. What I'm hearing is that you want to put something like ?php $msg = get_message(); ? into a string? You are having difficulty doing this because you

Re: [PHP] expand array into function arguments?

2005-05-11 Thread Richard Lynch
On Wed, May 11, 2005 12:13 pm, Christopher J. Bottaro said: You can do this in Python: code def myFunc(arg1, arg2, arg): #do something myList = [1, arg, 5] myFunc(*myList) # calls myFunc(1, arg, 2) code Can that be done in PHP, and if so, how? You mean call a user function with an

Re: [PHP] Saving of buffers, from a security standpoint

2005-05-11 Thread Richard Lynch
On Wed, May 11, 2005 10:02 am, Colin Ross said: I am working on a bit of code for credit-card processing, so please keep in mind, security of the data is essential.. On part of it i wish to use a buffer, but i wonder if that data is saved anywhere on the running system (as a temp file, etc),

[PHP] Generating a php file

2005-05-11 Thread Rory Browne
Sorry forgot to cc to the list - again I'm still not sure I understand, although I'm getting there. This might be useful. $dynamicly_generated_script = ?php \$buffer = \$_SERVER['QUERY_STRING']; \$somevar = '{$this-somevalue}'; ?; As might this: $dyn_gen_script = sprintf( '?php $buffer =

Re: [PHP] Saving of buffers, from a security standpoint

2005-05-11 Thread Colin Ross
at this point, I'm planning on (at least on production) turning off all error reporting, I am using PEAR::ErrorStack mainly for error handling, which I love using btw... all I'm trying to do is make sure that no information gets outputed from the script, even if some horrible error occurs, i

Re: [PHP] pointing to localhost from remote server

2005-05-11 Thread Richard Lynch
On Wed, May 11, 2005 6:56 am, George Pitcher said: I have a system running on my main server containg separate user and staff interfaces to the same MySQL databases. Part of my process involves spawning off pdf front covers to a local directory, grabbing files from an archive on a networked

RE: [PHP] protect your CSS files, and possibly other extenstionsas well...

2005-05-11 Thread Richard Lynch
On Wed, May 11, 2005 6:48 am, Mark Rees said: [major snippage] Just to re-iterate what I implied, somebody else said, and is still not, apparently, getting through... If a rip-off so-called webmaster wants your CSS and JS, what you have done isn't even gonna slow them down. Their browser *HAS*

Re: [PHP] MySql injections (related question)

2005-05-11 Thread -k.
I have a related question, many of you have suggested using addslashes on your variables to prevent SQL injections, but is it safer to use mysql_real_escape_string (or mysql_escape_string)? What is the benefit / cost of using mysql_real_escape_string rather than addslashes? When using Postgres i

[PHP] Re: expand array into function arguments?

2005-05-11 Thread Christopher J. Bottaro
Richard Lynch wrote: On Wed, May 11, 2005 12:13 pm, Christopher J. Bottaro said: You can do this in Python: code def myFunc(arg1, arg2, arg): #do something myList = [1, arg, 5] myFunc(*myList) # calls myFunc(1, arg, 2) code Can that be done in PHP, and if so, how? You mean call a

Re: [PHP] Re: A couple questions about templating

2005-05-11 Thread James Williams
Well, I made it work now, and I even got a cache built in there (kindof stupid though, I need to make it smarter.) I figured out to use the assign function to add the curly brackets, thank-you. I'll look into the file_*_contents() functions, thanks. On 5/11/05, Rory Browne [EMAIL PROTECTED]

Re: [PHP] Re: A couple questions about templating

2005-05-11 Thread James Williams
I took a look at those functions, and file_put_contents() is only php5... this needs to work w/ php4 so that's not an option. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Session Array using array_pop and array_unshift

2005-05-11 Thread Webmaster
Hello, I have an application that occasionally drops a session array element value. Data from the form... $_POST['firstName']; $_POST['lastName']; $_POST['phone']; $_POST['email']; $_POST['cell']; When the form is submitted, the POST variables are checked to make sure they each contain a value.

[PHP] Form handling

2005-05-11 Thread dan
Hello, all - I've been researching how to handle forms properly, and I think I figured out a way that might be beneficial for me to use. It is as follows: (index.php) session_start(); if (isset($_SESSION['step'])) { switch $_SESSION['step'] { case 1:

[PHP] PHP 5.0. Save classes in a session. Need help now

2005-05-11 Thread Oscar Andersson
Is it possibele to save a class in a session ex. $cl = new Class(); $SESSION['this_class'] = cl; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] MySql injections (related question)

2005-05-11 Thread Jason Wong
On Thursday 12 May 2005 06:30, -k. wrote: I have a related question, many of you have suggested using addslashes on your variables to prevent SQL injections, but is it safer to use mysql_real_escape_string (or mysql_escape_string)? What is the benefit / cost of using mysql_real_escape_string

Re: [PHP] Generating a php file

2005-05-11 Thread Dan Rossi
On 12/05/2005, at 8:01 AM, Rory Browne wrote: I'm still not sure I understand, although I'm getting there. This might be useful. $dynamicly_generated_script = ?php \$buffer = \$_SERVER['QUERY_STRING']; \$somevar = '{$this-somevalue}'; ?; As might this: $dyn_gen_script = sprintf( '?php $buffer =

Re: [PHP] Form handling

2005-05-11 Thread Richard Lynch
While this *CAN* work, and a lot of people like it, it tends to add a fair amount of cruft for not that much benefit, really... What do you GAIN having this big old switch statement? What data/processing is really really shared in all these steps? On Wed, May 11, 2005 4:57 pm, dan said: Hello,

Re: [PHP] PHP 5.0. Save classes in a session. Need help now

2005-05-11 Thread Dan Rossi
I've done this by serializing and unserializing the the object. Its been discussed however using shared memory, shm is a better way to do it ? Sadly sh doesnt compile as default. On 12/05/2005, at 10:19 AM, Oscar Andersson wrote: Is it possibele to save a class in a session ex. $cl = new

Re: [PHP] Session Array using array_pop and array_unshift

2005-05-11 Thread Richard Lynch
On Wed, May 11, 2005 4:46 pm, Webmaster said: I have an application that occasionally drops a session array element value. $_SESSION['userData'] = $userData; this to happen? Has anyone else experienced this sort of occasional anomaly? YES! Granted, in my case, it was a short-lived buglet

  1   2   >