Re: [PHP] reverse lookup/domain lookup in PHP

2003-09-11 Thread CPT John W. Holmes
From: Tim Baker [EMAIL PROTECTED] Is it possible to reverse lookup (like here http://www.whatismyipaddress.com/reverse.asp) to find the domain with PHP? I assume a DNS lookup requires an external server somewhere? That's be great if there was a PHP function to do this, something like

Re: [PHP] Mysql Authentication problem

2003-09-11 Thread CPT John W. Holmes
From: James Hamilton [EMAIL PROTECTED] current testing code: $link = mysql_connect(localhost, user, pass ) or die(Could not connect : . mysql_error()); print Connected successfully; mysql_select_db(name) or die(Could not select database); print connected; with user = null

Re: [PHP] reverse lookup/domain lookup in PHP

2003-09-11 Thread CPT John W. Holmes
From: Tim Baker [EMAIL PROTECTED] Expensive? In server/processor time, money or bandwidth (doubt the latter?) server/processor time. It can take a while to get a response. Same as doing it from command line. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe,

Re: [PHP] New Session Ids generated with each page request

2003-09-11 Thread CPT John W. Holmes
From: Golawala, Moiz M (IndSys, GE Interlogix) [EMAIL PROTECTED] My problem is that I get a new Session Id with every request I send to the server. For that reason I am unable to share variables between pages using sessions. (I get a new session Id even I refresh the same page). The code

Re: [PHP] Mailing List Programme

2003-09-11 Thread CPT John W. Holmes
From: Sheni R. Meledath [EMAIL PROTECTED] Many thanks for the details. Now the problem is Flush() is not working on my server (UNIX/Apache 1.3). Are there any issues with Unix servers. The page displays the title and then waits for teh complete script to execute. I am using IE 6.0 to browse

Re: [PHP] Problem with HTML Text box and PHP variable.

2003-09-11 Thread CPT John W. Holmes
From: murugesan [EMAIL PROTECTED] This will help you ?php $dins=Dinesh; echo input type=text name=dins class='textbox' value='$dins' ; ? Use double quotes for HTML attributes. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] some kind of redirection (not the header function)

2003-09-11 Thread CPT John W. Holmes
From: Juan Nin [EMAIL PROTECTED] The beheaviour I want to acomplish is the same as in yahoorgoups. You can access a mian page, where you login and have a list of all the groups you are subscribe to. You click on the link to each one and it redirects you to:

Re: [PHP] rename()

2003-09-11 Thread CPT John W. Holmes
From: Edward Peloke [EMAIL PROTECTED] This is probably an easy question Yep.. ;) I have an uploaded image in a temp file that I want to rename and put in another folder. I am using rename() which works fine, the problem is, I want to force an overwrite if the file already exists. [snip]

Re: [PHP] storing quotes into a variable

2003-09-11 Thread John W. Holmes
Doug Parker wrote: isn't there a function that allows me to store a string with a bunch of quotes in it (like an html tag) into a variable? for example, i need something like: $perf_mod = a href=# onclick=popWindow('popup.php')

Re: [PHP] Problem with HTML Text box and PHP variable.

2003-09-11 Thread John W. Holmes
Jim Lucas wrote: ?php $dins=Dinesh; echo input type=text name=dins class='textbox' value='$dins' ; ? Use double quotes for HTML attributes. Why do you say that? Yeah, I figured someone would ask that. :) I couldn't find anything definitive on w3c.org; can someone back me up? AFAIK, they are

Re: [PHP] Problem with HTML Text box and PHP variable.

2003-09-11 Thread John W. Holmes
Vail, Warren wrote: Question: will the substitution for the variable $dins occur if surrounded by single quotes? I could be mixing languages here, but I seem to recall a rule in one language about substituting variable contents only occurring between double quotes. In PHP, no, variables will

Re: [PHP] Searching with Date Ranges

2003-09-11 Thread John W. Holmes
Seth Willits wrote: If I want to show events (records in a MySQL table) for the next 10 days (and I do), what would be the best approach to searching with this range? (The dates in my table are stored as a string in the format /MM/DD.) SELECT * FROM Table WHERE event_date BETWEEN NOW()

Re: [PHP] Session Variables in a Class

