Re: [PHP] New to PHP and the list
On 9/11/2010 6:51 PM, Tom Sparks wrote: --- On Sun, 12/9/10, MikeB wrote: From: MikeB Subject: [PHP] New to PHP and the list To: php-general@lists.php.net Received: Sunday, 12 September, 2010, 9:37 AM Hello, I'm new to PHP and also new to using newsgroups/mailing lists directly. So if I make a mistake, please forgive me this once and I'll try to do better in the future. Please help me understand, my head is absolutely spinning and I can't get my mind around this. In the php.net site there is an example on uploading a file via a form. http://www.php.net/manual/en/features.file-upload.post-method.php start off simpler with this version http://www.w3schools.com/php/php_file_upload.asp I think I have that much under my belt, I'm more or less trying to dig a little deeper. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about news.php.net
If there is a more appropriate place to ask this, I apologize. Please point me in the right direction. I understand that the news server is based on a mailing list, but I can't handle another high-volume source dumping stuff into my email (even if I filter it into a separate folder) so I am trying to subscribe through the news group. However, getting access seems to be hit-and-miss, since I more often than not get a message that the connection to news.php.net timed out. Is this an indication that the server is just very busy? I don't get this on any other news server I'm using on the smae news reader and I have gotten this on two different news readers that I have tried. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about news.php.net
Daniel Brown wrote: I don't believe that we've been having any issues with the server, no. Are you using NNTP to connect? yes, NNTP. You may want to consider using the HTTP-based RSS and/or RDF feeds if it continues to be an issue. If this persists, I'll look into the alternatives you suggest, but that's another hill to climb when all I'm trying to do is learn PHP and web and mySQL and javascrip and... :) (not complaining, just that right now I've got a lot on my plate and the scope of new things just seem to keep expanding faster than I can get a handle on it). In addition, if you continue to have problems, file a bug report at http://bugs.php.net/ and we'll look into it further. Thanks, I did that. In the process I found a 2005 bug report that said nntp was deliberately throttled to discourage its use... :) As part of the bug report I included a link to an image of my nntp config. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about news.php.net
Daniel Brown wrote: On Mon, Sep 13, 2010 at 19:51, MikeB wrote: As part of the bug report I included a link to an image of my nntp config. I saw that, thanks. I'll look into creating a mirror of the news server, as well, for NNTP-only access. I won't lie and say that it's a priority, but I'll try to get to it as soon as I have time, Mike. That is much appreciated. I can understand the situation, mostly I just wanted to know that it wasn't something I'm doing wrong. ANything you can do to improve it is, of course, appreciated. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about news.php.net
Gary wrote: MikeB wrote: I understand that the news server is based on a mailing list, but I can't handle another high-volume source dumping stuff into my email (even if I filter it into a separate folder) so I am trying to subscribe through the news group. However, getting access seems to be hit-and-miss, since I more often than not get a message that the connection to news.php.net timed out. Tried nntp://news.gmane.org/gmane.comp.php.general ? Bingo! Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Question about news.php.net
Daniel Brown wrote: On Mon, Sep 13, 2010 at 19:51, MikeB wrote: As part of the bug report I included a link to an image of my nntp config. I saw that, thanks. I'll look into creating a mirror of the news server, as well, for NNTP-only access. I won't lie and say that it's a priority, but I'll try to get to it as soon as I have time, Mike. You must have already done something. It's working a lot better today. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about news.php.net
MikeB wrote: Daniel Brown wrote: On Mon, Sep 13, 2010 at 19:51, MikeB wrote: As part of the bug report I included a link to an image of my nntp config. I saw that, thanks. I'll look into creating a mirror of the news server, as well, for NNTP-only access. I won't lie and say that it's a priority, but I'll try to get to it as soon as I have time, Mike. You must have already done something. It's working a lot better today. Thanks. Perhaps I spoke too soon. It seems intermittent. Lots of denials today. However, I've switched to the gmane list as recommended by somone else on this thread and that works a treat, so I may just do an unsubscribe here to get rid of the annoying timeout messages. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] not able to connect to MySQL
I have defined (just for testing) a user in my SQL named "pubuser" and granted it access to a database "publications." Of course I also created the database and two tables. I can access and manipulate the tables via phpMyAdmin and I can log in to sql using pubuser via the command-line interface. I have the following php code: also I have a test web page: Connect to SQL host: $db_hostname user: $db_username password: $db_password for database: $db_database"; print_r($db_server); ?> If I try to run this, it briefly says "connecting to localhost" and then indefinitely it says "waiting for localhost..." If I comment out the connect statement, the rest runs. What should I look for? Thanks MikeB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: not able to connect to MySQL
Bastien Koert wrote: On Mon, Sep 20, 2010 at 3:37 PM, MikeB wrote: I have defined (just for testing) a user in my SQL named "pubuser" and granted it access to a database "publications." Of course I also created the database and two tables. I can access and manipulate the tables via phpMyAdmin and I can log in to sql using pubuser via the command-line interface. I have the following php code: also I have a test web page: Connect to SQL host: $db_hostname user: $db_username password: $db_password for database: $db_database"; print_r($db_server); ?> If I try to run this, it briefly says "connecting to localhost" and then indefinitely it says "waiting for localhost..." If I comment out the connect statement, the rest runs. What should I look for? Thanks MikeB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you gave the priv through phpmyadmin, you might want to try running FLUSH PRIVILEGES to get those new ones to take effect. I did that - in fact, I shut down apache and mysql and restarted then as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Array question
I have the following code: $query = "SELECT * FROM classics"; $result = mysql_query($query); if (!$result) die ("Database access failed: " . mysql_error()); $rows = mysql_num_rows($result); for ($j = 0 ; $j < $rows ; ++$j) { $results[] = mysql_fetch_array($result); } mysql_close($db_server); My question, in the loop, why does tha author use: $results[] = mysql_fetch_array($result); instead of (as I would expect): $results[$j] = mysql_fetch_array($result);? What PHP magic is at work here? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Controlling Output Buffering via php.ini
I want to turn off output buffering. In the php.ini section I found this and changed it as follows: ; Note: Output buffering can also be controlled via Output Buffering Control ; functions. ; Possible Values: ; On = Enabled and buffer is unlimited. (Use with caution) ; Off = Disabled ; Integer = Enables the buffer and sets its maximum size in bytes. ; Note: This directive is hardcoded to Off for the CLI SAPI ; Default Value: Off ; Development Value: 4096 ; Production Value: 4096 ; http://php.net/output-buffering ; Changed by MikeB 09/27/2010 ;output_buffering = 4096 output_buffering = Off Previously when I did a phpinfo(), I got the value of 4096. After my change, I get: output_bufferingno value Some other phpinfo() values (eg. Register Globals) display an "Off" value. Did I make the change correctly or is the syntax different? I did go to the url referenced above, but nowhere that I searched could I find the way to specify the value in the php.ini file. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] reporting spam in PHP manual?
Came across this entry as a user comment in the php.net manual. http://www.php.net/manual/en/language.exceptions.php#100089 Couldn't see how to report it so it could be removed. Maybe someone that knows how can tell me, or report it themselves? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Buffering output to allow headers late in code?
I'm working through my class on PHP and I tried to put information from my sign-on process in the navbar. This didn't work well, since I had to reload the page to see it as the navbar was constructed earlier in the code than the signon process. (Hard to explain, as we are building a "dynamic" web page with lots of include files to fill in the main contnt portion of the page.) My instructor suggested that I do the reload of the page via php header("Location: index.php"); after the sign-in. To do this, I have to turn on output buffering. I recall struggling to turn off output buffering since someone here recommended against it. Any thoughts on this? Is this just a "quick and dirty" bypass for my problem, accepted practice, a really bad idea, or customary practice? I think I can code around this with some effort by putting a switch statement in the header of the index.php, but that may be clumsy as parts of the same web page will then be processed in two different areas. What to do? Thanks for any advice. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Buffering output to allow headers late in code?
chris h wrote: I'm working through my class on PHP and I tried to put information from my sign-on process in the navbar. This didn't work well, since I had to reload the page to see it as the navbar was constructed earlier in the code than the signon process. (Hard to explain, as we are building a "dynamic" web page with lots of include files to fill in the main contnt portion of the page.) I don't know if this will be much help, but I try to do all the controller / model work before I mess with the view side. So the controller starts off with the ball, then he and the model pass it between each other a few times until the controller finally hands it over to the view, who does her magic and makes the score! ... Perhaps that analogy went to far. At any rate! Ideally the sign-on task would be done before any tasks that would use sign-on data. Additionally, the layout of your page should not necessarily dictate the order of any tasks (i.e. the sign-on box being below the welcome box should not mean that the sign-on task gets done before the welcome task). Hope that helps! Chris. I guess that is kind of how I was thinking I might have to rewrite the code - but that seems to be a major departure from the current "architecture" of the website we're developing in the course and I'm kind of worried that it might get harder and harder to follow along in the lessons if I deviate too much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Buffering output to allow headers late in code?
Peter Lind wrote: Just out of curiosity: why were you told to switch off output buffering? Regards Peter I can't find the thread now, but it was in regards to my early experiments with cookies. I was creating cookies and it worked mid-code, since buffering was active. Then someone said that using buffering was a bad idea and I should disable it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php