Re: [PHP] '&' Sign in _GET Parameter

2003-08-22 Thread CPT John W. Holmes
From: "Pushpinder Singh Garcha" <[EMAIL PROTECTED]> > I am using an application where I retrieve user profile from a MySQL > DB using the Company Name . I pass the name of the company to the PHP > script as a '$_GET' parameter. e.g. when the name of the company is > 'IBM'. , the URL with the qu

Re: [PHP] Question for you guys and gals

2003-08-22 Thread CPT John W. Holmes
From: "Curt Zirzow" <[EMAIL PROTECTED]> > > Or cheat and use output buffering. > > IMO, thats an even more lazy way of doing it. I agree entirely. I hate even giving that option, but it is there. That's why I said he could "cheat" :) ---John Holmes... -- PHP General Mailing List (http://www.p

Re: [PHP] Question for you guys and gals

2003-08-22 Thread CPT John W. Holmes
From: "David Smith" <[EMAIL PROTECTED]> > I have a problem. I have all my functions (currently) set aside in one > file, and I just require_once that page for all of the other pages that > may need any of those functions. In those functions I have it setup to > echo the link to the CSS page for my

Re: [PHP] String parsing help

2003-08-20 Thread CPT John W. Holmes
From: "Jonatan Pugliese." <[EMAIL PROTECTED]> > From: "Matt Matijevich" <[EMAIL PROTECTED]> > > I have have a string that I need to split into 3 different variables: > > City,State, and Zip. Here is a couple examples of the strings I need to > > parse: > > > > ANCHORAGE AK 99507-6420 > > JUNEAU

Re: [PHP] Your details

2003-08-19 Thread John W. Holmes
[EMAIL PROTECTED] wrote: Please see the attached file for details. Did anyone's AV pick up a virus in this email? It went right through mine but obviously doesn't belong on this list. I just got the latest definitions from Norton, too... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/r

Re: [PHP] mysql output

2003-08-19 Thread John W. Holmes
Anthony Ritter wrote: I found the following and inserted it into my snippet for alternating backgoriund colors. However, I'm not sure I understand the logic. [snip] if ($alternate == "1") { $color = "#eaf3da"; $alternate = "2"; } else { $color = "#d5eae9"; $alternate = "1"; } It's just a long way

Re: [PHP] mysql output

2003-08-19 Thread John W. Holmes
Anthony Ritter wrote: You also asked a very, very common question, i.e. how to alternate colors in table rows... there are a ton of websites/tutorials out there that explain ways to do this. ---John Holmes... Apologies for the lengthy code. I've tried us