2003-09-10 Thread CPT John W. Holmes
From: micro brew [EMAIL PROTECTED] Here's my class. I start the session in the constructor and in later methods attempt to register session variables. You can see I've tried a couple different methods but none of them maintain the session variable values. Any suggestions? Is

Re: [PHP] divide

2003-09-10 Thread CPT John W. Holmes
From: phpu [EMAIL PROTECTED] I'm new in php and i've got allready a problem. I wanna divide 2 numbers and the result to be an integer separated by comma. For example: $number1=1000; $number2=17; $result=$number1 / $number2; In this case the result is 588235.29411764 And I wanna the

Re: [PHP] How to access a program outside of PHP?

2003-09-10 Thread CPT John W. Holmes
From: Adam Douglas [EMAIL PROTECTED] Hi. I'm trying to develop a web interface to the ghostscript (gs) application. I have the ghostscript syntax down perfectly in the console. Now when I go to try and do it in PHP I get nothing. No errors, nothing just a blank page with PHP logs turned on

Re: [PHP] Can't use strtotime for dates before 1970. Why not??

2003-09-10 Thread CPT John W. Holmes
From: Free Grafton [EMAIL PROTECTED] We provide a MySQL, PHP solution to customers. One of the fields that we store for the customers are birthdates. We just recently upgraded from Red Hat 7.1 to Red Hat 9.0 and now have realized that at version 7.3 they changed it where strtotime no longer

Re: [PHP] Session Variables in a Class

2003-09-09 Thread CPT John W. Holmes
From: micro brew [EMAIL PROTECTED] I've been experimenting with sessions. I can make them work just fine in a normal PHP page. But when I create a class and try to define a session variable within a method in the class it won't work. I've tried setting the session variable directly

Re: [PHP] Multiple image buttons

2003-09-09 Thread CPT John W. Holmes
From: Hardik Doshi [EMAIL PROTECTED] I have a page on which there are multiple image buttons. Is there any way to determine which button is pressed by the user? For example, there is a page on which i display all the users of the system with the edit and delete button beside each user

Re: [PHP] php, denial of service attack

2003-09-08 Thread John W. Holmes
nabil wrote: I have a postnuke website and i had denial of service attack the point is the attack is one only the home php page ... with cpu 100% and few apache procceses.. Any comment ? It was not me. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect:

Re: [PHP] Form data

2003-09-08 Thread CPT John W. Holmes
From: Hardik Doshi [EMAIL PROTECTED] I have a form for adding a university course details. It has some fields for which the parent form calls the child form. For example: Each course is associated with at least one faculty member. So when the user enters faculty member then first user needs

Re: [PHP] Creating a Calender

2003-09-08 Thread CPT John W. Holmes
From: Dan Anderson [EMAIL PROTECTED] Does anybody know how to generate calendars easily? (i.e. print out complete calenders from the current month on) I'd check out PEAR or phpclasses.org. I'm sure something is already written, but I don't know of any personally. ---John Holmes... -- PHP

Re: [PHP] adodb and php5

2003-09-08 Thread CPT John W. Holmes
From: Gilberto Garcia Jr. [EMAIL PROTECTED] Does anyone had tested ADODB with php5? I can make a query, print the recordcount but when i try to show the result i got nothing while (!$qry-EOF) { echo $qry-fields['campo'] . br; $qry-MoveNext(); } You might want to ask on the adodb forums:

Re: [PHP] this code unsets $_SESSION['editor'] but doesn't touch any other session variables

2003-09-07 Thread John W. Holmes
anders thoresson wrote: Hi, I've had troubles with an application that randomly (until now) unsets the session variable $_SESSION['editor']. I've hunted through all my code and finally managed to rule out everything else than the following couple of lines. It unsets the session variable

Re: [PHP] Re: highlighting multi term search results

2003-09-07 Thread John W. Holmes
[EMAIL PROTECTED] wrote: Am Sonntag, 07.09.03 um 14:11 Uhr schrieb Catalin Trifu output: this is just a bte/bst (after the first term is highlighted the second one can't be found anymore.) but how to work around it?? Highlight the longest words first? -- ---John Holmes... Amazon Wishlist:

Re: [PHP] Date Confusion

2003-09-07 Thread John W. Holmes
Seth Willits wrote: 2) Have a date string representing the first of the month and manipulate it to be the last day of the previous month. You can use mktime() for this. To get the last day of a given month, just give the parameters for the zeroth day of the next month. For example, to get the

