Re: [PHP] PHP Newbie List
On Tue, Feb 26, 2008 at 3:11 PM, revDAVE [EMAIL PROTECTED] wrote: Rather than bug folks on this cool list for beginner questions - does anyone know of a good PHP Newbie email List? php-general@lists.php.net You're in the right place. ;-) There are forums elsewhere around the web, though. As usual, I'll recommend PHPBuilder. http://www.phpbuilder.com/ -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
On 2/26/08, revDAVE [EMAIL PROTECTED] wrote: Rather than bug folks on this cool list for beginner questions - does anyone know of a good PHP Newbie email List? The newbie list idea was shot down multiple times over the years. Ask here. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
On Feb 26, 2008, at 3:11 PM, revDAVE wrote: Rather than bug folks on this cool list for beginner questions - does anyone know of a good PHP Newbie email List? Hi revDAVE, I know of no better resource for PHP related help then this lists... I have learned everything I have from these people here. Most of them are really nice to newbies too :) I cut my teeth on this list, and don't regret it. And besides... If you have a question I may actually be able to help you and give back to a community that gave to me! :) -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
revDAVE [EMAIL PROTECTED] wrote: Rather than bug folks on this cool list for beginner questions - does anyone know of a good PHP Newbie email List? -- Thanks - RevDave Cool @ hosting4days . com [db-lists] We're glad to help around here, just realize that none of us are going to write your code for you. You're going to need to write code, stumble, cuss a bit and then post to the list and ask what the flip is happening and where the script barfed. Sometimes that extra set of eyes helps to find the dangling or missing ';' better then staring at the code for hours... (I think we've all been here at some point). Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
On Tue, Feb 26, 2008 at 3:30 PM, Wolf [EMAIL PROTECTED] wrote: Sometimes that extra set of eyes helps to find the dangling or missing ';' better then staring at the code for hours... (I think we've all been here at some point). Speak for yourself. My code is always 100% spotless, efficient, and runs the first time, completely bug-free, every single time, as it has for years. Well, until the alarm clock goes off, anyway. ;-P -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
On Feb 26, 2008, at 3:30 PM, Wolf wrote: revDAVE [EMAIL PROTECTED] wrote: Rather than bug folks on this cool list for beginner questions - does anyone know of a good PHP Newbie email List? -- Thanks - RevDave Cool @ hosting4days . com [db-lists] We're glad to help around here, just realize that none of us are going to write your code for you. You're going to need to write code, stumble, cuss a bit and then post to the list and ask what the flip is happening and where the script barfed. Sometimes that extra set of eyes helps to find the dangling or missing ';' better then staring at the code for hours... (I think we've all been here at some point). *Raises his hand! Not a PHP problem but staring at the code right now wondering why my navigation menu isn't displaying... Getting ready to cuss... Maybe even grab a beer.. I need to keep beer in the fridge at work... Okay I'm done now :) Wolf -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Jason Pruim Raoset Inc. Technology Manager MQC Specialist 3251 132nd ave Holland, MI, 49424-9337 www.raoset.com [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
At 12:11 PM -0800 2/26/08, revDAVE wrote: Rather than bug folks on this cool list for beginner questions - does anyone know of a good PHP Newbie email List? -- Thanks - RevDave Welcome. We're used to bugs. Besides, we're all beginners in something. So, ask away -- we'll be more than happy to tell you RTFM :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie List
On 2/26/08, Daniel Brown [EMAIL PROTECTED] wrote: Speak for yourself. My code is always 100% spotless, efficient, and runs the first time, completely bug-free, every single time, as it has for years. Well, in Ruby on Rails, it has this.. nevermind. -- Greg Donald http://destiney.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP newbie question on xslt
Timothy Murphy escribió: I've been trying some of the programs in the PHP manual at http://www.php.net/manual/en/ in chapters CLXXXI and CLXXXII to work, for example // Example 2519. Creating an XSLTProcessor ?php $xml_filename = collection.xml; $xsl_filename= collection.xsl; $doc = new DOMDocument(); $xsl = new XSLTProcessor(); $doc-load($xsl_filename); $xsl-importStyleSheet($doc); $doc-load($xml_filename); echo $xsl-transformToXML($doc); ? (where I have added the two filenames, and copied the files collection.x?l from the manual). When I run PHP I get: [EMAIL PROTECTED] Test]# php ex2519.php // Example 2519. Creating an XSLTProcessor Segmentation fault I'm running the program under Fedora-6 Linux with the latest versions of all programs. Is there something I should have included, to get the program to run? Any advice or suggestions gratefully received. Try not to load both xml and xsl in the same $doc variable... use one for the xsl and another for the xml. I think you are destroying the dom for the xsl before the transform... -- Miguel J. Jiménez Área de Internet/XSL/PHP [EMAIL PROTECTED] ISOTROL Edificio BLUENET, Avda. Isaac Newton nº3, 4ª planta. Parque Tecnológico Cartuja '93, 41092 Sevilla. Teléfono: 955 036 800 - Fax: 955 036 849 http://www.isotrol.com Killing is often a part of life. What's hypocritical is to condemn, and then make allowances when the situation suits. Utu-Noranti Pralatong (Farscape 4x17 - A Constellation Of Doubt) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to detail page
David Doonan wrote: I'm having trouble getting the correct results on a display page. The first query is pulling the name of active authors from the d/b and sending a request to only return essay titles by the requested author. The list page however is displaying essay titles by all authors. No doubt something is wrong with the where clause in the List page query. I've tried countless variations on the syntax for Author.ID = Author.ID without success. Sorry for so basic a question. - author page query = $query_GetAuthors = SELECT Distinct Author.Autholr_Name, Author.ID, Writings.Writings_Author FROM Author, Writings WHERE Author.Autholr_Name = Writings.Writings_Author and Author.ID = Author.ID; $GetAuthors = mysql_query($query_GetAuthors, $connDerbyTrail) or die (mysql_error()); $row_GetAuthors = mysql_fetch_assoc($GetAuthors); $totalRows_GetAuthors = mysql_num_rows($GetAuthors); author page link = a href=author.php?ID=?php echo $row_GetAuthors['ID']; ??php echo $row_GetAuthors['Autholr_Name']; ?/a - List page query = $query_GetAuthorList = SELECT Writings.Writings_Author, Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as Writings_Date, Writings.Writings_Text, Writings.ID, Author.Autholr_Name, Author.ID FROM Writings, Author WHERE Writings.ID = Writings.ID AND Author.Autholr_Name = Writings.Writings_Author AND Author.ID = Author.ID ORDER BY Writings.Writings_Date desc; $GetAuthorList = mysql_query($query_GetAuthorList, $connDerbyTrail) or die(mysql_error()); $row_GetAuthorList = mysql_fetch_assoc($GetAuthorList); $totalRows_GetAuthorList = mysql_num_rows($GetAuthorList); david David-- First of all, yours is purely a SQL problem, so would get better response from the PHP-DB or MySQL list. But a quick glance at your SQL shows that your second query returns all writings by all authors because you don't include anything to narrow it down to one author: WHERE Writings.ID = Writings.ID AND Author.Autholr_Name = Writings.Writings_Author AND Author.ID = Author.ID First of all: Writings.ID = Writings.ID and Author.ID = Author.ID are nonsense. Every query will match those crieria. In other words, you'd probably best take an hour or so to RTF 'Intro to SQL M.' Here's another hint: You have no PHP variable in your SQL query. That means you execute the same exact query every time you run it. So you will get the same exact results every time. So your solution is this: Include a PHP variable in your SQL query to specify which author you want to select. You probably want something like this: WHERE Author.Author_Name = Writings.Author_Name AND Author.ID = '$MySelectedAuthorID' (but remember to define $MySelectedAuthorId before running it :) Good luck and post again with your progress. John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to detail page
On Apr 8, 2006, at 11:24 AM, John Hicks wrote: So your solution is this: Include a PHP variable in your SQL query to specify which author you want to select. You probably want something like this: WHERE Author.Author_Name = Writings.Author_Name AND Author.ID = '$MySelectedAuthorID' (but remember to define $MySelectedAuthorId before running it :) John, Taken your suggestion and added a variable, but the list page is now returning no records. The ID, which is showing up in the URL, is being passed from the first page to the list page (http://localhost/ Der/writings/author.php?ID=5) but the list page is not accepting that variable New Query for list page= mysql_select_db($database_connDer, $connDer); $recordID = $_GET['recordID']; $query_GetAuthorList = SELECT Writings.Writings_Author, Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as Writings_Date, Writings.Writings_Text, Writings.ID, Author.Autholr_Name, Author.ID FROM Writings, Author WHERE Author.Autholr_Name = Writings.Writings_Author and Author.ID = '$recordID' ORDER BY Writings.Writings_Date desc; $GetAuthorList = mysql_query($query_GetAuthorList, $connDerl) or die (mysql_error()); $row_GetAuthorList = mysql_fetch_assoc($GetAuthorList); $totalRows_GetAuthorList = mysql_num_rows($GetAuthorList); If this were a ColdFusion page, I would simply replace Author.ID = '$recordID' with ID = #ID#. I'll take your suggestion and post in the PHP-DB list. david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to detail page
David Doonan wrote: On Apr 8, 2006, at 11:24 AM, John Hicks wrote: So your solution is this: Include a PHP variable in your SQL query to specify which author you want to select. You probably want something like this: WHERE Author.Author_Name = Writings.Author_Name AND Author.ID = '$MySelectedAuthorID' (but remember to define $MySelectedAuthorId before running it :) John, Taken your suggestion and added a variable, but the list page is now returning no records. The ID, which is showing up in the URL, is being passed from the first page to the list page (http://localhost/ Der/writings/author.php?ID=5) but the list page is not accepting that variable New Query for list page= mysql_select_db($database_connDer, $connDer); $recordID = $_GET['recordID']; $query_GetAuthorList = SELECT Writings.Writings_Author, Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as Writings_Date, Writings.Writings_Text, Writings.ID, Author.Autholr_Name, Author.ID FROM Writings, Author WHERE Author.Autholr_Name = Writings.Writings_Author and Author.ID = '$recordID' ORDER BY Writings.Writings_Date desc; $GetAuthorList = mysql_query($query_GetAuthorList, $connDerl) or die (mysql_error()); $row_GetAuthorList = mysql_fetch_assoc($GetAuthorList); $totalRows_GetAuthorList = mysql_num_rows($GetAuthorList); If this were a ColdFusion page, I would simply replace Author.ID = '$recordID' with ID = #ID#. I'll take your suggestion and post in the PHP-DB list. david David-- Note that your request URL has a value for 'ID' whereas your program is looking for a value for 'recordID'. Try displaying your SQL query on the output page. I have a hunch it'll say Author.ID = '' --John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to detail page
On Apr 8, 2006, at 12:55 PM, John Hicks wrote: $recordID = $_GET['recordID']; Note that your request URL has a value for 'ID' whereas your program is looking for a value for 'recordID'. Changed above to: $recordID = $_GET['ID']; And all was right with the world. Thanks John! david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to list page
On 4/9/06, David Doonan [EMAIL PROTECTED] wrote: I'm having trouble getting the correct results on a list page. The first query is pulling the name of active authors from the d/b and linking to a list page that is supposed to return essay titles by the requested author. The list page however is displaying essay titles by all authors. - List page query = $query_GetAuthorList = SELECT Writings.Writings_Author, Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as Writings_Date, Writings.Writings_Text, Writings.ID, Author.Autholr_Name, Author.ID FROM Writings, Author WHERE Writings.ID = Writings.ID AND Author.Autholr_Name = Writings.Writings_Author AND Author.ID = Author.ID ORDER BY Writings.Writings_Date desc; What happens when you run that through phpmyadmin or mysql? Does it give you the right results? You are right, the query seems to be stuffed - you have the tables joining to themselves (author.id=author.id) What do the tables look like? describe writings; describe author; -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to list page
David Doonan wrote: I'm having trouble getting the correct results on a list page. The first query is pulling the name of active authors from the d/b and linking to a list page that is supposed to return essay titles by the requested author. The list page however is displaying essay titles by all authors. No doubt something is wrong with the where clause in the List page query. I've tried countless variations on the syntax for Author.ID = Author.ID without success. Sorry for so basic a question. - author page query = $query_GetAuthors = SELECT Distinct Author.Autholr_Name, Author.ID, Writings.Writings_Author FROM Author, Writings WHERE Author.Autholr_Name = Writings.Writings_Author and Author.ID = Author.ID; ... author page link = a href=author.php?ID=?php echo $row_GetAuthors['ID']; ??php echo $row_GetAuthors['Autholr_Name']; ?/a - List page query = $query_GetAuthorList = SELECT Writings.Writings_Author, Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as Writings_Date, Writings.Writings_Text, Writings.ID, Author.Autholr_Name, Author.ID FROM Writings, Author WHERE Writings.ID = Writings.ID AND Author.Autholr_Name = Writings.Writings_Author AND Author.ID = Author.ID ORDER BY Writings.Writings_Date desc; ... Nowhere in your query are you actually specifying which author you want to get results for. You need to use the variable passed to the page as part of the query. Try adding something like the following to your where block. Author.ID = .mysql_real_escape_string($_GET['ID']) David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie having trouble going to list page
On Sat, April 8, 2006 10:12 am, David Doonan wrote: I'm having trouble getting the correct results on a list page. The first query is pulling the name of active authors from the d/b and linking to a list page that is supposed to return essay titles by the requested author. The list page however is displaying essay titles by all authors. No doubt something is wrong with the where clause in the List page query. I've tried countless variations on the syntax for Author.ID = Author.ID without success. Sorry for so basic a question. - author page query = $query_GetAuthors = SELECT Distinct Author.Autholr_Name, Author.ID, Writings.Writings_Author FROM Author, Writings WHERE Author.Autholr_Name = Writings.Writings_Author and Author.ID = Author.ID; This gets every author several times over, then throws away the duplicates. Not what you want. First thing: WHERE Author.ID = Author.ID This is just silly -- Author.ID will ALWAYS equal Author.ID It's a tautology, like, WHERE 1 = 1 Get rid of it. Next, you really should NOT be storing the Author Name in both tables. Suppose somebody gets married? Suppose Cassius Clay changes his name to Mohammed Ali. Suppose Madonna writes for you. You should store an Author_ID field ni Writings so that you are comparing the ID Numbers, not names that might change tomorrow. Finally, you are JOINing the Author table and Writings table here, and then throwing away all the info from the Writings table, just to get the Names. Either use JUST the author table to get JUST the names, or get BOTH their Writings *AND* their names. $GetAuthors = mysql_query($query_GetAuthors, $connDerbyTrail) or die (mysql_error()); $row_GetAuthors = mysql_fetch_assoc($GetAuthors); $totalRows_GetAuthors = mysql_num_rows($GetAuthors); author page link = a href=author.php?ID=?php echo $row_GetAuthors['ID']; ??php echo $row_GetAuthors['Autholr_Name']; ?/a - List page query = $query_GetAuthorList = SELECT Writings.Writings_Author, Writings.Writings_Title, DATE_FORMAT(Writings_Date, '%M %D, %Y') as Writings_Date, Writings.Writings_Text, Writings.ID, Author.Autholr_Name, Author.ID FROM Writings, Author WHERE Writings.ID = Writings.ID AND Author.Autholr_Name = Writings.Writings_Author AND Author.ID = Author.ID ORDER BY Writings.Writings_Date desc; Again, Writings.ID will ALWAYS equal Writings.ID Author.ID will ALWAYS equal Author.ID Matching up the names SHOULD get you just one of each, if your data is not messed up... $GetAuthorList = mysql_query($query_GetAuthorList, $connDerbyTrail) or die(mysql_error()); $row_GetAuthorList = mysql_fetch_assoc($GetAuthorList); $totalRows_GetAuthorList = mysql_num_rows($GetAuthorList); -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie question with xml files
This should get you started: $old_data = file_get_contents('./test.txt'); $my_data = foo bar; $pattern = '/(.*)(\/.*)$/i'; $replacement = '$1' . $my_data . '$2'; $new_data = preg_replace($pattern, $replacement, $old_data); echo $new_data; or a little more succinctly $my_data = foo bar; $new_data = preg_replace('/(.*)(\/.*)$/i', '$1' . $my_data . '$2', file_get_contents('./test.txt')); echo $new_data; Mark Cain - Original Message - From: Jared Sherman [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, May 03, 2005 2:00 AM Subject: [PHP] php newbie question with xml files I have an xml document storing some data I need. What I want to do is this: 1. Scan to the end of the file. 2. Find the closing tag. 3. Insert a new entry in before the closing tag. I've tried: 1. Creating new files and renaming them to be the original. 2. Writing the file to a dummy file and insert my lines part way through then finish the last tag. My problem is I'm looking for a /endtag and it comes up as endtag. Is there anyway to force PHP to read the .xml file as a text file so it wont strip off the xml tag information? I've used fopen with fgets and fwrite, and file with fwrite Jared Sherman Totally lost newbie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie question with xml files
This should get you started: $old_data = file_get_contents('./test.txt'); $my_data = foo bar; $pattern = '/(.*)(\/.*)$/i'; $replacement = '$1' . $my_data . '$2'; $new_data = preg_replace($pattern, $replacement, $old_data); echo $new_data; or a little more succinctly $my_data = foo bar; $new_data = preg_replace('/(.*)(\/.*)$/i', '$1' . $my_data . '$2', file_get_contents('./test.txt')); echo $new_data; Mark Cain - Original Message - From: Jared Sherman [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Tuesday, May 03, 2005 2:00 AM Subject: [PHP] php newbie question with xml files I have an xml document storing some data I need. What I want to do is this: 1. Scan to the end of the file. 2. Find the closing tag. 3. Insert a new entry in before the closing tag. I've tried: 1. Creating new files and renaming them to be the original. 2. Writing the file to a dummy file and insert my lines part way through then finish the last tag. My problem is I'm looking for a /endtag and it comes up as endtag. Is there anyway to force PHP to read the .xml file as a text file so it wont strip off the xml tag information? I've used fopen with fgets and fwrite, and file with fwrite Jared Sherman Totally lost newbie -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie question with xml files
I have an xml document storing some data I need. What I want to do is this: 1. Scan to the end of the file. 2. Find the closing tag. 3. Insert a new entry in before the closing tag. There are specific classes and functions in the PHP core that can help you do just this. I've tried: 1. Creating new files and renaming them to be the original. 2. Writing the file to a dummy file and insert my lines part way through then finish the last tag. I don't think this is the right approach to take. Maybe using the DOM and/or the XML Parser built-in to php would help you. My problem is I'm looking for a /endtag and it comes up as endtag. Is there anyway to force PHP to read the .xml file as a text file so it wont strip off the xml tag information? I've used fopen with fgets and fwrite, and file with fwrite Again, this isn't the approach to take. There are built-in functions for this sort of thing, as well as classes on PEAR that will help you. Try google! Read through all of this and decide which approach you want to take before you start anything... If you use Windows or compile PHP as an Apache module in Linux, you're all set with the XML Parser. If not, you'll need to get the library according to the directions in the manual. http://www.php.net/xml Read everything in that thoroughly, and understand it before you continue with this approach. Copy and play with the examples to see how it all works. If you'd rather handle things in an environment designed to create and manipulate XML dynamically, rather than just read and insert raw strings, keep reading. You can get the DOM XML working easily in Windows, and even easier in a GNOME environment on a linux box. The manual has excellent instructions. http://www.php.net/domxml This extension is Object-Oriented (OO), and if you don't know what that is, you better read up on it before you try this out. If you do, and have an OK understanding of how OO works in PHP, then read on! If not, read the article http://www.php.net/oop Now, understand that DOM XML is very particular about the syntax and such in an XML file. The file MUST start with the XML declaration (without quotes) ?xml version=1.0 in order for DOM to try and use it. Use the functions to read right through it all. You'll find that this is probably exactly what you need! I'd use DOM XML personally. I included the other in case you didn't want to have to install everything. Have fun, and good luck with PHP! -- [EMAIL PROTECTED] PHP rocks! Knowledge is Power. Power Corrupts. Go to school, become evil Disclaimer: Any disclaimer attached to this message may be ignored. However, I must say that the ENTIRE contents of this message are subject to other's criticism, corrections, and speculations. This message is Certified Virus Free -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php newbie question with xml files
PHP5: http://php.net/manual/en/ref.dom.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie Database Records?
Hi, Do a select query with a COUNT() in it if you dont understand that read the php manual for accessing the database and lookup the mysql COUNT -Ryan On 2/16/2004 1:35:42 AM, PETCOL ([EMAIL PROTECTED]) wrote: PHP Newbie, I'm trying to find out if a username already appears in my database. I have two users in my table, one is colin so when I enter a username of colin I would normally under ColdFusion anyway just to something like: cfif $query_qUsername.RecordCount GT 0 User already exists do something else, like throw the user back an error. /cfif My Query works $query_qUsername = SELECT * FROM users WHERE username = '$username'; I've tried a number of different things here and everything either comes back with nothing, or throws an error. $num_rows = mysql_num_rows($query_qUsername); echo $num_rows; // this comes back with nothing, I was expecting a numeric of 1 exit; Regards Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie Database Records?
PETCOL wrote: PHP Newbie, I'm trying to find out if a username already appears in my database. I have two users in my table, one is colin so when I enter a username of colin I would normally under ColdFusion anyway just to something like: cfif $query_qUsername.RecordCount GT 0 User already exists do something else, like throw the user back an error. /cfif My Query works $query_qUsername = SELECT * FROM users WHERE username = '$username'; I've tried a number of different things here and everything either comes back with nothing, or throws an error. $num_rows = mysql_num_rows($query_qUsername); mysql_num_rows() takes a result set from a executed query... $result = mysql_query ( $query_qUsername ); $num_rows = mysql_num_rows ( $result ); It's all here... http://us2.php.net/mysql_num_rows echo $num_rows; // this comes back with nothing, I was expecting a numeric of 1 exit; Regards Col -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php NEWBIE Question
* Thus wrote Dennis Dujan - Partycult.de ([EMAIL PROTECTED]): Hi, can you tell me how is it possible to connect to a linux shell via PHP? Ok, i suppose I should reply to this before you ask the same question with less details, again. Please be a little more specific in your question, like what you are trying to achieve. Otherwise we will be just trying to guess at what you want to do, and most likley guess wrong. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php NEWBIE Question
Ok thank you very much -Ursprungliche Nachricht- Von: Chris Kay [mailto:[EMAIL PROTECTED] Gesendet: Montag, 25. August 2003 01:37 An: 'Dennis Dujan - Partycult.de' Betreff: RE: [PHP] php NEWBIE Question Try http://au.php.net/manual/en/function.fsockopen.php If your looking for a tutorial, goto google and search for telnet with php -- Chris Kay (CK) Eleet Internet Services M: 0415 451 372 P: 02 4620 5076 F: 02 4620 7008 E: [EMAIL PROTECTED] -Original Message- From: Dennis Dujan - Partycult.de [mailto:[EMAIL PROTECTED] Sent: Monday, 25 August 2003 9:34 AM To: [EMAIL PROTECTED] Subject: AW: [PHP] php NEWBIE Question Iam currently writing some Scripts in PHP for a Webappliance. And now I have the problem that I have to connect with a PHP Script to a Shell that is located on another Server. But I don't know how to do this... :-/ Perhaps you can help me with an example or a Page with a Tutorial. Greetz Dennis -Ursprungliche Nachricht- Von: Curt Zirzow [mailto:[EMAIL PROTECTED] Gesendet: Montag, 25. August 2003 01:22 An: [EMAIL PROTECTED] Betreff: Re: [PHP] php NEWBIE Question * Thus wrote Dennis Dujan - Partycult.de ([EMAIL PROTECTED]): Hi, can you tell me how is it possible to connect to a linux shell via PHP? Ok, i suppose I should reply to this before you ask the same question with less details, again. Please be a little more specific in your question, like what you are trying to achieve. Otherwise we will be just trying to guess at what you want to do, and most likley guess wrong. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP newbie ... function with several returns ?
Hi, Sunday, March 16, 2003, 10:52:49 AM, you wrote: RD Hi ... PHP newbie here. RD I'm migrating from ASP/vbScript. RD I'd like to set up a subroutine that will change several variables at once. RD In VB, I can say: RD Private Sub Change_Variables ($variable1, $variable2) RD $variable1 = Something different from it's original value RD $variable2 = I'm changed also!! RD End Sub RD // in my code I can call it like this: RD $My_variable1 = This is the original value of variable1 RD $My_variable2 = This is the original value of variable2 RD Call Change_Variables ($My_variable1, $My_variable2) RD // after calling this subroutine the variables are changed: RD print $My_variable1 // yeilds: Something different from it's original RD value RD print $My_variable2 // yields: I'm changed also!! RD I try to convert this to PHP, and I'm getting stuck. I'm sure there's a RD kind of function that can do this. RD Any ideas? RD TIA You need this: function Change_Variables ($variable1, $variable2){ $variable1 = Something different from it's original value $variable2 = I'm changed also!! } (notice the '' symbols) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie question
http://www.php.net/manual/en/tutorial.php Bryan Cassidy wrote: This might sound stupid but what the hell. I am running Red Hat 8.0 with Apache. I have apache working fine right now. I am wanting to learn some php but really don't know where to start/look or anything to tell the truth. I do everything from my FreeBSD 4.6.2 box but Apache runs on Red Hat. With me? Could someone give me a very basic PHP script or whatever they are called, tell me where I should or need to put it on my Red Hat 8.0 box and what else I need to do to see the script on my webpage? Put it like this. I will make a html file in /var/www/html/ called php and inside php i will make a file named php.ini ( i think it should be .ini right?) and I will edit my index.html file, add a link and point it to the php.ini file and see what happens. I just want to get a very basic idea of php, what it does, where to put the php file and how to get started on the web. I really hope this e-mail doesn't get ignored so could someone just help me out a lil bit here? I would appreciate it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Newbie question
Steps: 1. Install PHP. Already installed? 2. make a file accessible via browser and call it test.php 3. put this into it: ? echo Hello Worldbr; phpinfo(); ? 4. Now, access that file. If you see Hello World outputted followed by a long blue-gray table with lots of server data - means everything worked and you could go to the sites like PHP Beginner (www.phpbeginner.com) or many others to read some tutorials and still code to keep testing. If you get asked to download a .php file then make sure you installed your PHP with Apache right (requires some editing of httpd.conf, read the manual) Cheers, -- Maxim Maletsky [EMAIL PROTECTED] Bryan Cassidy [EMAIL PROTECTED] wrote... : This might sound stupid but what the hell. I am running Red Hat 8.0 with Apache. I have apache working fine right now. I am wanting to learn some php but really don't know where to start/look or anything to tell the truth. I do everything from my FreeBSD 4.6.2 box but Apache runs on Red Hat. With me? Could someone give me a very basic PHP script or whatever they are called, tell me where I should or need to put it on my Red Hat 8.0 box and what else I need to do to see the script on my webpage? Put it like this. I will make a html file in /var/www/html/ called php and inside php i will make a file named php.ini ( i think it should be .ini right?) and I will edit my index.html file, add a link and point it to the php.ini file and see what happens. I just want to get a very basic idea of php, what it does, where to put the php file and how to get started on the web. I really hope this e-mail doesn't get ignored so could someone just help me out a lil bit here? I would appreciate it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php newbie
To test your PHP scripts you do need a server with PHP. It's very easy to setup one on to you local machine + there is many completely free ones. Niklas -Original Message- From: Fady Fouad Shehata [mailto:[EMAIL PROTECTED]] Sent: 31. joulukuuta 2001 4:34 To: [EMAIL PROTECTED] Subject: [PHP] php newbie hi i am new in php ,i just wanted to ask before i begin learning php ,well can i design php on my personal computer or i need a server to design php ,and the second question is do i need a specific program to design php or i can use my html editor for that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php newbie
To design, you just need a text editor (or html editor) Martin At 13:24 02.01.02 +0200, Niklas Lampén wrote: To test your PHP scripts you do need a server with PHP. It's very easy to setup one on to you local machine + there is many completely free ones. Niklas -Original Message- From: Fady Fouad Shehata [mailto:[EMAIL PROTECTED]] Sent: 31. joulukuuta 2001 4:34 To: [EMAIL PROTECTED] Subject: [PHP] php newbie hi i am new in php ,i just wanted to ask before i begin learning php ,well can i design php on my personal computer or i need a server to design php ,and the second question is do i need a specific program to design php or i can use my html editor for that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] - Dipl.-Ing. Martin Schichl SCC Software, Communication Consulting GmbH Co KEG Grottenhofstr. 3, A-8053 Graz Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234 [EMAIL PROTECTED], http://scc.co.at -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] php newbie
Yep, but you can't do much without testing your scripts. Niklas -Original Message- From: Martin Schichl [mailto:[EMAIL PROTECTED]] Sent: 2. tammikuuta 2002 13:37 To: [EMAIL PROTECTED]; Php-General Subject: RE: [PHP] php newbie To design, you just need a text editor (or html editor) Martin At 13:24 02.01.02 +0200, Niklas Lampén wrote: To test your PHP scripts you do need a server with PHP. It's very easy to setup one on to you local machine + there is many completely free ones. Niklas -Original Message- From: Fady Fouad Shehata [mailto:[EMAIL PROTECTED]] Sent: 31. joulukuuta 2001 4:34 To: [EMAIL PROTECTED] Subject: [PHP] php newbie hi i am new in php ,i just wanted to ask before i begin learning php ,well can i design php on my personal computer or i need a server to design php ,and the second question is do i need a specific program to design php or i can use my html editor for that -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] - Dipl.-Ing. Martin Schichl SCC Software, Communication Consulting GmbH Co KEG Grottenhofstr. 3, A-8053 Graz Tel. +43/(0)316/265-205, Fax +43/(0)316/265-234 [EMAIL PROTECTED], http://scc.co.at -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP newbie alert
I use PHP Coder (http://www.phpide.de ) which has been changed to Maguma PHP4EE Studio. http://www.maguma.com/english/welcome.html There's a Light and a Pro version. The Light version is free -Jon -Original Message- From: shaun murphy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 5:25 AM To: [EMAIL PROTECTED] Subject:[PHP] PHP newbie alert Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
If you use Dreamweaver under MacOS I suggest to take a look at BBedit from BareBones (www.versiontracker.com or www.barebones.com). Under Windows I currently use UltraEdit which fits quite fine but needed a few changes to the wordlist.txt which is responsible for syntax-highlighting (if you want that changes just mail me). Another valuable tool is proton - unfortunately I don't have any links for those two. but dreamweaver is IMHO a good chose for itself (using it's built-in code-editor). I myself prefer working on BBedit only (without using dreamweaver). At Job I have to work on a windows machine where I prefere to use UltraEdit. happy coding Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: shaun murphy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 11:25 AM Subject: [PHP] PHP newbie alert Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
hi! Thanks for replying so quick. I use win2000 and have ultraedit so BBedit isnt really an option. Stefan Rusterholz [EMAIL PROTECTED] wrote in message 02cf01c17caf$bac57bb0$3c01a8c0@quasimodo">news:02cf01c17caf$bac57bb0$3c01a8c0@quasimodo... If you use Dreamweaver under MacOS I suggest to take a look at BBedit from BareBones (www.versiontracker.com or www.barebones.com). Under Windows I currently use UltraEdit which fits quite fine but needed a few changes to the wordlist.txt which is responsible for syntax-highlighting (if you want that changes just mail me). Another valuable tool is proton - unfortunately I don't have any links for those two. but dreamweaver is IMHO a good chose for itself (using it's built-in code-editor). I myself prefer working on BBedit only (without using dreamweaver). At Job I have to work on a windows machine where I prefere to use UltraEdit. happy coding Stefan Rusterholz, [EMAIL PROTECTED] -- interaktion gmbh Stefan Rusterholz Zürichbergstrasse 17 8032 Zürich -- T. +41 1 253 19 55 F. +41 1 253 19 56 W3 www.interaktion.ch -- - Original Message - From: shaun murphy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 04, 2001 11:25 AM Subject: [PHP] PHP newbie alert Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP newbie alert
I'd suggest Homesite: http://www.macromedia.com/software/homesite/ -Original Message- From: shaun murphy [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 04, 2001 2:25 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP newbie alert Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP newbie alert
Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? If you don't want to spend any money, there's a Homesite clone called !stPage 2000 at: http://www.evrsoft.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
On Tue, 2001-12-04 at 05:25, shaun murphy wrote: Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] I myself use VIM. Http://www.vim.org ( Yes, There IS a windows version) Pros: Very, Very Stable. Excellent Syntax higlighting Many, Many Features Cons: If you have never touched a 'vi' based UNIX editor, you probably cant use this. Dont let this deter you.. But it has a VERY steep learning curve -Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
EditPlus2, there might be a newer version, trial never runs out. HomeSite 4.5, there is a Macromedia version, 60 day trial, very very worthwhile for a purchase. --- Andrew Forgue [EMAIL PROTECTED] wrote: On Tue, 2001-12-04 at 05:25, shaun murphy wrote: Hello! Being one not to refuse a challenge, I have been asked to administer and update a PHP based website. I was wondering what a good editor is for such a task. I have been having a look at Dreamweaver as I use that quite a lot but are there any extensions I should be using? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] I myself use VIM. Http://www.vim.org ( Yes, There IS a windows version) Pros: Very, Very Stable. Excellent Syntax higlighting Many, Many Features Cons: If you have never touched a 'vi' based UNIX editor, you probably cant use this. Dont let this deter you.. But it has a VERY steep learning curve -Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] = dan mccullough Theres no such thing as a problem unless the servers are on fire! __ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
Okay, you brought it up ! ;-) EMACS. If you use Unix, then this is your supersuite. This is your Microsoft Office for plaintext editors. Pros: Easier to learn than vi Many man many many many features Supercustomizeable Integrates tightly with Unix operating system Cons: A little on the bloatware side vi is more widely available (at least it was back in the early 80s when a few MB of disk space was a big deal) vi is much more slim Knowing vi is useful, but I find I'm much more productive in emacs. And when I want to use an Aqua-compatible editor, I use BBEdit lite because I'm poor and it's pretty good (a tiny bit buggy on OS X). There's actually an emacs for OS X that I haven't gotten around to trying yet, maybe I'll give the compile a shot tonight. Erik On Tuesday, December 4, 2001, at 07:50 PM, Andrew Forgue wrote: I myself use VIM. Http://www.vim.org ( Yes, There IS a windows version) Pros: Very, Very Stable. Excellent Syntax higlighting Many, Many Features Cons: If you have never touched a 'vi' based UNIX editor, you probably cant use this. Dont let this deter you.. But it has a VERY steep learning curve -Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie alert
HomeSite is up to version 5. I use it primarily for the built-in FTP client, which makes website maintenance very, very easy. At 05:06 PM 12/4/2001, you wrote: EditPlus2, there might be a newer version, trial never runs out. HomeSite 4.5, there is a Macromedia version, 60 day trial, very very worthwhile for a purchase. Sliante, Richard S. Crawford http://www.mossroot.com AIM: Buffalo2K ICQ: 11646404 Y!: rscrawford MSN: [EMAIL PROTECTED] It is only with the heart that we see rightly; what is essential is invisible to the eye. --Antoine de Saint Exupéry Push the button, Max! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] php newbie - need advice
On Mon, 12 Nov 2001 15:16, Scott Dudley wrote: i'm new to php and need some advice. i have a site currently composed of static pages generated via a c program. i want to convert the site to php. the first page is an explorer-like table listing summary information. when a user clicks on a row in this table, they're taken to a detail page which presents the same information contained in the table of the calling page as well as a verbose description and an image. being a neophyte, my quandry is this... i have to select all of the data from my database table to render the explorer-like table and That's probably not exactly the case; there would presumably be no reason why you couldn't just select those details you want for the summary table? since i've already hit the database, don't want to have to do so again for the detail page. is there a standard way to handle such a thing? i don't want to depend on cookies or any client-side cacheing mechanism but want to keep it server side. the hosting service supports only php3. any and all recomendations appreciated. here's the site so you can see what i'm talking about: http://your-az-realtor.com Out of curiosity, why do you not want to make multiple accesses to the DB? It would seem to be the easiest, and probably best way of dealing with the problem. -- David Robley Techno-JoaT, Web Maintainer, Mail List Admin, etc CENTRE FOR INJURY STUDIES Flinders University, SOUTH AUSTRALIA Earth was interesting, and worth the money I paid for it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Php Newbie
Hi, i created a helloworld php file and put it in my inetpub/wwwroot/php folder and then tried to display it in the browser but all i saw was my html code. Can someone help please?! You'll need to configure IIS to parse your PHP files. Use the instruction below. If you wonder which one to use isapi or CGI I'd say for home developement it doesn't matter. CGI is said to be more stable but I had no problem with the isapi module with IIS. But anyway give it a thought to get Apache. To test your installation just use your helloworld or create a file with ?php phpinfo(); ? in it. hope it helps Johannes IIS 4.0+ (isapi): 1. Copy the php.ini-dist to your systemroot (the directory where you installed windows), rename it to php.ini, and edit it to fit your needs 2. Start the Microsoft Management Console or the Internet Services Manager, located in your Control Panel 3. Click on your webserver, and select properties 4. If you don't want to perform HTTP Authentication using PHP, you can (and should) skip this step. Under ISAPI Filters, add a new ISAPI filter. Use PHP as the filter name, and supply a path to the php4isapi.dll 5. Under Home Directory, click on the Configuration button. Add a new entry to the Application Mappings. Use the path the php4isapi.dll as the Executable, supply .php as the extension, leave Method exclusions, blank, and check the Script engine checkbox 6. Stop IIS completely 7. Start IIS again IIS 4.0+ (CGI) 1. Copy the php.ini-dist to your systemroot (the directory where you installed windows), rename it to php.ini, and edit it to fit your needs 2. Start the Microsoft Management Console (may appear as 'Internet Services Manager', either in your Windows NT 4.0 Option Pack branch or the Control Panel-Administrative Tools under Windows 2000). 3. Right click on your Web server node (will most probably appear as 'Default Web Server'), and select 'Properties'. 4. Under 'Home Directory', click on the 'Configuration' button. Add a new 5. entry to the Application Mappings; Use the path to php.exe as the Executable, supply .php as the extension, leave 'Method exclusions', blank, and check the Script engine checkbox. 6. Put a .php file under your Web server's document root and check if it works! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP Newbie, Experienced Porgrammer, Annoying fread() problem
[snip] for ($index = 0; $index sizeof($books); $index++) { $book_data_file = fopen("$thisdir/$books[$index]/book_info.dat", "r"); echo "pOpened $thisdir/$books[$index]/book_info.dat/p"; $book_data_in = fread($book_data_file, filesize($book_data_file)); ^ should be: filesize("$thisdir/$books[$index]/book_info.dat") echo "pbook_data_in = $book_data_in/p"; fclose($book_data_file); [snip] HTH James -- James Moore PHP QA Team [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP Newbie, Experienced Porgrammer, Annoying fread() problem
Hi John, @ 2:01:49 PM on 2/7/2001, [EMAIL PROTECTED] wrote: Please bear with me for a moment. I am new to PHP work, but have over 10 years experience in various other programming languages including C/C++ I'm just getting really frustrated here, and i'm hoping its a simple mistake. What I am running into is that ever file I open and read from, I never actually get any data. I know the data is in the file, but I don't get it. I can write to it fine. [...] If anyoen can clear this up for me, I would most appreciate it. I'm on a tight deadline, learning PHP as I go, and losing my mind on this seemingly simple excersise! Obviously, James has answered your question, but I'm curious as to why you aren't using a database for this particular task? Another suggestion, for the actual book data file(s) is to just include the 'cosmetic' information in with the actual $book_data when you write it to disk. IOW, instead of doing this: $book_data = explode("\n", $book_data_in); echo "ASIN:"; echo "$book_data[0]"; echo "br"; echo "Title:"; echo "$book_data[1]"; echo "br"; echo "Description:"; echo "$book_data[2]"; echo "p/p"; Why didn't you just write that information to the file from the very beginning? If you were to do that, all you'd need to do is use include() instead of 'module 2, the reads' It just seems like that would be a lot less painful. -Brian -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] PHP newbie question
http://www.php.net/manual/language.expressions.php snip One last thing worth mentioning is the truth value of expressions. In many events, mainly in conditional execution and loops, you're not interested in the specific value of the expression, but only care about whether it means TRUE or FALSE (PHP doesn't have a dedicated boolean type). The truth value of expressions in PHP is calculated in a similar way to perl. Any numeric non-zero numeric value is TRUE, zero is FALSE. Be sure to note that negative values are non-zero and are thus considered TRUE! The empty string and the string "0" are FALSE; all other strings are TRUE. With non-scalar values (arrays and objects) - if the value contains no elements it's considered FALSE, otherwise it's considered TRUE. /snip Since variables doesn't need to be declared it's regarded as set when used in an expression... hence $a is evaluated to "", or 0 if compared to numbers, false if compared to boolean. -Jrg -Original Message- From: Neil Zanella [mailto:[EMAIL PROTECTED]] Sent: 10. januar 2001 19:33 To: Toby Butzon Cc: PHP General Mailing List Subject: Re: [PHP] PHP newbie question On Wed, 10 Jan 2001, Toby Butzon wrote: : ?php if (! $a) print "Hello, World!"; // script 2 ? $a evaluates to false, the ! reverses it, and it prints "Hello, World!" What is bothering me is the following: if variables that are not assigned a value were to evaluate to false then since false is the same as the number 1 the following PHP script should print the number 1 but instead prints nothing: ?php if (! $a) print $a; ? How is this behavior justified? I could not find anything on this in the PHP manual. Thanks, -- Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] PHP newbie question
- Original Message - From: "Neil Zanella" [EMAIL PROTECTED] To: "Hsieh, Wen-Yang" [EMAIL PROTECTED] Cc: "PHP General Mailing List" [EMAIL PROTECTED] Sent: Wednesday, January 10, 2001 1:11 PM Subject: Re: [PHP] PHP newbie question On Wed, 10 Jan 2001, Hsieh, Wen-Yang wrote: "" is false. The following three seem to be the same in PHP3: 1) false 2) "" 3) 0 zero and an empty string were understood to be false. Still they are different. I guess that "" is automatically cast to 0 or to false wherever an integer is required. Where can I find the exact casting rules in PHP3/4 ? http://www.php.net/manual/language.types.type-juggling.php#language.types.ty pecasting Thanks, Neil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]