Re: [PHP] (^&*$*(^&*$% ensim web appliance

2003-08-19 Thread John W. Holmes
Dennis Gearon wrote: please cc me Anyone on a shared, name-based IP, ensim web appliance hosted website? Can you tell me how to set the freekin': php_value auto_prepend_file "/some_freekin_unknown_real_directory_path_to_HOME/my_paths/prepend.php" value in my .htaccess file? Heh... I went

Re: [PHP] mysql output

2003-08-19 Thread CPT John W. Holmes
From: "Curt Zirzow" <[EMAIL PROTECTED]> > * Thus wrote Anthony Ritter ([EMAIL PROTECTED]): > > The following code snippet outputs a table from a mySQL database. > > > > [snipped 255+ lines of code] > > That is way to much information, please be a brief in your code > that you post. You'll find y

Re: [PHP] deleting session variables

2003-08-19 Thread CPT John W. Holmes
From: "Tim Winters" <[EMAIL PROTECTED]> > So what does session_unset() do then? Ah, good catch. Use that instead of my second example. If register_globals is ON, it appears that session_unset() will take care of getting rid of the global variables made. ---John Holmes...

Re: [PHP] Not fair: REMOTE_HOST

2003-08-19 Thread CPT John W. Holmes
From: "John Taylor-Johnston" <[EMAIL PROTECTED]> > Aw gee, $_SERVER['REMOTE_HOST'] (only REMOTE_ADDR) does not exist in PHP? > Bummer. > Why is that? Probably to expensive to look up with every request. Look it up yourself. http://us2.php.net/manual/en/function.gethostbyaddr.php ---John Holmes

Re: [PHP] one out of four session variables lost

2003-08-19 Thread CPT John W. Holmes
From: "anders thoresson" <[EMAIL PROTECTED]> > > $_SESSION['uname'] = $_POST['uname']; > > $_SESSION['pwd'] = $_POST['pwd']; > > When the user first logs in I also adds two more session variables within > accesscontrol(): > > $_SESSION['editor'] = mysql_result($result,0,"u_editor"); > $_SESSIO

Re: [PHP] deleting session variables

2003-08-19 Thread CPT John W. Holmes
From: "Tim Winters" <[EMAIL PROTECTED]> > Is there a way to wipe out all previous session variables with one > command? With register_globals OFF: $_SESSION = array(); If register_globals is ON and you want to get rid of $val1, $val2, $val3, etc... then: foreach($_SESSION as $key => $value) { u

Re: [PHP] Iterative regular expression replacement

2003-08-19 Thread CPT John W. Holmes
From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]> > I'm looking to replace the 'nth' instance of an expression within a string. > > Example (very simple)- > > $string="My mom can beat up your mom and your mom's dog"; > $pattern="mom"; > $replacement="dad"; > > I want to be able to replace any particu

Re: [PHP] Iterative regular expression replacement

2003-08-19 Thread CPT John W. Holmes
From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]> > I'm looking to replace the 'nth' instance of an expression within a string. > > Example (very simple)- > > $string="My mom can beat up your mom and your mom's dog"; > $pattern="mom"; > $replacement="dad"; > > I want to be able to replace any parti

Re: [PHP] Stripping out and URL hacking characters from a URL

2003-08-19 Thread CPT John W. Holmes
From: "Matt Babineau" <[EMAIL PROTECTED]> > Does anyone have a function or something they have already written to > remove any URL hacking characters, mainly the single quote, but I'm > looking for a nice function to filter my _GET variables against. Gotta > protect the database...ya know :) Just

Re: [PHP] Q: How to get the value of a checkbox of which name without '[]'?

2003-08-18 Thread CPT John W. Holmes
- Original Message - From: "Frode" <[EMAIL PROTECTED]> [...snip...] Which means I can't modify the code above into PHP prefered style: [...snip...] > Why is this the preferred style, and where can I read more about it? I don't know about preferred style or not, but if you want P

Re: [PHP] Q: How to get the value of a checkbox of which name without '[]'?

2003-08-18 Thread CPT John W. Holmes
> Consider the following form in a HTML file: > > ... > > > > > ... > > Now I'm posting this form into a PHP script. The problem is I can't change > that HTML file. Which means I can't modify the code above into PHP prefered > style: > > > > ... > > So, how can I get the co

Re: [PHP] Problem with the post variables.

2003-08-18 Thread CPT John W. Holmes
Wow... don't do either of those. First of all, you can't use ini_set to affect the register global settings and you're using the $_POST/$_GET superglobals, which work regardless of your setting. So that's not the issue. Does the phpinfo() function product any output? What if you view the source of

Re: [PHP] getting value of item in list box.

2003-08-18 Thread CPT John W. Holmes
From: "Tim Winters" <[EMAIL PROTECTED]> > I have a PHP page which pulls a bunch of data from a mySQL DB. I have 2 > list boxes in a form. One is populated automatically by my PHP code. > But the second will be populated based on what is selected in the first. > > I don't know how to get out the

Re: [PHP] Fatal error: [] operator not supported for strings

2003-08-18 Thread John W. Holmes
Daniel wrote: hi, how do i solve this error? Fatal error: [] operator not supported for strings in /var/www/html/p.../magazin/cos.php on line 13 line 13 is this line: $_SESSION["id_produs"][]=$_POST["id_produs"]; no error when i run in local host , when i upload in server (with PHP 4.2.2) only

Re: [PHP] "Form Feeds" within a HTML table

2003-08-17 Thread John W. Holmes
Todd Cary wrote: I am creating a "report" that the user can download and it is a HTML table. Is there a way to put Page Breaks within the report so if the user prints it, it will page break a predefined places? Use CSS. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3

Re: [PHP] DATE insertion

2003-08-17 Thread John W. Holmes
Cesar Aracena wrote: Hi all, First of all, thanks to everyone who helped me with the "checkbox" issue. I have an issue here while trying to INSERT INTO a MySQL table a date in a DATE format (-MM-DD). Obviously saying date(Y,m,d) doesn't work. What PHP function should I use? date('Ymd') to put

Re: [PHP] indexing a folder

2003-08-17 Thread John W. Holmes
Cadish wrote: Thanks, but is this also possible for directories not on my server? Or can i just use these functions? Missed that bit, sorry. If the directory is not on your server, then you need to go through FTP. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP

Re: [PHP] substr ?

2003-08-17 Thread John W. Holmes
John Taylor-Johnston wrote: Sorry, scrap that: if (substr_count($mystring,"¶") >0) John Taylor-Johnston wrote: How can I find out if $mystring includes the character "¶"? Thought substr would do it? J strpos() would be better... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/

Re: [PHP] Sessions

2003-08-17 Thread John W. Holmes
Peda wrote: Thank you all for your help. I solved the problem using session_save_path("/some/dir/") in php script. Just one thing to note: If you set the session save_path in your file using this method or ini_set, then there will not be any automatic garbage collection. You'll have to do that

Re: [PHP] indexing a folder

2003-08-17 Thread John W. Holmes
Cadish wrote: How can i index a folder that's not on my server? With indexing, i mean getting a list of all files in that folder... http://us2.php.net/manual/en/ref.dir.php -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professio

Re: [PHP] first time using exec() - are getting parse error.

2003-08-17 Thread John W. Holmes
anders thoresson wrote: Hi, I'm trying to call mysqldump from within a php-script, like this: $backuptime = date("ymdHi"); $backupfile = "un" . $backuptime . ".txt"; exec("mysqldump --opt -u$dbuser -p$dbpassword $dbdatabase $alltables > /web/un/backup/$backupfile"); It works fine on my local

Re: [PHP] call function as variable

2003-08-16 Thread John W. Holmes
adam wrote: Hi! I have folowing function which they are a member in a class. function foo(){ something } function zoo(){ something else } and i have a array such: $test = array(1=>foo,2=zoo); and i want to call the fuction foo() and zoo something like; $object->$test[1](); Try: {$object->$tes

Re: [PHP] HOW DO U SPLIT UP LARGE STRINGS?

2003-08-15 Thread John W. Holmes
John Ryan wrote: I've a string with a huge mySQL query, seperated by a semi-colon and then line-break. You can't run this query staright to mySQL (and i dont want to try), so Im trying to split up the query into, say, 100 mysql commands at a time. Is it possible to split up a string every 100 semi

Re: [PHP] mysql_num_rows

2003-08-15 Thread John W. Holmes
John Taylor-Johnston wrote: My question got buried on the bottom of the thread. Sorry for the repeat. I'm getting this message: Warning: Supplied argument is not a valid MySQL result resource in /.../testals.php on line 189 Read with me. Supplied argument ($news) is not a valid MySQL result reso

Re: [PHP] Checkboxes

2003-08-15 Thread CPT John W. Holmes
You could name them as: etc... Then $_POST['choice'] will be an array of the boxes chosen. $list = implode(',',$_POST['choice']); will give you a comma separated list of all items chosen. ---John Holmes... - Original Message - From: "Cesar Aracena" <[EMAIL PROTECTED]> To: <[EMAIL P

Re: [PHP] Category and sub-category logic

2003-08-15 Thread CPT John W. Holmes
From: "Richard Baskett" <[EMAIL PROTECTED]> > Wouldn¹t it just be easier to do a relationship table as in > > Personnel > emp ID parent > > 'Albert' 1 0 > 'Bert'2 1 > 'Chuck' 3 1 > 'Donna' 4 0 > 'Eddie' 5 4 > '

Re: [PHP] Acessing session vars

2003-08-15 Thread CPT John W. Holmes
From: "Ed Curtis" <[EMAIL PROTECTED]> > I just started using sessions and am having some trouble understanding how > to pull values out of sessions to use in another page. > > I set the values as: > > session_start(); > session_register{'magazine'); > session_register('company'); > > The data is s

Re: [PHP] PCRE regexp bug ?

2003-08-15 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]> > I use preg_match to validate the Middle Initial field of a form and so far > it works, except yesterday a user submitted a "0" (zero) as a middle > initial! My regexp is: > > if (!empty($_POST[MI]) && (preg_match('/^[[:alpha:]]{1,1}$/', $_POST[MI]) == 0)) > > I tested

Re: [PHP] Category and sub-category logic

2003-08-15 Thread CPT John W. Holmes
From: "Mark" <[EMAIL PROTECTED]> > I'm trying to get a handle on this algorithm as well. If you add > additional children to a parent record, doesn't that require > renumbering all the rgt and lft values in the lineage? For example > (table shamelessly stolen from a website): > > Personnel > emp

Re: [PHP] Re: regex problem

2003-08-15 Thread John W. Holmes
John W. Holmes wrote: Merlin wrote: ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? Are you making this too hard? if($string = 'test/contact

Re: [PHP] Re: regex problem

2003-08-15 Thread John W. Holmes
Merlin wrote: ^\/test\/contact.html$ does not work. I am sorry, I just found that it has to be: test/contact.html and not dir/test/contact.html there is no leading slash. Do you have any other suggestion? Are you making this too hard? if($string = 'test/contact.html') { echo 'good'; } else {

Re: [PHP] Re: why doesn't default values for this function work

2003-08-14 Thread CPT John W. Holmes
From: "anders thoresson" <[EMAIL PROTECTED]> > I want the $max_length to be optional. With your solution it isn't? I > thought I could make it optional by assigning a default value of -1, which > would tell the function not to bother with max_length and continue the > execution. > > All in all my

Re: [PHP] setting function variables

2003-08-14 Thread CPT John W. Holmes
From: "Mark" <[EMAIL PROTECTED]> > --- Micah Montoy <[EMAIL PROTECTED]> wrote: > > I am trying to specify a single php file to contain all the > > variables and I > > just call this file where necessary. What I am running into is > > that I want > > to do this for all the built in functions (i.e.

Re: [PHP] trying to match the front and end...

2003-08-14 Thread John W. Holmes
Dan Joseph wrote: Sometimes there won't be anything to replace at the front, and sometimes nothing at the end. So it'd still need to do the front and/or end wether or not they both exist. Is there a way to tweak these to do that? Question: Where is this number coming from? Couldn't you j

Re: [PHP] Problem sortiing dyn query

2003-08-14 Thread John W. Holmes
Creative Solutions New Media wrote: Hi Can someone give me some indication why this might not be working? $query_Recordset1 = sprintf("SELECT * FROM sti_tracking ORDER BY '%s' '%s'", $query_Recordset1 = sprintf("SELECT * FROM sti_tracking ORDER BY %s %s", $reSort_Recordset1,$direction_Recordset1

Re: [PHP] Generate Dates

2003-08-14 Thread John W. Holmes
Ralph Guzman wrote: I have to generate a menu for all months in a year, with each month broken down into two periods. For example: January 01-15 January 15-31 February 01-15 February 15-28 March 01-15 March 15-31 Etc... How can generate a list of all 12 months using the above format? Well, seeing a

Re: [PHP] trying to match the front and end...

2003-08-14 Thread John W. Holmes
Dan Joseph wrote: From John: $new_number = preg_replace('/^'.$this->start_num.'([0-9]+)'.$this->end_num.'$/', '\\1',$old _number); The one that Mike gave didn't seem to do anything, John's will work if it can match the beginning and the end successfully. I should probably explain myself

Re: [PHP] config tests

2003-08-14 Thread John W. Holmes
Uros Gruber wrote: Hello! I just made some speed tests getting configuration from DB. For now I figured 2 ways doing this. 1. One value in each row id | name| val -- 1| name1 | value1 2. using serialize($config) and saving this in one row. $confi

Re: [PHP] Reformatting phone number string from user input

2003-08-14 Thread John W. Holmes
Verdon vaillancourt wrote: I haven't completely decided if it's better to store 1234567890 and format it on retrieval or to format it first and store 123-456-7890. I guess unless I plan to do math or something with the raw data later (not too likely for a phone number), it probably doesn't make muc

Re: [PHP] POST/GET - if there is a dot in the name it's changes to "_"

2003-08-14 Thread CPT John W. Holmes
From: "Arnau Rebassa" <[EMAIL PROTECTED]> > I'm having the same problem as the bug report > http://bugs.php.net/bug.php?id=7987. They say that's not a bug it's a > feature... Anybody knows where I can find which characters are changed and > by which character? Spaces are also converted to unders

Re: [PHP] PHP Counter on HTML Page

2003-08-14 Thread John W. Holmes
PHPSpooky wrote: Astrum Et Securis! I don't want to use iFrames.. is there any other way? I want to use my own php counter with lil information.. which updates the database on page load incrementing the counter and catching the few Server Variables.. and just display the Hits on that page. Howe

Re: [PHP] Parsing problem with character '>'

2003-08-14 Thread CPT John W. Holmes
From: "FMM Schillemans" <[EMAIL PROTECTED]> > I've installed a Win32 package with in it Apache, PHP en MySQL version. > > the problem is that the moment the '>' character is placed within the PHP > code (lets say withing a print-command), then the PHP mode is immideatly > ends. Making it impossible

Re: [PHP] string concatenation from array

2003-08-14 Thread CPT John W. Holmes
From: "Jonathan Pitcher" <[EMAIL PROTECTED]> > The & sign in PHP (to the best of my knowledge) does not concatenate. Correct, it's a bitwise AND operator. http://us2.php.net/manual/en/language.operators.bitwise.php ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubsc

Re: [PHP] trying to match the front and end...

2003-08-14 Thread CPT John W. Holmes
From: "Dan Joseph" <[EMAIL PROTECTED]> > I've searched the high heavens for a method of doing this... Here's what > I'm doing... First, the code.. > > $middlenum = preg_replace("/^".$this->start_num."/", "", > $this->ach_acct_num); > $middlenum = preg_replace("/".$this->end_num."$/", "", $middlenu

Re: [PHP] image button problem

2003-08-14 Thread CPT John W. Holmes
From: "Abdul-wahid Paterson" <[EMAIL PROTECTED]> >> What do you mean you don't know what button was pressed? You have 'test_x' >> and 'test_y' so you know the "test" button was pressed. If you give the >> other buttons a different name, you'll have different _x and _y variable >> names, so you can

Re: [PHP] Session does not end when browser is closed.

2003-08-14 Thread CPT John W. Holmes
From: "Lee Hanxue" <[EMAIL PROTECTED]> > I am using $_SESSION and each php page has session_start() Session > Handling is working fine, except for one problem: when I close my > browser and re-open it again, I am still logged in. > > I tested the log in and log out functions and they work fine. >

Re: [PHP] Mail

2003-08-14 Thread John W. Holmes
Sean wrote: I cannot get mail() to work any idea's I get a server error. Windows 2000 the SMTP port is 25. No default values have being changed from the original PHP installation. In it's simplest form mail("[EMAIL PROTECTED]", "My Subject", "Test"); Gives the error as do more complicated scripts

Re: [PHP] Quick question - Warnings

2003-08-14 Thread CPT John W. Holmes
From: "Ryan A" <[EMAIL PROTECTED]> > I know how to suppress warnings in my file locally but i want to suppress > warnings and notices in one whole directory using a .htaccess, i cant seem > to find my old file that does that, can someone refresh my memory please? > > This is how i do it in my local

Re: [PHP] Newbie Session Question

2003-08-14 Thread CPT John W. Holmes
From: "Tim Winters" <[EMAIL PROTECTED]> > Normally to start a session one would use session_start(); > > Is there a different command to do this if you're instead using the > $http_session_vars type coding? No, and it's $HTTP_SESSION_VARS. PHP is case sensitive, remember? ---John Holmes... --

Re: [PHP] dev style guide

2003-08-14 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]> > Just a remark but isn't it pointless to use Hungariannotation in a > language that is by default typeless??? I would think that it would be the reason why you WOULD want to use Hungarian notation (not that I do, though). Even though you can take nVar and concatinate it

Re: [PHP] Array to List

2003-08-14 Thread CPT John W. Holmes
From: "James Johnson" <[EMAIL PROTECTED]> > Actually, I'm using $campusList for a SQL statement: > > SELECT name FROM campuses WHERE inst_id IN ('$campusList'); > > It wasn't working until I found out that $campusList needs to look like > '1','2','3'. > > $campusList = implode( ', ', $_POST['campu

Re: [PHP] Question on class syntax

2003-08-14 Thread CPT John W. Holmes
From: "Luis Lebron" <[EMAIL PROTECTED]> > I am currently using a php class that uses the following syntax: > > $value= htmlcleaner::cleanup($value); > > > What exactly is the :: used for? Is there a different syntax for :: ? You're calling the cleanup() method of the "htmlcleaner" class. You coul

Re: [PHP] HELP about pull hair on this INSERT

2003-08-14 Thread John W. Holmes
Didier McGillis wrote: # MESSAGE: INSERT INTO group (id, bmenu, tmenu, parent, name, desc, g_desc, sort_order, status, image, mb, calendar) VALUES ('', '1', '1', '0', 'FBC Administrator', 'fdhsjfds jfdash', 'jhfdjs fjdsahfjksda hfjdsha

Re: [PHP] mysql_error() problem?

2003-08-14 Thread CPT John W. Holmes
From: "Tyler Longren" <[EMAIL PROTECTED]> > I'm running an UPDATE query on my table. After executing the query, I check > mysql_error() to see if there's any errors: > if (mysql_error() == "") { > // success > } > else { > // failure > } > > mysql_error() is always empty even if the query

Re: [PHP] Adding days to a date

2003-08-14 Thread CPT John W. Holmes
From: "Donpro" <[EMAIL PROTECTED]> > I have a piece of code like so: > > $today =- getdate(); > > I am looking for a function that will add a variable number of days and > return a valid date, i.e., the array elements for "mday", "mon" and "year" > are reset as needed. Is this possible? $tomorrow

Re: [PHP] Stop neurotic posting

2003-08-14 Thread CPT John W. Holmes
From: "Gabriel Guzman" <[EMAIL PROTECTED]> > On Wed, 2003-08-06 at 11:44, Chris W. Parker wrote: > > > A bad answer would be: > > > > "RTFM http://php.net/preg_match"; > > > > A good answer would be: > > > > "That can be done with a regular expression. The function you're looking > > for is called

Re: [PHP] getting images?? Help!!

2003-08-14 Thread John W. Holmes
Micah Montoy wrote: I have created a little image manager. Mainly for personal usage but I have a few friends that would like it as well. Anyway, the problem that I've run into is that I can only select one file at a time using the form attribute that I want to upload. Does anyone know of a way

Re: [PHP] what is %s %d

2003-08-14 Thread CPT John W. Holmes
From: "Jackson Miller" <[EMAIL PROTECTED]> > They are codes for date formatting. > > Specifically: > %s represents seconds with leading zeros. > %d represents day of the month with leading zeros > > so > date("%s %d",mktime()); > would equal something like > 59 08 Actually you'd get: %59 %08 b

Re: [PHP] trying to match the front and end...

2003-08-14 Thread John W. Holmes
Dan Joseph wrote: Question: Where is this number coming from? Couldn't you just use a substr() based upon it's length and not deal with a regular expression? Its a bank account number coming from a database. We're reformatting it for ACH processing. The number could be: 23408234980423

Re: [PHP] image button problem

2003-08-14 Thread CPT John W. Holmes
From: "Abdul-wahid Paterson" <[EMAIL PROTECTED]> > I am trying to create an HTML form that has several image buttons on it > and the resulting action depends on which button is pressed. > > I first tried using but from > IE on the PHP side I only get $_POST['test_x'] and $_POST['test_y'] > defined

Re: [PHP] problem looping through records

2003-08-14 Thread John W. Holmes
Huzz wrote: I have a sql statement which brings about 15 records... inside the while loop i am trying to get data from another table by passing an id, the problem is i am only getting the first record .. not the whole 15 records.. any suggestion?? function list_ss_cats(){ global $db; $sql = "SELEC

Re: [PHP] bug in code - can't find it!

2003-08-14 Thread John W. Holmes
AciD wrote: just a little point; u can replace by which is better imho. and you're entitled to it, but it's not better. Shorter isn't always better. Your code will break if enable_short_open_tags is disabled in php.ini or an .htaccess file. Sure, it's on by default, but some people turn it of

Re: [PHP] PHP vs ASP.NET "formal opinions" request

2003-08-14 Thread John W. Holmes
John Manko wrote: I hate to be the one to break it to you but this isn't the real world. It's a senior project, and he has a chance to justify the reason to do a project in the language he see's fit, not what the political machine wants. I just don't buy the "don't go against the tide" mental

Re: [PHP] callback function in class

2003-08-14 Thread John W. Holmes
Evan Nemerson wrote: Basic problem: I need to use preg_replace_callback, and would like the callback parameter to be a function in a class (the same as that which contains the call to preg_replace_callback). "classname::function" doesn't seem to work... Anyone have any ideas? Besides create_fun

Re: [PHP] greedy preg

2003-08-14 Thread John W. Holmes
skate wrote: $contents = preg_replace( "|.*?$file.*?|si", "", $contents ); it's being run on an XML file, where each entry is .. with a $file pointer in there. it works okay, except for the fact that it deletes that record, and every record before it. i can't figure out why it's being greed

Re: [PHP] greedy preg

2003-08-14 Thread CPT John W. Holmes
From: "skate" <[EMAIL PROTECTED]> > $contents = preg_replace( "|.*?".$file.".*?|si", "", > $contents ); > > okay, so i figured out that it's matching the first occurence of > which will always be the first record and then going on to match the $file > and deleting everything between. obviously not

Re: [PHP] Sum a column of values from a MySQL query

2003-08-14 Thread CPT John W. Holmes
Sorry, Jay, but that's a horrible method. You could just run one query with a GROUP BY clause to get the sum for each invoiceID, instead of running multiple queries like you've mentioned... $query = "SELECT invoiceid, SUM(partpaidamount) AS partpaid FROM $tb_name GROUP BY invoiceid"; $rs = mysql_q

Re: [PHP] Installer Software

2003-08-14 Thread John W. Holmes
Joe Harman wrote: I am making an application in PHP, but I want it to run on a user's local computer... but I need to find someway to bundle this so that when it is distributed, the installer installs PHP for windows... then copys the PHP files to the correct directory, then puts a short cut on th

Re: [PHP] mail() usage in for loops

2003-08-14 Thread John W. Holmes
Mohanaraj wrote: What would be the best way to handle this ? Go get a program that's made to send out emails like this. Odds are it'll be faster and less of a strain on your server. PHP is great, but there are other solutions out there. My $0.02, of course. :) -- ---John Holmes... Amazon Wishl

Re: [PHP] PHP Session Problem!.....urgent!

2003-08-14 Thread CPT John W. Holmes
From: <[EMAIL PROTECTED]> > Dear Sir, You don't have to call me that unless you're in the military, also. :) > I've been using PHP for business and personal use for a while now, and I > have to admit, I'm not just a user anymore and I am a fan. but it's been a > while I came across a problem : I

Re: [PHP] Config files

2003-08-14 Thread CPT John W. Holmes
From: "Hardik Doshi" <[EMAIL PROTECTED]> > I have following options for working with the > configuration files with the relatively large web > application. > > 1. Configuration variables using the DEFINE. > > 2. Array - Each configuration variable as an array > element. > > 3. PHP.INI like config f

Re: [PHP] Validate The Last Day of Month with server's clock????

2003-08-14 Thread CPT John W. Holmes
From: "Nicholas Robinson" <[EMAIL PROTECTED]> > The 'usual' trick is to set the date to the first day of the month after the > one you want and then subtract one day. Along those same lines, this works: ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, vis

Re: [PHP] where are my errors?

2003-08-11 Thread John W. Holmes
David T-G wrote: Hi, all -- My partner and I have done something that gets rid of our error messages, and we're not quite sure what. The identical code base (I copied it over myself; I'm sure) worked "fine" on another supposedly-identical RH Linux machine. is display_errors ON for one machine an

Re: [PHP] PDF Thumbnail with PHP?

2003-08-11 Thread John W. Holmes
Anthony wrote: Unfortunatly, that's not what I'm trying to do. That function will add an image to a PDF file as a thumbnail. What I want to do, is read a PDF file, and generate a thumbnail in the form of a gif or jpg and have it display in the browser. Thanks for the thought though. What about

Re: [PHP] Filling a text field

2003-08-11 Thread John W. Holmes
bob pilly wrote: Is there anyway in php to fill a HTMl text input field with a php variable? Or do i have to use javascript? Like this: -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals – www.phparch.com -- PHP Gene

Re: [PHP] HELP strip slashes ???

2003-08-11 Thread John W. Holmes
Didier McGillis wrote: Everyone, I am doing an admin site for a person and their small site. I need to allow them to put in paragraphs of information. I am allowing them to put in some HTML like , , a very limited amout of tags. What is the best way to submit and then show this information

Re: [PHP] Why Redirection works on 1 machine but not on another

2003-08-11 Thread John W. Holmes
Ow Mun Heng wrote: Hi, I have this peculiar problem, my header header( "Refresh:2;url=$g_prog_path/$l_refresh_url" ); is set up correctly to be the FULL pathname. It works on some PC but now on some others. I'm using IE on win98/2000. The offending one is IE6 (128bit) on Win98. (IE5.5/win98 wo

Re: [PHP] Stop neurotic posting

2003-08-10 Thread CPT John W. Holmes
Honestly, if you people ignored the stupid responses as much as you want us to ignore the stupid questions... we wouldn't be having this "discussion". ---John Holmes... - Original Message - From: "Nicholas Robinson" <[EMAIL PROTECTED]> To: "andu" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>

Re: [PHP] how do i get assosciative name in foreach

2003-08-10 Thread CPT John W. Holmes
From: "Dan Anderson" <[EMAIL PROTECTED]> > I want to do: > > > $array['element1'] = 'element1'; > $array['element2'] = 'element2'; > > foreach ($array as $element) > { > // assuming get_assoc gets the assosciative name > if (get_assoc($element) == 'element1') > {get_assoc($element) do_s

Re: [PHP] Reformatting phone number string from user input

2003-08-10 Thread John W. Holmes
Verdon vaillancourt wrote: Hi :) I've been working on reformatting a phone number string from user input via a form field. Ultimately, my goal is to format all phone numbers in the same way regardless of whether a user inputs '(123) 456-7890', '123-456-7890', '123.456.7890', etc. before I insert

Re: [PHP] htmlspecialchars() and HTML code

2003-08-10 Thread CPT John W. Holmes
From: "Thaddeus J. Quintin" <[EMAIL PROTECTED]> > I'm working on a site where users have the option to type HTML code into > a textarea, or upload HTML code from a local file which is then > displayed in the text area. > > The obvious problem is that an uploaded file that contains a closing tag > f

Re: [PHP] htmlspecialchars() and HTML code

2003-08-09 Thread John W. Holmes
Thaddeus J. Quintin wrote: CPT John W. Holmes wrote: > Try this: > > This is <some> text > > If you submit that "text" and then print $_REQUEST['text'], you'll see that > you have > > This is text Ok, but that only make

Re: [PHP] setting function variables

2003-08-09 Thread CPT John W. Holmes
From: "Mark" <[EMAIL PROTECTED]> > I seem to learn something new every time you or Jennifer post (many > others as well). I never knew about variable functions. Cool! You're welcome. I wouldn't recommend that solution exactly (an abstraction class would be better), but the functions do come in han

Re: [PHP] Problem sortiing dyn query

2003-08-08 Thread John W. Holmes
Creative Solutions New Media wrote: Just wanted to make sure we were on the same page as the line of code in question wrapped in my original message. You saying the solution is $query_Recordset1 = sprintf("SELECT * FROM sti_tracking ORDER BY %s %s",$reSort_Recordset1,$direction_Recordset1); Correc

Re: [PHP] Problem sortiing dyn query

2003-08-08 Thread John W. Holmes
Mark wrote: $query_Recordset1 = sprintf("SELECT * FROM sti_tracking ORDER BY %s %s",$reSort_Recordset1,$direction_Recordset1); I'm curious. Is there an advantage to using the above format, rather than $query_Recordset1 = "SELECT * FROM sti_tracking ORDER BY $reSort_Recordset1 $direction_Record

Re: [PHP] Edit a page in PHP

2003-08-08 Thread John W. Holmes
Jeremy Darling wrote: This is driving me nuts. I know it can be done, cuz I've seen it done before, but I can't figure it out. I would like to have a php file that allows me to edit an HTML/PHP file thru my browser. Currently I have something that looks like: print htmlentities($contents); ?>

[PHP] Re: [PHP-DB] Sorting issue

2003-08-08 Thread CPT John W. Holmes
"Jeff" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why would a mysql db think that 55 was greater than 14000. > > I have several headings that display sql data under them, when you click on > the heading, it sorts that section (descending/ascending), but it only seems > to be look

Re: [PHP] Downloding files once

2003-08-07 Thread CPT John W. Holmes
From: "Boaz Yahav" <[EMAIL PROTECTED]> > > Can you fake a referrer by say, using fsockopen() and sending your > own headers? Yep. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Hitler and Recent Threads

2003-08-07 Thread CPT John W. Holmes
From: "Mark" <[EMAIL PROTECTED]> > > And as they say, "Never argue with a fool. People will > not be able to tell the differnce." I thought it was "Never argue with an idiot. They drag you down to their level and beat you with experience" :) ---John Holmes... -- PHP General Mailing List (http

Re: [PHP] Correct Coding

2003-08-07 Thread CPT John W. Holmes
From: "Martin Peck" <[EMAIL PROTECTED]> > > > That can generate an error if $Task was never assigned a value. > > > > > > > could you not do > > > > if(@$Task == "Add" ){do something } > > > > to suppress the error of the variable not being set? > > I have never seen php give an error if $Task is n

Re: [PHP] error: cannot redeclare ()

2003-08-07 Thread CPT John W. Holmes
From: "Martin Towell" <[EMAIL PROTECTED]> > I'm getting the following error: > > PHP Fatal error: Cannot redeclare () (previously declared in > /path/to/file/functions.inc:19) in /path/to/file/functions.inc on line 0 > > Anyone have any ideas how a no-name function could be generated? > Line 19 co

Re: [PHP] Parse error not understood

2003-08-07 Thread CPT John W. Holmes
From: "Chris Blake" <[EMAIL PROTECTED]> [snip] > //If "Delete User" is selected-- > if ( $_REQUEST['useroption'] == 'delete') > { [snip] > No matter which option I select I get the following output : > -- > Parse error: parse error, unexpected $ in > /var/www/html/Sessions/userman.php o

Re: [PHP] greedy preg

2003-08-07 Thread John W. Holmes
skate wrote: What are the possible values of $file? Are you looking to replace just a specific occurance of a $file between tags? Maybe this will help: $contents = preg_replace("|[^<]*$file[^<]*|si","",$contents); or just use the 'U' modifier for "ungreedy"... i'm looking to replace the entir

<    6   7   8   9   10   11   12   13   14   15   >