Re: [PHP] Function calling from url

2003-09-06 Thread John W. Holmes
Robin Kopetzky wrote: I would like to call a function from a FORM's ACTION attribute. This is what I'm trying to do: FORM ACTION=www.example.com/PHP_FILENAME/function_name?parameter1=xparameter2=y etc... I can include the PHP_FILENAME but passing parameters to the function I can't figure out how

Re: [PHP] Unregistering several variables at once -- how?

2003-09-06 Thread John W. Holmes
James Johnson wrote: Hi, I have 15 - 20 $_SESSION vars that I want to clear when a user logs out. I've been doing it with the following code: if(session_is_registered($_SESSION['svUserID'])){ session_unregister($_SESSION['svUserID']); } But, this is tedious. Is there a better way, like

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread CPT John W. Holmes
From: Dan Anderson [EMAIL PROTECTED] But how much overhead is there in: $link = mysql_connect($hostname,$username,$password) or die(); $db = mysql_select_db($database,$link) or die(); Would it be beneficial to run a single one at the beginning of every script? Currently I have a bunch of

Re: [PHP] mysql Pattern Matching

2003-09-05 Thread CPT John W. Holmes
From: Ralph Guzman [EMAIL PROTECTED] Is there an advantage or difference in running FIND_IN_SET() instead of LIKE? Actually no, I guess there isn't. Neither one will use an index. mysql desc test; +---+-+--+-+-+---+ | Field | Type| Null | Key |

Re: [PHP] mySQL overhead: Tweaking Scripts for Speed

2003-09-05 Thread CPT John W. Holmes
From: Dan Anderson [EMAIL PROTECTED] While multiple connections will just return the first connection, anyhow, why do the extra work, right? Yes that was what I was thinking. But I was also thinking that I would need to global the $link and $db variables and run mysql_query() with them

Re: [PHP] using fwrite to create PHP files

2003-09-05 Thread John W. Holmes
Vince LaMonica wrote: I wish to use fwrite() to create a small PHP file. So far, when I attempt to do this, php parses the contents of the file that fwrite needs to create. Eg, I have this: $new_id = mysql_insert_id(); // create brand new file $new_file =

Re: [PHP] global array, can't assign values from variables

2003-09-05 Thread John W. Holmes
Chris Edwards wrote: I'm just going to give the code and output. It should be self explanatory. The array, $criteria, is having the issue. I don't know what it's doing. I cannot seem to assign the value from the $data variable to the $criteria[index] value. You will see some attempts to debug

Re: [PHP] Notices - Variable not defined

2003-09-05 Thread John W. Holmes
Leonie wrote: I have this code: if (!$path) { $path = getPath(); } Sometimes $path is set (there are forms on the page that can change it). When the page is first displayed: Notice: Undefined variable: path in e:\program/ etc... It then gives a reference to the line: if (!$path) { Is

Re: [PHP] Too Advanced? Re: Cookies Hidden Image

2003-09-05 Thread John W. Holmes
Nicole wrote: Not sure what else to do other than try something different. Using Cookie seems to be the only way to store the value on the client side for later retrieval. How about using a session and passing the session ID in the URL for the cookie? -- ---John Holmes... Amazon Wishlist:

Re: [PHP] mysql Pattern Matching

2003-09-04 Thread CPT John W. Holmes
From: Ralph Guzman [EMAIL PROTECTED] I know this question is best for the mySQL mailing list, but I am unable to subscribe to their list at this moment so perhaps somebody here can help me out. I have a table with a field where amenities are listed together using a comma delimiter like:

Re: [PHP] syntax error using header and SID

2003-09-04 Thread John W. Holmes
bob pilly wrote: Hi all Can someone tell me what the correct syntax is to pass a Session ID via the header redirect is? Im trying: header( Location: page2.php??echo strip_tags (SID)? ) but it isnt working for me and all the docs i can find just deal with tagging it to the end of a hyperlink.

Re: [PHP] Passing objects as a reference and extracting the index of an associative array.

2003-09-04 Thread John W. Holmes
Webmaster wrote: Hi, i am using the smarty template engine. Here is the problem that I would like to ask about: function initTop($page, $array) { for ($i=0; $isizeof($array) { $page-assignVars(, $array[$i]) } } The function is supposed to know which object's attributes she is

Re: [PHP] Front Page User Logout

2003-09-04 Thread John W. Holmes
John Welty wrote: I'm only accessing the result of the user logging in through $GLOBALS[PHP_AUTH_USER] I've tried unsetting that but it doesn't change anything. The only thing that logs a user out is them closing their browser and reopening it. I'd like a user to be able to switch usernames by

Re: [PHP] session.save_path is a big security hole!

2003-09-04 Thread John W. Holmes
You didnt understand. I change save.session_path to other's site session directory, do session_start(), write every variable what i want, write down session number, go to this site and using this generated session. You cannt prevent this ever! Does enabling safe_mode counter any of these writing

Re: [PHP] HTML Template, PHP, Javascript PATH_INFO

2003-09-04 Thread John W. Holmes
Richard A. DeVenezia wrote: [snip] I can do - site.com/info/template.html and get two alerts - site.com/info/content1.html and see a new text under H1 - site.com/info/slick.php/content1.html and get neither alert nor new text. - instead I get 4 browser (IE) 'problem alerts', I presume - 1. for

Re: [PHP] A bd problem

2003-09-04 Thread John W. Holmes
Carlos Castillo wrote: HI, i have the following problem Im working with sql server 2000 in a windows xp pc, then in the bd i have a table called noticias and a text type field, when i insert into the field everything goes rigth, but when i try to get the info of teh field, i can get all the

Re: [PHP] how to include() N lines?

2003-09-03 Thread John W. Holmes
[EMAIL PROTECTED] wrote: This really begs the question of WTF you have a 10,000+ line file that you only need a couple lines from... seems like your logic is screwy. every time my script is executed a line is added to a given image. right now every image is saved as new file because it needs to

Re: [PHP] php editor

2003-09-03 Thread John W. Holmes
STONE Steven wrote: What's the best php editor out there? Thanks in advance for nay replies! We've reached our quota on answering this question. Search the archives. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP

Re: [PHP] Ob_start question

2003-09-03 Thread John W. Holmes
Beauford.2005 wrote: I am getting this error: Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/local/apache/php/includes/2004server.inc:24) in /usr/local/apache/php/includes/restricted.inc on line 5 I have

Re: [PHP] PHP installation on IIS

2003-09-03 Thread CPT John W. Holmes
From: Sid [EMAIL PROTECTED] This is the first time I am installing PHP on IIS and I don't know what I am doing wrong. I copied the default php.ini file to the winnt dir. Then I added an ISAPI extention with .php to the App Mapings tab. (ISAPI caching enabled) Then I made a test.php file with

Re: [PHP] Q on Class and EXTEND

2003-09-03 Thread John W. Holmes
jsWalter wrote: -Original Message- From: Matt Matijevich [mailto:[EMAIL PROTECTED] I dont know much about classes, but dont you want $a = new THECHILD('walter'); //so you can access $a-abc instead of $a = new THEPARENT ('walter'); No, I'm wanting to EXTEND the orginal class.

Re: [PHP] Q on Class and EXTEND

2003-09-03 Thread CPT John W. Holmes
jsWalter wrote: What I am trying to do is EXTEND the PEAR::Auth Class with new properties and methods. But I still want to use the original instantiation call... $myAuth = Auth(); So, I don't think I can rename the orginal Class in this case. I'm just being particular. Or do I have

Re: [PHP] Get the lowest value out of different fields

2003-09-03 Thread CPT John W. Holmes
From: Frank Keessen [EMAIL PROTECTED] I hope you can help me with this: I have a tabel in my database like this TEST fieldnameValue's testid 1 testf1 3 testf2 4 testf3 0 testf4 2 testf5 0 (so this is one record!)

Re: [PHP] Too Advanced? Re: Cookies Hidden Image

2003-09-03 Thread John W. Holmes
Nicole wrote: I have the hidden image code: img src=http://thetrackingurl/?param1=val1param2=val2etc... height=0 width=0 border=0 This hidden image code is placed on the ThankYou page that people see after they have bought something. What it does is load a script on the tracking site to let the

Re: [PHP] multiple db query

2003-09-02 Thread John W. Holmes
Aris Santillan wrote: is it possible to query on 2 databases but with same tablename and merge its output? Probably. It depends upon your database, though. SELECT t1.column, t2.column FROM database1.table1 t1, database2.table2 t2 WHERE ... -- ---John Holmes... Amazon Wishlist:

Re: [PHP] Session var read by form C++ CGI prog ?

2003-09-02 Thread CPT John W. Holmes
From: John Bryan [EMAIL PROTECTED] If so, the problem is that this file that is being uploaded via the form to the program MyCppProg.exe gets sent as THE input to the prog, apparently as a cgi-type parameter through stdin (i.e. cin), so that when I try to pass the value as a cgi parameter,

Re: [PHP] Session var read by form C++ CGI prog ?

2003-09-02 Thread CPT John W. Holmes
From: John Bryan [EMAIL PROTECTED] The file would already exist on the client side. They are uploading the file to be processed by this program MyCppProg.exe, which is invoked as a form 'action'. This already works, but depends on the Apache variable REMOTE_USER being set when user logs in,

Re: [PHP] evaluating dynamic variable

2003-09-02 Thread CPT John W. Holmes
From: Stephen Goodman [EMAIL PROTECTED] When I run the code you've attached, with $i iterating up to 3, I get three 'empty!', even if $resolution1 should be 'not empty!'. It seems like the $i in $_POST[resolutions.$i] is not getting parsed into a value, and php is looking for a key

Re: [PHP] Form variables lost when duplicate records are found !

2003-09-02 Thread CPT John W. Holmes
From: Pushpinder Singh Garcha [EMAIL PROTECTED] I am making use of a php form to add company details to a MySQL Database. Before I add the form variables I am checking to see if the SAME company name exists in the DB. If the same company exists, then a notification is provided. In between

Re: [PHP] how to include() N lines?

2003-09-02 Thread John W. Holmes
[EMAIL PROTECTED] wrote: thanks for your answers! i'm not quite sure if i made my point clear. this is my problem: image.php ? header(Content-type: image/png); $image = imagecreate(510, 510); $color = ImageColorAllocate($image, 0, 0, 0); include(database.php); ImagePNG($image, '', 95);

Re: [PHP] search result highlighting / regexp voodoo

2003-09-02 Thread John W. Holmes
Lee O'Mara wrote: PROBLEM: I want to produce short snippets for search result pages. The search results are already partially processed (search terms get wrapped in [strong] tags), but I keep hitting dead-ends with this step. Now, I've tried a wide number of approaches, spent an embarasing

Re: [PHP] register_globals

2003-09-02 Thread John W. Holmes
Deependra b. Tandukar wrote: Hi, I have configured PHP 4.3.3 in which register_gloabals is set to be off. I modified etc/php.ini and set it to be On but still it shows it is off and some developed applications in php are asking for it to be turned on. How do I do this? Did you restart the web

Re: [PHP] cookie crumbles

2003-09-01 Thread John W. Holmes
John Taylor-Johnston wrote: $StudentId = weather.htm9995; if (!isset($_COOKIE[weather.htm$StudentId])) if(!isset($_COOKIE[$StudentID])) { echo Cookie not found, not reading weather.htm$StudentIdbr; echo \$_COOKIE[\weather.htm$StudentId\]. $_COOKIE[weather.htm$StudentId].-hr; }else{ echo

Re: [PHP] How to?

2003-08-29 Thread John W. Holmes
Jay Fitzgerald wrote: I need to create a form for this example in php. I need to have an unlimited number of seats with radio buttons next to each seat for the user to be able to select. BUT, when the user visits this page, it needs to pull the seats taken from the db and cross them out,

Re: [PHP] Absolute URLs with Require Include

2003-08-29 Thread John W. Holmes
Seth Willits wrote: Is there anyway to get an absolute URL to work with Require Include? Why doesn't it work already? I did see the tip about using $_SERVER, but this slows down page-loading considerably. You can use URLs in your include() or require() calls.

Re: [PHP] converting date into database date format(newbie)

2003-08-29 Thread John W. Holmes
Anil Garg wrote: I am reading date in the format 08-Aug-03 from a text file. While writing this date into the myqsl database's date column it shows '00-00-'. Is there a function or some other way to convert 08-Aug-03 type of dates in to format which is acceptable by date field of the mysql

Re: [PHP] Array Push and Keys

2003-08-29 Thread John W. Holmes
Ford, Mike [LSS] wrote: Having said that, I've just given you a clue: since array_push($array, $var) is equivalent to $array[] = $var, you can get the result you want by doing: $array[] = array($k, $v); (with, of course, appropriate values for $array, $k and $v substituted to suit your

Re: [PHP] Gripe

2003-08-29 Thread John W. Holmes
Jackson Miller wrote: Why is it that when you forget a } the error says: Unexpected $ on line [last line of file] Why can't it just say: Missing } on or before (best guess). How could the parser possibly know that one was missing as it's going through the file? It just keeps a count and can only

Re: [PHP] Re: Website templating schemes

2003-08-28 Thread John W. Holmes
rush wrote: While PHP is often considered as template system in it self, I think it is is not very strong, or efficient one. Wow... where'd you pull that from?? Any facts to back that up? :) FYI: I've got a template benchmark site running at http://sepodati.realxl.net/tpl_bench/ Any interest

Re: [PHP] IS THIS A BUG?

2003-08-28 Thread John W. Holmes
Steve Todd wrote: Is it possible to define a variable, such as: $foo = bar; and then do as follows to create a totally different variable: $$foo = text here; this seems to mean $bar = text here;. Is this a bug or can we legally use it. Yes it's legal.

Re: [PHP] can pdf forms be used to submit data into db?

2003-08-28 Thread John W. Holmes
Chris Boget wrote: All the information is on www.php.net/fdf. I just read the above page and I can't for the life of me figure out why anyone would want to do this. Of course, it's likely that I am simply being myopic. Would anyone who's actually used fdf enlighten as to the need to do it this

Re: [PHP] can pdf forms be used to submit data into db?

2003-08-28 Thread John W. Holmes
[EMAIL PROTECTED] wrote: John, that is EXACTLY what i want, now the question is...have you seen this implemented somewhere? so php would pass the data to a database and when a user/client wants to see that data again, php would re-generate the form with the data that is being requested right?

Re: [PHP] beginner: cut text after

2003-08-28 Thread John W. Holmes
Andras Kende wrote: Hello All, I have a very simple question: Want to remove the string after the first whitespace like: here is a text what i have to: here $word = substr($sentence,0,strpos($sentence,' ')); -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

Re: [PHP] selecting based on a month in a date

2003-08-28 Thread John W. Holmes
Creative Solutions New Media wrote: Hi, Asked this on the mySQL list but it seems to be more of a PHP syntax thing that a mySQL thing. In have the following line in PHP ?php $today = getdate();? I have a mySQL table which contains dates formatted as dates(-xx-xx) I want to select all

Re: [PHP] post v get

2003-08-28 Thread John W. Holmes
andu wrote: When you POST a form to the server the server replies with a new page. if you click the Back button in the browser the server wants to re-POST the form. Short of using GET is there a way to prevent re-submitting the previous form? Of course. :) One technique is to use a middle-man

Re: [PHP] verifying sql INSERTs

2003-08-27 Thread CPT John W. Holmes
From: Curt Zirzow [EMAIL PROTECTED] I should instead just try to perform the INSERT and then if it fails I know I've already got a record. If it doesn't I know everything is cool. I've debated with myself several times if this is really a good method to not have duplicates in the database.

Re: [PHP] PHP Interview questions

2003-08-27 Thread CPT John W. Holmes
From: Curt Zirzow [EMAIL PROTECTED] toggle_light(1); sleep(120); toggle_light(1); toggle_light(2); move('self', 'room/'); if ($lightbulb['temp'] $room['temp']) { echo switch #1; } elseif ($lightbulb['ison']) { echo switch #2; } else { echo switch #3; } hm.. i had to keep

Re: [PHP] Looping through a list - Newbie question

2003-08-27 Thread CPT John W. Holmes
From: James Johnson [EMAIL PROTECTED] I have a list contained in a session var. I want to loop through the list, getting the value of the current item, then do a query based on that value. Is there an easy way to do this, or do I need to convert the list to an array first? In the code below,

Re: [PHP] dealing with arrays

2003-08-27 Thread CPT John W. Holmes
You need to name the elements a little differently. You're on the right track with making them an array, but if I check the third box, that'll make $check[0] = 1, and if I put in a name in the first box, that'll make $name[0] = 'John'... so you have no way of relating the name from entry one to

Re: [PHP] Cannot pass values from one page to another

2003-08-27 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] Ok this is a major vulnerability that you are coding. Register globals on and password being stored in the session is like having a banner on your home page saying 'come and hack me'. Please explain how you've come to this conclusion... ---John Holmes... -- PHP

Re: [PHP] Implode slows down file reading? [was: str_replace performance in large mailing script]

2003-08-27 Thread CPT John W. Holmes
From: frederik feys [EMAIL PROTECTED] I thought str_replace caused slow down of my mailing script, but it seems to be this line of code: $fd = implode(,file(http://www.domain.org/store/min/Mailing_template.html;) ); I first put the mailing template in $fd (only once) and then replace

Re: [PHP] Cannot pass values from one page to another

2003-08-27 Thread CPT John W. Holmes
From: [EMAIL PROTECTED] Didn't know this was the army :-) Yeah, I signed you up last week. You report to basic training in November. I hope you're ready! :) first unless you got your variable ordering (POST, GET, Env, Sesssion etc). the values in the session can be easily overridden with a

Re: [PHP] session.cookie_domain

2003-08-27 Thread CPT John W. Holmes
From: Shu Chow [EMAIL PROTECTED] We're having a problem with a site that recently upgraded to php 4.3.3. Ever since the upgrade, session variables won't pass between pages. Looking at the php.ini file, I see that session.cookie_domain is set to server.hostingcompany.com while our site is

Re: [PHP] verifying sql INSERTs

2003-08-26 Thread John W. Holmes
Chris W. Parker wrote: Hi! (MySQL) What's the best way to determine a sql INSERT statement has executed successfully? You should use mysql_error() to ensure your query did not fail for any reason. Assuming the query was successful, you can use mysql_affected_rows() to see if it actually had

Re: [PHP] preg_match bug

2003-08-26 Thread John W. Holmes
Christian Calloway wrote: Hey I wanted to see if anyone was getting the same problem. Using preg_match in the following pattern: /tr bgcolor=#FF(.|\n)+?\/tr/ You need to escape the double quotes in your string at the very least. -- ---John Holmes... Amazon Wishlist:

Re: [PHP] problem passing variable between forms.

2003-08-26 Thread CPT John W. Holmes
- Original Message - From: Angelo Zanetti [EMAIL PROTECTED] I have a form in which I have a table with dynamic checkboxes, they are in a checkbox array ( name = chk[]...), I pass this variable to the next page using POST I receive the variable and use it, no problem, but then when I

Re: [PHP] math functions?

2003-08-26 Thread CPT John W. Holmes
From: Amanda McComb [EMAIL PROTECTED] I am having trouble finding math functions on php.net. I am also getting page not found errors when trying to search. Basically, I'm looking for a mod or division function - something I can use to tell me when a number is evening divisable by a

Re: [PHP] PHP Interview questions

2003-08-26 Thread CPT John W. Holmes
From: Micheal Harris [EMAIL PROTECTED] I am in the process of hiring someone that needs to have extensive PHP and MySQL experience. Does anyone have any suggestions for interview questions? I have no PHP or MySQL experience, and come from a non-technical background. I want the questions to be

Re: [PHP] Serve a file using PHP

2003-08-26 Thread CPT John W. Holmes
From: Grant Rutherford [EMAIL PROTECTED] Is there a way that PHP can allow a user to browse the files on the server's network, and ultimately send the file to the user? I'm making a database interface with PHP to be used internally on our network. Through a PHP interface, the user wants to

Re: [PHP] PHP Interview questions

2003-08-26 Thread CPT John W. Holmes
From: Jay Blanchard [EMAIL PROTECTED] Also ask a couple of other questions that require thought, but have nothing else to do with code. such as... In one room you have 3 light switches, each connected to one light bulb in another room. How many trips must you make to determine which switch

Re: [PHP] verifying sql INSERTs

2003-08-26 Thread CPT John W. Holmes
From: Chris W. Parker [EMAIL PROTECTED] I should instead just try to perform the INSERT and then if it fails I know I've already got a record. If it doesn't I know everything is cool. If it is a certain kind of failure, then you have a duplicate, otherwise it could be another type of

Re: [PHP] Website templating schemes

2003-08-26 Thread CPT John W. Holmes
From: Joel Konkle-Parker [EMAIL PROTECTED] I'm trying to make a PHP-backed website, and I'm trying to decide between two templating schemes: 1. define 2 php template files: header.php, footer.php. in index.php, require header.php, output content, require footer.php 2. define a php

Re: [PHP] mysql_connect error

2003-08-25 Thread John W. Holmes
Mjec wrote: Hi, again this line is causing problems: $h = mysql_connect('localhost',constant(mysql_user),constant(mysql_password)) ; Aparantly a parse error. Idaes? Is there a reason you're using constant()?? Try: $h = mysql_connect('localhost', mysql_user, mysql_password); One thing to

Re: [PHP] start_session()

2003-08-24 Thread John W. Holmes
murugesan wrote: Can any one say what it the purpose of start_session() fuction Umm... to start a session. Read this: http://us2.php.net/manual/en/ref.session.php -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ PHP|Architect: A magazine for PHP Professionals

Re: [PHP] Array element from function return

2003-08-24 Thread John W. Holmes
Wouter van Vliet wrote: I'm trying to get the first element of a value returned by a function .. == example == function return_Array() { return ('one', 'zwei', 'kolm', 'vier'); } print return_Array()[0]; ==/ example == Now i'd like this script to print 'one' for me .. can it be done

Re: [PHP] timing a session

2003-08-23 Thread John W. Holmes
Damian Brown wrote: i haven't looked into it properly yet, but is there a way in PHP of recording the length of time a visitor stays on your website i can record the entry, but i don't know how to record the exit time There's really no way to do this, only ways to estimate the time. Assign each

Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread John W. Holmes
Gloria L. McMillan wrote: I have always had problems in cutting and pasting new forms off old ones. Often the problem is in the communication that makes the form allow repliers to view results on screen. This is good to do with opinion polls to start discussions. I have a *terrible* time

Re: [PHP] Tips on print to screen debugging

2003-08-23 Thread John W. Holmes
Gloria L. McMillan wrote: Here is the URL of the poll form. http://dakotacom.net/~glomc/forms/CAT.html When you do this poll it immiediately attempts to print to screen. There's also a VIEW RESPONSES button so ppl don't have to answer the poll to view reponses. You can see now that there is just

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 site

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.php.net/)

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 query

Re: [PHP] timestamp

2003-08-22 Thread CPT John W. Holmes
From: John Taylor-Johnston [EMAIL PROTECTED] I'm creating a counter. I want a timestamp where I can calculate if a time stamp is older than one hour, if so do X, if not do Y. SELECT * FROM Table WHERE timestamp_column NOW() - INTERVAL 60 MINUTE will give you all rows that have a timestamp

Re: [PHP] Deleting same values from an array

2003-08-22 Thread John W. Holmes
Stephen Craton wrote: Hello, I have an array called $stems that has a bunch of numbers in it like 2, 5, 4, 4, 2, 6, 8. What I want to do is delete a section of the array that has the same number. In the example of the numbers I listed, I'd want to delete one of the number 4's, and one of the

Re: [PHP] Server variables on IIS

2003-08-22 Thread John W. Holmes
Sid wrote: Hello, I am trying to migrate a PHP script and just realized that the IIS server I am working on does not have the REQUEST_URI, SCRIPT_FILE_NAME and DOCUMENT_ROOT server variables. This makes the script malfunction. Does anyone know how I can get these variables? If you would like

Re: [PHP] float precision format not being kept

2003-08-22 Thread John W. Holmes
Rob Yelvington wrote: I have a list of floats that I need to put into an array, when I put them into an array manually the floats lose their format, for example: $a = array(1=3.50807443617658E-4); print $a[1] returns: 0.00035080744361766 I'm familiar with round() and all the math functions,

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