[PHP] Set up MySQL + Apache 2.2.4 on Win XP.
PHP'ers, Please do not curse me for this. I am having a tough time to get this up and running. Can someone point me to a document which will help me do configure so that I can start learning and working on PHP ASAP? Please. I have attached the files under consideration. Here is my details : MySQL - 5.x Apache - apache_2.2.4-win32-x86-no_ssl.msi PHP base - C:\PHP Regards, Shreyas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Ash, Thanks for the quick reply. I am downloading Easyphp 3.0 right now and see how it goes. But just to understand how this all works, will it work with Eclipse, too? I am using Ganymede. Regards, Shreyas On Tue, Jun 1, 2010 at 9:55 PM, Ashley Sheridan wrote: > On Tue, 2010-06-01 at 21:47 +0530, Shreyas wrote: > > PHP'ers, > > > > Please do not curse me for this. > > > > I am having a tough time to get this up and running. Can someone point me > to a document which will help me do configure so that I can start learning > and working on PHP ASAP? Please. I have attached the files under > consideration. > > > > Here is my details : > > > > MySQL - 5.x > > > > Apache - apache_2.2.4-win32-x86-no_ssl.msi > > > > PHP base - C:\PHP > > > > Regards, > Shreyas > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > Rather than install the separate components have you looked at a pre-built > stack? A lot of people swear by the WAMP install on Windows. For my own > experience on Windows, I've found EasyPHP to be an absolute doddle to use, > and can have you up and running with all the modules you need within > minutes. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Alright! Point duly noted. I only did not want to spam the list with my very rudimentary questions. On Tue, Jun 1, 2010 at 10:33 PM, Ashley Sheridan wrote: > On Tue, 2010-06-01 at 22:29 +0530, Shreyas wrote: > > You have been of great help, Ash. > > > > I just did some progress and I typed in http://localhost and I see the > easyphp page. Do you know how I can write my own apps now? > > > > > > On Tue, Jun 1, 2010 at 10:26 PM, Ashley Sheridan < > a...@ashleysheridan.co.uk> wrote: > > > On Tue, 2010-06-01 at 22:24 +0530, Shreyas wrote: > > I did and I miserably failed. I feel like giving up on learning PHP now > with all these set-up now. Aaah! > > > I have uninstalled MySQL now and trying to see how it goes. > > > ---Shreyas > > On Tue, Jun 1, 2010 at 10:16 PM, Ashley Sheridan > wrote: > > > On Tue, 2010-06-01 at 22:13 +0530, Shreyas wrote: > > Got it! I already have MySQL and Apache installed for another Java project > and now it tells me certain ports are used. Where can I look up for answers > like these? > > > --Shreyas > > On Tue, Jun 1, 2010 at 10:10 PM, Ashley Sheridan > wrote: > > > On Tue, 2010-06-01 at 22:02 +0530, Shreyas wrote: > > Ash, > > Thanks for the quick reply. I am downloading Easyphp 3.0 right now and see > how it goes. But just to understand how this all works, will it work with > Eclipse, too? I am using Ganymede. > > > Regards, > Shreyas > > On Tue, Jun 1, 2010 at 9:55 PM, Ashley Sheridan > wrote: > > > On Tue, 2010-06-01 at 21:47 +0530, Shreyas wrote: > > > > PHP'ers, > > > > > > > > Please do not curse me for this. > > > > > > > > I am having a tough time to get this up and running. Can someone point me > > to a document which will help me do configure so that I can start learning > > and working on PHP ASAP? Please. I have attached the files under > > consideration. > > > > > > > > Here is my details : > > > > > > > > MySQL - 5.x > > > > > > > > Apache - apache_2.2.4-win32-x86-no_ssl.msi > > > > > > > > PHP base - C:\PHP > > > > > > > > Regards, > > Shreyas > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > Rather than install the separate components have you looked at a pre-built > > stack? A lot of people swear by the WAMP install on Windows. For my own > > experience on Windows, I've found EasyPHP to be an absolute doddle to use, > > and can have you up and running with all the modules you need within > > minutes. > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > > > > > > > The editor you use won't matter. EasyPHP installs Apache, MySQL and PHP in > one install, and gets it all working together easily on Windows. > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > > > > > > > -- > Regards, > Shreyas > > > > The install should allow you to choose different ports, but as you already > have Apache and MySQL installed, have you looked to download the PHP Windows > installation file from php.net and run that? It should let you attach it > to an existing Apache install, although I'm not familiar with installing PHP > this way on a Windows machine. > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > > > > > > -- > Regards, > Shreyas > > > > I'm not so good with diagnosing Windows problems these days, haven't > used it seriously for a few years now, maybe someone else on the list can > help? > > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > > > > > -- > Regards, > Shreyas > > > EasyPHP keeps it's web root by default at C:\Program Files\EasyPHP\www (or > thereabouts) so you can just create and edit files in here. > > > Ps, use the reply to list (or failing that the reply to all) feature in > your email client to keep the messages on list so that other people can see, > respond to and benefit from the thread. > > Ps.ps. please try not to top post. The list rules say that we should all > bottom post in order to keep threads logical. > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Thanks, Ash. I was able to set things up with EasyPHP 3.0. I had to uninstall my MySQL and Apache to get this work. I have to figure out how I can ask my java code to look at a separate instance of MYSQL while the EasyPHP's instance runs too. Anyone has encountered this before? Regards, Shreyas On Tue, Jun 1, 2010 at 10:58 PM, Ashley Sheridan wrote: > On Tue, 2010-06-01 at 22:54 +0530, Shreyas wrote: > > Alright! Point duly noted. > > I only did not want to spam the list with my very rudimentary questions. > > On Tue, Jun 1, 2010 at 10:33 PM, Ashley Sheridan > wrote: > > > On Tue, 2010-06-01 at 22:29 +0530, Shreyas wrote: > > > > You have been of great help, Ash. > > > > > > > > I just did some progress and I typed in http://localhost and I see the > > easyphp page. Do you know how I can write my own apps now? > > > > > > > > > > > > On Tue, Jun 1, 2010 at 10:26 PM, Ashley Sheridan < > > a...@ashleysheridan.co.uk> wrote: > > > > > > On Tue, 2010-06-01 at 22:24 +0530, Shreyas wrote: > > > > I did and I miserably failed. I feel like giving up on learning PHP now > > with all these set-up now. Aaah! > > > > > > I have uninstalled MySQL now and trying to see how it goes. > > > > > > ---Shreyas > > > > On Tue, Jun 1, 2010 at 10:16 PM, Ashley Sheridan > > wrote: > > > > > > On Tue, 2010-06-01 at 22:13 +0530, Shreyas wrote: > > > > Got it! I already have MySQL and Apache installed for another Java project > > and now it tells me certain ports are used. Where can I look up for answers > > like these? > > > > > > --Shreyas > > > > On Tue, Jun 1, 2010 at 10:10 PM, Ashley Sheridan > > wrote: > > > > > > On Tue, 2010-06-01 at 22:02 +0530, Shreyas wrote: > > > > Ash, > > > > Thanks for the quick reply. I am downloading Easyphp 3.0 right now and see > > how it goes. But just to understand how this all works, will it work with > > Eclipse, too? I am using Ganymede. > > > > > > Regards, > > Shreyas > > > > On Tue, Jun 1, 2010 at 9:55 PM, Ashley Sheridan > > wrote: > > > > > On Tue, 2010-06-01 at 21:47 +0530, Shreyas wrote: > > > > > > PHP'ers, > > > > > > > > > > > > Please do not curse me for this. > > > > > > > > > > > > I am having a tough time to get this up and running. Can someone point me > > > to a document which will help me do configure so that I can start learning > > > and working on PHP ASAP? Please. I have attached the files under > > > consideration. > > > > > > > > > > > > Here is my details : > > > > > > > > > > > > MySQL - 5.x > > > > > > > > > > > > Apache - apache_2.2.4-win32-x86-no_ssl.msi > > > > > > > > > > > > PHP base - C:\PHP > > > > > > > > > > > > Regards, > > > Shreyas > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > Rather than install the separate components have you looked at a pre-built > > > stack? A lot of people swear by the WAMP install on Windows. For my own > > > experience on Windows, I've found EasyPHP to be an absolute doddle to use, > > > and can have you up and running with all the modules you need within > > > minutes. > > > > > > Thanks, > > > Ash > > > http://www.ashleysheridan.co.uk > > > > > > > > > > > > > > > > > > > > > The editor you use won't matter. EasyPHP installs Apache, MySQL and PHP in > > one install, and gets it all working together easily on Windows. > > > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > > > > > > > > > > > > > -- > > Regards, > > Shreyas > > > > > > > > The install should allow you to choose different ports, but as you already > > have Apache and MySQL installed, have you looked to download the PHP Windows > > installation file from php.net and run that? It should let you attach it > > to an existing Apache install, although I'm not familiar with installing PHP > > this way on a Windows machine. > > > > > > Thanks, &
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Ash, Not sure if that would work here. I gave that a shot and there was a port conflict. I actually want to learn how to set PHP environment in bits and pieces without a WAMP. Will see what I can do there. Regards, Shreyas On Wed, Jun 2, 2010 at 12:55 AM, Ashley Sheridan wrote: > On Wed, 2010-06-02 at 00:46 +0530, Shreyas wrote: > > Thanks, Ash. > > I was able to set things up with EasyPHP 3.0. I had to uninstall my MySQL > and Apache to get this work. I have to figure out how I can ask my java code > to look at a separate instance of MYSQL while the EasyPHP's instance runs > too. > > Anyone has encountered this before? > > Regards, > Shreyas > > On Tue, Jun 1, 2010 at 10:58 PM, Ashley Sheridan > wrote: > > > On Tue, 2010-06-01 at 22:54 +0530, Shreyas wrote: > > > > Alright! Point duly noted. > > > > I only did not want to spam the list with my very rudimentary questions. > > > > On Tue, Jun 1, 2010 at 10:33 PM, Ashley Sheridan > > wrote: > > > > > On Tue, 2010-06-01 at 22:29 +0530, Shreyas wrote: > > > > > > You have been of great help, Ash. > > > > > > > > > > > > I just did some progress and I typed in http://localhost and I see the > > > easyphp page. Do you know how I can write my own apps now? > > > > > > > > > > > > > > > > > > On Tue, Jun 1, 2010 at 10:26 PM, Ashley Sheridan < > > > a...@ashleysheridan.co.uk> wrote: > > > > > > > > > On Tue, 2010-06-01 at 22:24 +0530, Shreyas wrote: > > > > > > I did and I miserably failed. I feel like giving up on learning PHP now > > > with all these set-up now. Aaah! > > > > > > > > > I have uninstalled MySQL now and trying to see how it goes. > > > > > > > > > ---Shreyas > > > > > > On Tue, Jun 1, 2010 at 10:16 PM, Ashley Sheridan > > > > > > wrote: > > > > > > > > > On Tue, 2010-06-01 at 22:13 +0530, Shreyas wrote: > > > > > > Got it! I already have MySQL and Apache installed for another Java project > > > and now it tells me certain ports are used. Where can I look up for > > > answers > > > like these? > > > > > > > > > --Shreyas > > > > > > On Tue, Jun 1, 2010 at 10:10 PM, Ashley Sheridan > > > > > > wrote: > > > > > > > > > On Tue, 2010-06-01 at 22:02 +0530, Shreyas wrote: > > > > > > Ash, > > > > > > Thanks for the quick reply. I am downloading Easyphp 3.0 right now and see > > > how it goes. But just to understand how this all works, will it work with > > > Eclipse, too? I am using Ganymede. > > > > > > > > > Regards, > > > Shreyas > > > > > > On Tue, Jun 1, 2010 at 9:55 PM, Ashley Sheridan > > > wrote: > > > > > > > On Tue, 2010-06-01 at 21:47 +0530, Shreyas wrote: > > > > > > > > PHP'ers, > > > > > > > > > > > > > > > > Please do not curse me for this. > > > > > > > > > > > > > > > > I am having a tough time to get this up and running. Can someone point > > > > me > > > > to a document which will help me do configure so that I can start > > > > learning > > > > and working on PHP ASAP? Please. I have attached the files under > > > > consideration. > > > > > > > > > > > > > > > > Here is my details : > > > > > > > > > > > > > > > > MySQL - 5.x > > > > > > > > > > > > > > > > Apache - apache_2.2.4-win32-x86-no_ssl.msi > > > > > > > > > > > > > > > > PHP base - C:\PHP > > > > > > > > > > > > > > > > Regards, > > > > Shreyas > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) > > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > > Rather than install the separate components have you looked at a > > > > pre-built > > > > stack? A lot of people swear by the WAMP install on Windows. For my own > > > > experience on Windows, I've found EasyPHP to be an absolute doddle to > > > > use, > > > > and can have you up and running
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Tried that just now and didn't work. The Java code which talks to the DB has a different username and password than the one installed with EasyPHP. I might be missing something very silly here. Damn me! --Shreyas The On Wed, Jun 2, 2010 at 1:10 AM, Ashley Sheridan wrote: > On Wed, 2010-06-02 at 01:06 +0530, Shreyas wrote: > > Ash, > > > > Not sure if that would work here. I gave that a shot and there was a port > conflict. > > > > I actually want to learn how to set PHP environment in bits and pieces > without a WAMP. Will see what I can do there. > > > > Regards, > > Shreyas > > On Wed, Jun 2, 2010 at 12:55 AM, Ashley Sheridan < > a...@ashleysheridan.co.uk> wrote: > > > On Wed, 2010-06-02 at 00:46 +0530, Shreyas wrote: > > Thanks, Ash. > > I was able to set things up with EasyPHP 3.0. I had to uninstall my MySQL > and Apache to get this work. I have to figure out how I can ask my java code > to look at a separate instance of MYSQL while the EasyPHP's instance runs > too. > > Anyone has encountered this before? > > Regards, > Shreyas > > On Tue, Jun 1, 2010 at 10:58 PM, Ashley Sheridan > wrote: > > > On Tue, 2010-06-01 at 22:54 +0530, Shreyas wrote: > > > > Alright! Point duly noted. > > > > I only did not want to spam the list with my very rudimentary questions. > > > > On Tue, Jun 1, 2010 at 10:33 PM, Ashley Sheridan > > wrote: > > > > > On Tue, 2010-06-01 at 22:29 +0530, Shreyas wrote: > > > > > > You have been of great help, Ash. > > > > > > > > > > > > I just did some progress and I typed in http://localhost and I see the > > > easyphp page. Do you know how I can write my own apps now? > > > > > > > > > > > > > > > > > > On Tue, Jun 1, 2010 at 10:26 PM, Ashley Sheridan < > > > a...@ashleysheridan.co.uk> wrote: > > > > > > > > > On Tue, 2010-06-01 at 22:24 +0530, Shreyas wrote: > > > > > > I did and I miserably failed. I feel like giving up on learning PHP now > > > with all these set-up now. Aaah! > > > > > > > > > I have uninstalled MySQL now and trying to see how it goes. > > > > > > > > > ---Shreyas > > > > > > On Tue, Jun 1, 2010 at 10:16 PM, Ashley Sheridan > > > > > > wrote: > > > > > > > > > On Tue, 2010-06-01 at 22:13 +0530, Shreyas wrote: > > > > > > Got it! I already have MySQL and Apache installed for another Java project > > > and now it tells me certain ports are used. Where can I look up for > > > answers > > > like these? > > > > > > > > > --Shreyas > > > > > > On Tue, Jun 1, 2010 at 10:10 PM, Ashley Sheridan > > > > > > wrote: > > > > > > > > > On Tue, 2010-06-01 at 22:02 +0530, Shreyas wrote: > > > > > > Ash, > > > > > > Thanks for the quick reply. I am downloading Easyphp 3.0 right now and see > > > how it goes. But just to understand how this all works, will it work with > > > Eclipse, too? I am using Ganymede. > > > > > > > > > Regards, > > > Shreyas > > > > > > On Tue, Jun 1, 2010 at 9:55 PM, Ashley Sheridan > > > wrote: > > > > > > > On Tue, 2010-06-01 at 21:47 +0530, Shreyas wrote: > > > > > > > > PHP'ers, > > > > > > > > > > > > > > > > Please do not curse me for this. > > > > > > > > > > > > > > > > I am having a tough time to get this up and running. Can someone point > > > > me > > > > to a document which will help me do configure so that I can start > > > > learning > > > > and working on PHP ASAP? Please. I have attached the files under > > > > consideration. > > > > > > > > > > > > > > > > Here is my details : > > > > > > > > > > > > > > > > MySQL - 5.x > > > > > > > > > > > > > > > > Apache - apache_2.2.4-win32-x86-no_ssl.msi > > > > > > > > > > > > > > > > PHP base - C:\PHP > > > > > > > > > > > > > > > > Regards, > > > > Shreyas > > > > > > > > -- > > > > PHP General Mailing List (http://www.php.net/) >
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Since I have another Java app running and points to the same port 3306, when I tried to configure with EasyPHP, I had a conflict. How about configuring EasyPHP at a different port? In that ways, EasyPHP's MYSQL and my external MySQL will never have a conflicting situation. Does that make sense? --Shreyas On Wed, Jun 2, 2010 at 3:25 AM, Ashley Sheridan wrote: > On Wed, 2010-06-02 at 04:48 +0700, shiplu wrote: > > You can consider XAMPP. (www.apachefriends.org/en/xampp.html) > It has everything in it. > > Mysql server, Apache server, PHPMyAdmin, PHP, Perl and an FTP server > Just install it and its configured. > > Just put your files in htdocs and they will be up and running. > > I use this to package my intranet php application. > > > Shiplu Mokadd.im > My talks, http://talk.cmyweb.net > Follow me, http://twitter.com/shiplu > SUST Programmers, http://groups.google.com/group/p2psust > Innovation distinguishes bet ... ... (ask Steve Jobs the rest) > > > > He's got that much (with the exception of the FTP server) up and running > with EasyPHP. The issue he has now is getting his existing Java app to use > the MySQL server from EasyPHP to avoid conflicting ports from the two MySQL > systems installed. It can be run all as one with different users, and might > be better now asking a MySQL list, unless anyone on here knows an easier > way? > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Right, Shilpu. I'll try that. What would be the exact installer which will let me have the MySQL Server and the Query browser? I know this is the wrong forum but I am just giving it a shot. When I do Start -> All Programs -> MYSQL, I used to get only above options. I have lost the installer and the actual MySQL website has quite a lot of things. --Shreyas On Wed, Jun 2, 2010 at 4:08 AM, shiplu wrote: > > On Wed, Jun 2, 2010 at 5:32 AM, Shreyas wrote: > >> Since I have another Java app running and points to the same port 3306, >> when I tried to configure with EasyPHP, I had a conflict. >> >> How about configuring EasyPHP at a different port? In that ways, EasyPHP's >> MYSQL and my external MySQL will never have a conflicting situation. >> >> Does that make sense? >> >> --Shreyas >> >> > locate my.cnf file. Its in your mysql directory. And your mysql directory > is somewhere in wamp install directory. > Open the file with notepad/wordpad and change the port number. > Its written just like this, > port= 3306 > > Change is to > port= 3307 or whatever port you like. > > Then restart mysql. > > But remember, all you php app need to connect mysql through that 3307 port > which is not standard. > So mysql_connect() functions params should be tweaked. > > Shiplu Mokadd.im > My talks, http://talk.cmyweb.net > Follow me, http://twitter.com/shiplu > SUST Programmers, http://groups.google.com/group/p2psust > Innovation distinguishes bet ... ... (ask Steve Jobs the rest) > > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP.
Bob, That was a separate installer. It was nothing to do with another software. --Shreyas On Wed, Jun 2, 2010 at 7:19 PM, Bob McConnell wrote: > From: Shreyas > > > What would be the exact installer which will let me have the MySQL > Server > > and the Query browser? I know this is the wrong forum but I am just > giving > > it a shot. When I do Start -> All Programs -> MYSQL, I used to get > only > > above options. I have lost the installer and the actual MySQL website > has > > quite a lot of things. > > I don't know anything about the MySQL toy, but from scanning this thread > you already have a server installed if your java app is talking to it on > port 3306. You are now trying to install a second server on the same > computer, which can only be done if you change the port number. > > How did you install the first server? Was it part of the java install or > did one of the other packages you installed put it there? Do you still > have the documents for that package with the default users and > passwords? > > Bob McConnell > -- Regards, Shreyas
Re: [PHP] Inserting, storing, outputting dates and selections
I can try to answer the second one but would wait for the PHP gurus to chime in. Can't you have Choice=1 with selected="true" by default? On the PHP end, you can get the value of whatever was selected. Regards, Shreyas On Thu, Jun 3, 2010 at 1:50 AM, David Mehler wrote: > Hello, > I've got two questions which are probably fairly simple, my issue is > i'm staring at this so long it's blurring together. >I'm working on a form to insert data in to a mysql database. I've > got > a startdate and and enddate field in the database both of type DATE, > i'm needing this as i'm wanting to do a calculation against the date > and only display records greater than or equal to the current date. My > understanding is dates have to be entered as 2010-06-02 with this > format. >I'm having several issues: the first of which is I entered a date as > probably a user would as June 2, 2010 and on the display page got all > zeroes, is there a way i can be more flexible with my data entry, > enter it, then store it in the format mysql needs? > My second issue is that the startdate field is NOT NULL while the > enddate field is. On submission I only want those forms that are > actually in the post data to get inserted in to the database, and > displayed, i.e. if enddate was not entered I shouldn't see all zeroes > in the field in the database, if using the mysql commandline client, > or all zeroes in displayed output. I'm not sure how to conditionally > insert or display a field based on whether it's set. > My last issue, not on dates, is on a selection box. I've got two > choices to choose from, choice1 and choice2 just for this example. If > a user goes through and selects nothing I want choice1 to be > automatically selected on form submission, if a user selects choice2 > then the form should go with that. Here's my code. > > > Choose*: > > - choice1 - > - choice2 - > > > > On form submission the php script processes it and enters an empty > field in the database if the user doesn't select an option. > Thanks. > Dave. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP
All, Finally, the 28th reply seems to have brought this thread to an end. Yes, persistence finally got me there! Special thanks to Ash. I am able to run both my Java code and php code on the same port (though nothing database conversations are happening) from the same machine. Here's the set-up : MySQL Server 5.1 + Query Browser : port 3306. This has a schema called as NS which is referenced by my Java code. EasyPHP : This is running in a diferent location with its stack in C:\. Fix : I knew all I had to do was a drop of my NS schema to a folder called data and from nowhere I crashed into this : C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data. I dropped my NS schema there; checked the query browser and there it was! Compiled my Java code and I was able to get back to my previous environment. So, no port conflicts, no different usernames. So far so good. Talk to you all soon as I am gearing up with programming questions now. --Shreyas On Thu, Jun 3, 2010 at 1:02 AM, Shreyas wrote: > Bob, > > That was a separate installer. It was nothing to do with another software. > > --Shreyas > > > On Wed, Jun 2, 2010 at 7:19 PM, Bob McConnell wrote: > >> From: Shreyas >> >> > What would be the exact installer which will let me have the MySQL >> Server >> > and the Query browser? I know this is the wrong forum but I am just >> giving >> > it a shot. When I do Start -> All Programs -> MYSQL, I used to get >> only >> > above options. I have lost the installer and the actual MySQL website >> has >> > quite a lot of things. >> >> I don't know anything about the MySQL toy, but from scanning this thread >> you already have a server installed if your java app is talking to it on >> port 3306. You are now trying to install a second server on the same >> computer, which can only be done if you change the port number. >> >> How did you install the first server? Was it part of the java install or >> did one of the other packages you installed put it there? Do you still >> have the documents for that package with the default users and >> passwords? >> >> Bob McConnell >> > > > > -- > Regards, > Shreyas > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP
Shiplu, Not sure what you meant by that. I never had to restore anything. Would be happy to know if I have misunderstood anything. Regards, Shreyas On Thu, Jun 3, 2010 at 4:52 AM, shiplu wrote: > Actually you just restore your NS schema in the new EasyPHP stack. > > Shiplu Mokadd.im > My talks, http://talk.cmyweb.net > Follow me, http://twitter.com/shiplu > SUST Programmers, http://groups.google.com/group/p2psust > Innovation distinguishes bet ... ... (ask Steve Jobs the rest) > -- Regards, Shreyas
Re: [PHP] Set up MySQL + Apache 2.2.4 on Win XP
Ash - Yes, the service was stopped and then it was copied. --Shreyas On Thu, Jun 3, 2010 at 7:07 PM, Ashley Sheridan wrote: > On Thu, 2010-06-03 at 08:29 -0400, Bob McConnell wrote: > > From: Shreyas > > > Not sure what you meant by that. I never had to restore anything. > Would be > > happy to know if I have misunderstood anything. > > > On Thu, Jun 3, 2010 at 4:52 AM, shiplu wrote: > > > >> Actually you just restore your NS schema in the new EasyPHP stack. > >> > > The fact that you were able to add your schema by simply copying it into > the correct directory is a happy coincidence, or more likely a serious > bug in MySQL. There may be some system tables that were not updated to > reflect the presence of that schema, so some features may not work with > it. > > The correct way to move a database is to back it up on the original > server, then restore it on the new one. That way all system tables would > be correctly updated by the server. > > Bob McConnell > > > > On more than one occassion I've just copied the data files from one > location to another to move the database from one server to another. You do > have to ensure that the MySQL service has been stopped while you do this, > but aside from that there's nothing wrong with doing this. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] PHP Form submitting to MySQL not working...
Steve, SERVER_SOFTWARE is a variable that will give you which apache version you are actually using. Just drop a one - liner in a test.php as this : * * * * You can look for the above variable. Any other ideas others may have, please share. On Thu, Jun 3, 2010 at 9:31 PM, HallMarc Websites < sa...@hallmarcwebsites.com> wrote: > > > -Original Message- > From: Jim Lucas [mailto:li...@cmsws.com] > Sent: Thursday, June 03, 2010 11:38 AM > To: php General List > Cc: Steve Marquez > Subject: Re: [PHP] PHP Form submitting to MySQL not working... > > Steve Marquez wrote: > > I am running Apache (not sure which version, where do I find that?) it is > running on a Macbook Pro. > > The error happened when I submitted the form. > > Sorry, should have been more specific. Where did you see the error? In > your > browser, error logs of your web server, etc... ? > > If this error was displayed in your browser, you should look in your apache > error log file at that corresponding time to see if it has any more > information. > > > > > The MySQL DB is hosted locally on my machine. > > > > No cat here at the office, no children either, they are all at home. > > > > :) > > > > > -- > Jim Lucas > > A: Maybe because some people are too annoyed by top-posting. > Q: Why do I not get an answer to my question(s)? > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > On a side note; yes, as you can see I am still alive and well. Business has > slowed down enough that I had time to actually read a few posts! > > Marc Hall > HallMarc Websites > www.hallmarcwebsites.com > > > > __ Information from ESET Smart Security, version of virus signature > database 5169 (20100603) __ > > The message was checked by ESET Smart Security. > > http://www.eset.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas
[PHP] CakePHP, alternatives?
Folks, Just quite could not stop taking your inputs before I start my learning curve to shape up. Should I use one of these frameworks or just *K*eep *I*t *S*imple and *S*tupid and learn it the traditional way? Thoughts? -- Regards, Shreyas
Re: [PHP] PHP Form submitting to MySQL not working...
Steve, Do you know where Apache is installed? If yes, you have something like error.log and access.log. Find them and nail them them down. I am a novice, too and the best way to learn is to answer here and getting corrected by other PHP gurus! So, all in the name of learning! :) --Shreyas On Thu, Jun 3, 2010 at 11:28 PM, Steve Marquez wrote: > Strangest thing... it just started working again. Odd. > > Is there an easy way to view the error logs? As you can tell, I am still a > novice at this. > I am on Apache2 > > Thanks for your help. > > -- > Steve Marquez > Marquez Design > e-mail: smarq...@marquez-design.com > web: http://www.marquez-design.com > phone: 479-648-0325 > > > On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote: > > > Steve Marquez wrote: > >> Good morning, > >> > >> I have a PHP form that I have been using for some time now on a Macbook > Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But > this morning, when I submitted (it is a journaling application) it came up > with the following error: > >> > >> No such file or directory > >> > >> Can anyone point me in the right direction to fix this? Have you ever > seen this before? > >> > >> Thanks, > >> > >> Steve Marquez > > > > Where exactly did you see this error? > > > > 1) In your browser when you tried loading the form? > > 2) In your browser when you submitted the form? > > 3) In the error logs of your web server? > > > > Other questions: > > > > What type of web server are you running? > > > > Did your cat stomp on your keyboard? > > > > Are the files stored locally or are they on a network/remote drive? > > > > Children doing things they should not be doing? (Happened to me once...) > > > > Are you accessing the files via http://localhost/... ?? or as a local > file? > > > > -- > > Jim Lucas > > > > A: Maybe because some people are too annoyed by top-posting. > > Q: Why do I not get an answer to my question(s)? > > A: Because it messes up the order in which people normally read text. > > Q: Why is top-posting such a bad thing? > > -- Regards, Shreyas
Re: [PHP] PHP Form submitting to MySQL not working...
True. Since I am a Windows user, I find it here : *C:\Program Files\EasyPHP 3.0\apache\logs* --Shreyas On Fri, Jun 4, 2010 at 12:27 AM, Ashley Sheridan wrote: > On Fri, 2010-06-04 at 00:25 +0530, Shreyas wrote: > > Steve, > > Do you know where Apache is installed? If yes, you have something like > error.log and access.log. Find them and nail them them down. > > I am a novice, too and the best way to learn is to answer here and getting > corrected by other PHP gurus! So, all in the name of learning! :) > > --Shreyas > > On Thu, Jun 3, 2010 at 11:28 PM, Steve Marquez > wrote: > > > Strangest thing... it just started working again. Odd. > > > > Is there an easy way to view the error logs? As you can tell, I am still a > > novice at this. > > I am on Apache2 > > > > Thanks for your help. > > > > -- > > Steve Marquez > > Marquez Design > > e-mail: smarq...@marquez-design.com > > web: http://www.marquez-design.com > > phone: 479-648-0325 > > > > > > On Jun 3, 2010, at 9:53 AM, Jim Lucas wrote: > > > > > Steve Marquez wrote: > > >> Good morning, > > >> > > >> I have a PHP form that I have been using for some time now on a Macbook > > Pro running PHP 5.3.1 and MySQL 5.0.5 and everything was working fine. But > > this morning, when I submitted (it is a journaling application) it came up > > with the following error: > > >> > > >> No such file or directory > > >> > > >> Can anyone point me in the right direction to fix this? Have you ever > > seen this before? > > >> > > >> Thanks, > > >> > > >> Steve Marquez > > > > > > Where exactly did you see this error? > > > > > > 1) In your browser when you tried loading the form? > > > 2) In your browser when you submitted the form? > > > 3) In the error logs of your web server? > > > > > > Other questions: > > > > > > What type of web server are you running? > > > > > > Did your cat stomp on your keyboard? > > > > > > Are the files stored locally or are they on a network/remote drive? > > > > > > Children doing things they should not be doing? (Happened to me once...) > > > > > > Are you accessing the files via http://localhost/... ?? or as a local > > file? > > > > > > -- > > > Jim Lucas > > > > > > A: Maybe because some people are too annoyed by top-posting. > > > Q: Why do I not get an answer to my question(s)? > > > A: Because it messes up the order in which people normally read text. > > > Q: Why is top-posting such a bad thing? > > > > > > > > > You haven't said what sort of operating system you're using. In Linux, most > of the logs are kept in sub-directories of /var/log I believe. Windows, well > they could be scattered anywhere. MacOS, not too sure about that. > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] CakePHP, alternatives?
Larry, That's a very nice way to learn stuff. That's what I am doing but probably in a very crude way. I am just reading a PHP book and doing those examples. Would you recommend any other innovative way of learning and mastering this language? Regards, Shreyas On Thu, Jun 3, 2010 at 11:25 PM, la...@garfieldtech.com < la...@garfieldtech.com> wrote: > First spend time working with straight up PHP, writing your own stuff, > throwing it away, and writing it again. What you'll learn that way is > immeasurable. > > Then pick a framework (Cake, Drupal, Symfony, Zend, PEAR, whatever) and > learn it, maybe two. Try working with it and extending it. > > Then do the bulk of your serious work with that framework, having had > enough experience to understand what it's doing and why. > > The timeframe for that process will vary widely from a few months to a few > years depending on how quickly you pick stuff up and how much time you have, > but that's going to get you the best education and productivity. > > --Larry Garfield > > > On 6/3/10 12:51 PM, Shreyas wrote: > >> Folks, >> >> Just quite could not stop taking your inputs before I start my learning >> curve to shape up. >> >> Should I use one of these frameworks or just *K*eep *I*t *S*imple and >> *S*tupid >> >> and learn it the traditional way? Thoughts? >> >> > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas
Re: [PHP] convert files utf8
I bank on Notepad++ (open source editor) to do such a thing. It can convert an ASCI file to UTF -8. Give it a shot. On Fri, Jun 4, 2010 at 2:02 PM, Richard Quadling wrote: > On 3 June 2010 22:35, Tanel Tammik wrote: > > Hi, > > > > does anyone know how to convert all files in a directory and in it's > > subdirectories into utf8 encoding? i am using komodo edit as text-editor. > > may it has a feature which i cannot find... > > > > Br > > Tanel > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > What encoding are they currently set to? > > iconv() [1] and mb_convert_encoding() [2] may both be up to the job. > > // UNTESTED > $FilesLocation = 'C:/Work'; > $FromEncoding = 'ISO-8859-1'; > $ToEncoding = 'UTF-8'; > > foreach(new DirectoryIterator($FilesLocation) as $File) { > file_put_contents($File->getPathname(), iconv($FromEncoding, > $ToEncoding, file_get_contents($File->getPathname(; > // file_put_contents($File->getPathname(), > mb_convert_encoding(file_get_contents($File->getPathname()), > $ToEncoding, $FromEncoding)); > } > ?> > > If the files are XML with a xml tag like ... > > > > then you would have to add additional code to edit that line also. > > Richard. > > [1] http://docs.php.net/manual/en/function.iconv.php > [2]http://docs.php.net/manual/en/function.mb-convert-encoding.php > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > ZOPA : http://uk.zopa.com/member/RQuadling > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas
Re: [PHP] CakePHP, alternatives?
Trying again. --Shreyas On Fri, Jun 4, 2010 at 3:10 AM, Shreyas wrote: > Larry, > > That's a very nice way to learn stuff. That's what I am doing but probably > in a very crude way. > > I am just reading a PHP book and doing those examples. Would you recommend > any other innovative way of learning and mastering this language? > > Regards, > Shreyas > > > On Thu, Jun 3, 2010 at 11:25 PM, la...@garfieldtech.com < > la...@garfieldtech.com> wrote: > >> First spend time working with straight up PHP, writing your own stuff, >> throwing it away, and writing it again. What you'll learn that way is >> immeasurable. >> >> Then pick a framework (Cake, Drupal, Symfony, Zend, PEAR, whatever) and >> learn it, maybe two. Try working with it and extending it. >> >> Then do the bulk of your serious work with that framework, having had >> enough experience to understand what it's doing and why. >> >> The timeframe for that process will vary widely from a few months to a few >> years depending on how quickly you pick stuff up and how much time you have, >> but that's going to get you the best education and productivity. >> >> --Larry Garfield >> >> >> On 6/3/10 12:51 PM, Shreyas wrote: >> >>> Folks, >>> >>> Just quite could not stop taking your inputs before I start my learning >>> curve to shape up. >>> >>> Should I use one of these frameworks or just *K*eep *I*t *S*imple and >>> *S*tupid >>> >>> and learn it the traditional way? Thoughts? >>> >>> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > Regards, > Shreyas > -- Regards, Shreyas
Re: [PHP] CakePHP, alternatives?
Tedd, That was very very very helpful. I so agree with you on the A,B and C example that you have quoted. It not only boosts my confidence with the answers but so will the employer's. I am reading this PHP for Dummies and then I plan to read Head First with PHP, MySQL, and Apache. Do you know any books that I can read online or I can buy? I would be happy to do that. Also, I couldn't get much information about "Yojimbo". I would be very curious to know how you maintain your learning(s) in the very way that you mentioned in the mail. I can definitely try to implement it. Regards, Shreyas On Fri, Jun 4, 2010 at 6:36 PM, tedd wrote: > At 11:21 PM +0530 6/3/10, Shreyas wrote: > >> Folks, >> >> Just quite could not stop taking your inputs before I start my learning >> curve to shape up. >> >> Should I use one of these frameworks or just *K*eep *I*t *S*imple and >> *S*tupid >> and learn it the traditional way? Thoughts? >> >> -- >> Regards, >> Shreyas >> > > Shreyas: > > Alternatives? Yes, there are alternatives. > > I've been doing web-work/web-programming for well over a decade and have > never learned a framework. Instead, I've developed my own. > > I have purchased and read literally scores and scores of php books and have > worked through every example they provide. This not only gives me a > considerable hard-copy library of relevant books, but also a library of > hundreds working examples that spreads across several development domains. I > read "on the average" a book a week, but not all of them are on php. > > I also do this for other languages, such as mysql, css, javascript, and > more. Incidentally, javascript DOM scripting is fascinating -- I'm currently > writing examples of that. > > Attending this list gives me the opportunity to both help others and > continue expanding my library of my working examples. > > Note when landing a client, or a job, your examples can be invaluable in > showing what you can do -- they can be part of your resume. For example, > I've had numerous clients who have asked "I would like A, B, and C added to > my web site -- can you do that?" I've answered with providing them with > working examples of all and say "I've already done that, here's proof, and I > can do that for you. How about hiring me?" It works in landing work. > > So, my advice is to pick up a book, read it, and work through all the > examples. Catalog the examples (i.e., strings, arrays, email, forms, > graphics, sessions, time/date, db, security, etc.), make the work online, > document them well, make them something that you can *reuse*, and move on to > the next book. > > Keep in mind that every book has a slant of what the author thinks is > important. So it's important to read more than just one "beginners" book > because each book has it's own offering. To paraphrase Will Rogers "I've > never read a book where I didn't learn something." > > Lastly, take every example of every problem/solution provided on this list > and make it part of your own framework. For example, I have "Yojimbo" (a > note library) completely filled with examples provided by this list with: 1) > the problem; 2) the solution; 3) and who provided the solution. After a > while you'll figure out who provides the best advice for what type of > problem. > > If nothing else, you'll better understand the language. > > Cheers, > > tedd > > -- > --- > http://sperling.com http://ancientstones.com http://earthstones.com > -- Regards, Shreyas
Re: [PHP] CakePHP, alternatives?
@ All - Points duly noted. Thanks for all the mighty advice. As the owner of the thread, I consider the thread closed for now unless anyone has anything to add. --Shreyas On Sat, Jun 5, 2010 at 1:02 AM, Adam Richardson wrote: > > > > I am reading this PHP for Dummies and then I plan to read Head First with > > PHP, MySQL, and Apache. Do you know any books that I can read online or I > > can buy? I would be happy to do that. > > > > Hi Shreyas, > > I think you've received some excellent advice. > > I like the Head First Books quite a bit. I attended grad school for > cognitive psychology, and I can tell you that the Head First Books do a > great job of integrating methods shown to enhance learning. > > I own several of the books in the series, including those on iPhone > development and Design Patterns, and while I don't own the PHP book, I've > reviewed it at the book store and recommend it to some friends who have > taken up PHP, too, and they've been very pleased with the resource. > > I hope you have an enriching, enjoyable experience as you learn PHP. > > Adam > > -- > Nephtali: PHP web framework that functions beautifully > http://nephtaliproject.com > -- Regards, Shreyas
[PHP] Question - foreach.
PHP'ers, I am reading a PHP book which explains foreach and at the end says : *'When foreach starts walking through an array, it moves the pointer to the beginning of the array. You don’t need to reset an array before walking through it with foreach.'* * * *Does this mean - * *1) Before I navigate the array, foreach will bring the pointer to the starting key?* *2) After the first index, it goes to 2nd, 3rd, and nth? * Regards, Shreyas
Re: [PHP] Question - foreach.
All, I tried and tested it but wanted a solid confirmation on it. I felt foreach usage is better than manual way of next(), prev() et al. Thanks for the comments. I consider the thread answered and solved unless someone has anything more to add. Regards, Shreyas On Thu, Jun 10, 2010 at 7:02 PM, Paul M Foster wrote: > On Thu, Jun 10, 2010 at 07:03:28AM -0400, tedd wrote: > > > At 7:19 AM +0530 6/10/10, Shreyas wrote: > >> PHP'ers, > >> > >> I am reading a PHP book which explains foreach and at the end says : > *'When > >> foreach starts walking through an array, it moves the pointer to > >> the beginning of the array. You don't need to reset an array before > >> walking through it with foreach.'* > >> * > >> * > >> *Does this mean - * > >> *1) Before I navigate the array, foreach will bring the pointer to the > >> starting key?* > >> *2) After the first index, it goes to 2nd, 3rd, and nth? * > >> > >> > >> Regards, > >> Shreyas > > > > Shreyas: > > > > This is one of those questions that you can test very easily, just > > initialize an array and try it. > > +1 > > This is Tedd's modus operandi. His website(s) are full of exactly this > type of thing. And I have to agree. I can't count the number of > questions I *haven't* asked on this list, because I built a page to test > a particular concept. And this sort of activity (as opposed to just > reading about something) really locks in your understanding of a > concept. > > Paul > > -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas
Re: [PHP] How does php server identify that the particular session belongs to particular user
I agree with Ash's comment. You should probably dig in deeper and see if those IPs are indeed valid. Given the way the sites are being attacked (DDoS, SQL Injection et al), you could be seeing one. If you see a high load and your website is accessed by users spread globally, you should try out a Content Delivery Network like Akamai to meet the scale and improve the performance of your web-site without compromising on the end-user's site navigation experience. Regards, Shreyas On Fri, Jun 11, 2010 at 3:06 PM, Ashley Sheridan wrote: > On Fri, 2010-06-11 at 15:13 +0530, Peter wrote: > > > Hi Ashley, > > > > Thanks for your answer. > > > > When too many users log in at the same time, the server gets loaded > > with multiple sessions files that leads to complexity and crashes the > > server. In such cases how do we handle this ? > > > > Thanks in advance > > > > Peter > > > > > > Ashley Sheridan wrote: > > > > > On Fri, 2010-06-11 at 13:01 +0530, Peter wrote: > > > > > > > > > > > > > Hi All, > > > > > > > > My Question is "How does php server identify that the particular > session > > > > belongs to particular user?" > > > > > > > > Please help me out > > > > > > > > Regards > > > > Peter.m > > > > > > > > > > > > > > > > > > > > All the session data is stored on the server either in a database, file > > > or memory against a unique ID value. The server handles how this is > > > done, and it's likely you won't ever need to get involved with changing > > > how it does things. > > > > > > >From the client-side of things; the user agent (browser) sends this > > > unique ID either as part of the URL or with the headers as a post > > > variable, which is why you may see a PHP_SESSION_ID (or something > > > similar) index in the $_REQUEST array when you use session_start() in > > > your scripts. > > > > > > Has this helped? > > > > > > Thanks, > > > Ash > > > http://www.ashleysheridan.co.uk > > > > > > > > > > > > > > > I don't think it's the sessions that are crashing your server, it's more > than likely something else. What is the server load when you notice the > crashes? How many people are visiting your site simultaneously at that > point? > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] How does php server identify that the particular session belongs to particular user
Agreed. I was just speculating; may be I over -speculated it ;) Regards, Shreyas On Fri, Jun 11, 2010 at 8:18 PM, Ashley Sheridan wrote: > On Fri, 2010-06-11 at 19:56 +0530, Shreyas wrote: > > I agree with Ash's comment. > > You should probably dig in deeper and see if those IPs are indeed valid. > Given the way the sites are being attacked (DDoS, SQL Injection et al), you > could be seeing one. If you see a high load and your website is accessed by > users spread globally, you should try out a Content Delivery Network like > Akamai to meet the scale and improve the performance of your web-site > without compromising on the end-user's site navigation experience. > > Regards, > Shreyas > > On Fri, Jun 11, 2010 at 3:06 PM, Ashley Sheridan > wrote: > > > On Fri, 2010-06-11 at 15:13 +0530, Peter wrote: > > > > > Hi Ashley, > > > > > > Thanks for your answer. > > > > > > When too many users log in at the same time, the server gets loaded > > > with multiple sessions files that leads to complexity and crashes the > > > server. In such cases how do we handle this ? > > > > > > Thanks in advance > > > > > > Peter > > > > > > > > > Ashley Sheridan wrote: > > > > > > > On Fri, 2010-06-11 at 13:01 +0530, Peter wrote: > > > > > > > > > > > > > > > > > Hi All, > > > > > > > > > > My Question is "How does php server identify that the particular > > session > > > > > belongs to particular user?" > > > > > > > > > > Please help me out > > > > > > > > > > Regards > > > > > Peter.m > > > > > > > > > > > > > > > > > > > > > > > > > > All the session data is stored on the server either in a database, file > > > > or memory against a unique ID value. The server handles how this is > > > > done, and it's likely you won't ever need to get involved with changing > > > > how it does things. > > > > > > > > >From the client-side of things; the user agent (browser) sends this > > > > unique ID either as part of the URL or with the headers as a post > > > > variable, which is why you may see a PHP_SESSION_ID (or something > > > > similar) index in the $_REQUEST array when you use session_start() in > > > > your scripts. > > > > > > > > Has this helped? > > > > > > > > Thanks, > > > > Ash > > > > http://www.ashleysheridan.co.uk > > > > > > > > > > > > > > > > > > > > > > I don't think it's the sessions that are crashing your server, it's more > > than likely something else. What is the server load when you notice the > > crashes? How many people are visiting your site simultaneously at that > > point? > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > > > > > > It might not even be as bad as that. It could be that you're just hitting > the max number of connections that the server is configured to handle, or > that the current number of connections is reaching the memory limit. > > Maybe the sessions are set up to be stored in files on the server on a > separate partition, and that has reached capacity? > > There are a number of reasons which could cause the server to appear that > the sessions are causing a problem that is not a DDoS attack ;) > > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas
Re: [PHP] http request
I am not sure if I understand the question with clarity. What exactly do you mean by a HTTP request script? Since it involves a web server to run the PHP script, the HTTP request and response will be the backbone of the whole transaction. But like I mentioned earlier, I could be seeing the question wrong. --Shreyas Sent from my iPhone On 05-Dec-2010, at 18:09, Moses wrote: Hi Everyone, I would like to know whether there is a http request PHP script. I would like to use in cases where a background script is running for sometime and outputs the results in PHP once the script has been executed. Thanks. musa -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple Login in a single PC should not be possible
Karl, Which app are you talking about? Regards, Shreyas On Tue, Jun 15, 2010 at 8:21 AM, Karl DeSaulniers wrote: > Hey, > I just found this app that I think will do your single user login. It is a > MySQL monitoring app called MySQL Query Analyzer. It has the functionality I > think you were looking for. Might be worth a "look-see". > > :)) > > Hth, > Karl -- Regards, Shreyas Agasthya
Re: [PHP] Date Conversion Problem
David, I think it would help people like me (newbie) to know the exact statements. Though I could envisage what you would have done with my current learning, it would be good if I double check the statements that went there to fix it. Regards, Shreyas On Thu, Jun 17, 2010 at 7:07 PM, David Stoltz wrote: > Thanks all - I've fixed the problem. > > I fixed it by updating the php statement to write the date in a true SQL > date-ready format. Then I updated the invalid rows. > > Thanks all! > > > -Original Message- > From: Richard Quadling [mailto:rquadl...@gmail.com] > Sent: Thursday, June 17, 2010 8:47 AM > To: David Stoltz > Cc: a...@ashleysheridan.co.uk; php-general@lists.php.net > Subject: Re: [PHP] Date Conversion Problem > > On 17 June 2010 13:40, David Stoltz wrote: > > I would agree with you, but I have no control on inherited web apps. > > > > > > > > I now need to concentrate on trying to fix this. > > > > > > > > From: Ashley Sheridan [mailto:a...@ashleysheridan.co.uk] > > Sent: Thursday, June 17, 2010 8:38 AM > > To: David Stoltz > > Cc: php-general@lists.php.net > > Subject: Re: [PHP] Date Conversion Problem > > > > > > > > On Thu, 2010-06-17 at 08:35 -0400, David Stoltz wrote: > > > > > > PHP newbie here... > > > > > > > > I have some PHP code writing the date/time into a MS SQL 2000 database > > like this: > > > > > > > > date('l jS \of F Y h:i:s A') > > > > > > > > So the text it writes into the DB is like: Thursday 15th of April 2010 > > 10:13:42 AM > > > > > > > > The database field is defined as varchar, not datetime...so it's a > > string essentially... > > > > > > > > How in the world do I do a date conversion on this? I've tried things > > like: > > > > > > > > select * from table where convert(datetime,fieldname) >= '6/10/2010' > > > > (where fieldname is the string in question) > > > > > > > > Which results in "Syntax error converting datetime from character > > string." > > > > > > > > So I guess I have two questions: > > > > > > > > 1) Can I write a SQL query that will convert this properly into a > > datetime? > > > > 2) If not, I guess I'll need to change the code to write the date > > differently into the system, how should this statement be changed to > > allow for proper conversion? date('l jS \of F Y h:i:s A') > > > > > > > > Thanks for any help! > > > > > > > > It's best to store the date as a date rather than a string, as it avoids > the sorts of problems you're seeing now. > > > > Thanks, > > Ash > > http://www.ashleysheridan.co.uk > > > > > > > > > > > > > > The "fix" is most likely to be ... > > 1 - Convert the string date using PHP's strtotime() function to > populate a new column on the DB. > 2 - Find the code that inserts/updates the date string and add the new > column to the insert/update statement. > > That will preserve the current app and allow you to have the new > column for new work. > > Just remember, if _YOU_ update the new column, you must also update > the original date string also. > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > ZOPA : http://uk.zopa.com/member/RQuadling > -- Regards, Shreyas Agasthya
Re: [PHP] Website content question
Ernie, I am sure you know none of us could have accessed the link that you have given there. Can you let us know what code you have written so that one of us can guide you? As a broad pitch, your php code has to be either in or I would wait for your code and other to probe a little more. Regards, Shreyas On Mon, Jun 21, 2010 at 5:11 PM, Ernie Kemp wrote: > This is not a direct PHP question but I will be using PHP in the > website. > > > > I go to the php list because the wordpress forum does not respond to my > questions and I know some of you have a lot of expertise in other areas than > PHP. > > > > I wish to a my own pages to a theme. > > I created pages on my PC and added the code at the top of the page for > wordpress to use the page for a template page. > > I than FTP’d the file over to web hosting server template location. > > Through wordpress “administrator” I added my file called homepage.php. > > > > I FTP’d my CSS, images, js and flash folders over to the template location. > > Went to load the website > http://localhost/Michael-8701/site_flash/wordpress/wp-content/homepage.phpand > all I got was the html code displayed. > > > > I tried moving the folder around but same results. > > Read some docs on this but it’s not clear to me why this will not work. > > > > Please help this is new to me and I need to get over this wall. > > Thanks, > > /Ernie > > > > > > > > > > > > > -- Regards, Shreyas Agasthya
Re: [PHP] Warning messages on web page.
Mike, A couple of things that I could understand reading carefully at the error. 1. reset takes an array as the input and perhaps your $thumbsarray is *not *an array? Reset will set the internal pointer to the start of the array. 2. Warning # 2 is very closely related to #1 since you can iterate on an array and not on a variable. 3. Just FYI - You can control the behavior should or not these warnings/notices/errors in your php.ini file. Do a quick google and you should be happy to see the result. Regards, Shreyas On Tue, Jun 22, 2010 at 7:47 PM, Mike Davies wrote: > Hello, > > This is my first post to this list and I am a novice at php coding. I > can generally follow the code but not good at writing from scratch. > > > I have recently been trying to add to a website which was originally > developed by someone else and is written in php and mysql. I am trying > to add a 'news' section to the site. This would be similar to an > existing 'projects' section so, rather than write it completely from > scratch I copied the php and the database tables from the 'project' > section and renamed 'project' to 'news'. > > > This is working well except for one thing – I get the following error > messages when looking at the detailed news item. This code does not > produce this warning in the project section which is using the same php > code > > > Warning: reset() [function.reset]: Passed variable is not an array or > object in /home/b23aadf/public_html/news/details.php on line 72 > > Warning: Variable passed to each() is not an array or object > in /home/b23aadf/public_html/news/details.php on line 73 > > > The relevant lines are : > > > 72 reset($thumbsarray); > > 73 while (list($key, $value) = each($thumbsarray)) { > > The site is at www.aadf.co.uk and select 'News'. > > Is anyone able to help resolve this? If you let me know what further > information you require I can provide it. > > > Mike Davies > > -- > Mike Davies > Integra Web Design, Rhynie, By Huntly, AB54 4LS > 01464 861535www.integrawebdesign.co.uk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Stripping Characters
Perhaps, ereg_replace("your regex", "replacement_string", String $variable). Regards, Shreyas On Tue, Jun 22, 2010 at 9:10 PM, Rick Dwyer wrote: > Hello List. > > I need to remove characters from a string and replace them with and > underscore. > > So instead of having something like: > > $moditem = str_replace("--","_","$mystring"); > $moditem = str_replace("?","_","$mystring"); > $moditem = str_replace("!","_","$mystring"); > etc. > > For every possible character I can think of, is there a way to simply omit > any character that is not an alpha character and not a number value from 0 > to 9? > > > --Rick > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Stripping Characters
Then, when does one use ereg_replace as against preg_replace? I read from one the forums that preg_* is faster and ereg_* is if not faster but simpler. Is that it? Regards, Shreyas On Tue, Jun 22, 2010 at 9:58 PM, Richard Quadling wrote: > "A "word" character is any letter or digit or the underscore > character, that is, any character which can be part of a Perl "word". > The definition of letters and digits is controlled by PCRE's character > tables, and may vary if locale-specific matching is taking place. For > example, in the "fr" (French) locale, some character codes greater > than 128 are used for accented letters, and these are matched by \w." > > The above becomes ... > > _A _word_ character is any letter or digit or the underscore > character_ that is_ any character which can be part of a Perl _word__ > The definition of letters and digits is controlled by PCRE_s character > tables_ and may vary if locale_specific matching is taking place_ For > example_ in the _fr_ _French_ locale_ some character codes greater > than 128 are used for accented letters_ and these are matched by _w__ > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > ZOPA : http://uk.zopa.com/member/RQuadling > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Warning messages on web page.
Mike, Little weird. I executed the same lines of code against my sample database and did not got any warning. You might want to send the code for projects and news to do any comparison? *[I will silently wait for the PHP demi-gods (the Ashleys, the Pauls et al) at hover their vigilant eyes on your lines .:) ]* Regards, Shreyas On Wed, Jun 23, 2010 at 2:48 PM, Mike Davies wrote: > > The only earlier reference to $thumbsarray is in the first lines of the > file : > > mysql_select_db($database_general, $general); > $query_details = "SELECT * FROM news WHERE news_id = '$_GET[id]'"; > $details = mysql_query($query_details, $general) or die(mysql_error()); > $row_details = mysql_fetch_assoc($details); > $totalRows_details = mysql_num_rows($details); > > mysql_select_db($database_general, $general); > $query_thumbs = "SELECT * FROM news_thumbs"; > $thumbs = mysql_query($query_thumbs, $general) or die(mysql_error()); > $totalRows_thumbs = mysql_num_rows($thumbs); > $i = 1; > while ($row_thumbs = mysql_fetch_assoc($thumbs)){ > $thumbsarray[$i] = $row_thumbs; > $i++; > } > > //print_r($thumbsarray); > ?> > > This is exactly the same as the code which is working for the 'projects' > pages. > > Mike > > -- > Mike Davies > Integra Web Design, Rhynie, By Huntly, AB54 4LS > 01464 861535www.integrawebdesign.co.uk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Attachment to email from form.
I have got one, too. On Mon, Jun 28, 2010 at 7:34 PM, Ashley Sheridan wrote: > On Mon, 2010-06-28 at 09:58 -0400, Andrew Ballard wrote: > > > On Mon, Jun 28, 2010 at 8:53 AM, Richard Quadling > wrote: > > > On 28 June 2010 13:44, Brandon Rampersad > wrote: > > >> f**k no > > > > > > Enlightened criticism aside, why not? Or rather (as I'm willing to > adapt) how? > > > > Probably because you ignored his latest request to chat. Just guessing, > really. > > > > Andrew > > > > > No, he often emails the list with random insults. He's emailed me > personally a couple of times too in response to a list email. Normally > I'd keep this off list, but as it's been going on for so long, and > others have noticed it too, figured his off-list behaviour should be > mentioned as well. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas Agasthya
[PHP] Info : Regular Expressions Website.
Team, I came across this website which can be very helpful to all of us when we are struggling to get the Regex right. I just started using it and seems very helpful. http://www.gskinner.com/RegExr/ Regards, Shreyas Agasthya
Re: [PHP] Array form processing
The painDesc array is what that should be iterated. --Shreyas On Wed, Jun 30, 2010 at 2:27 AM, Ashley Sheridan wrote: > On Tue, 2010-06-29 at 16:54 -0400, Ron Piggott wrote: > > > I am trying to process a form where the user uses checkboxes: > > > > Sharp > > Stabbing > > Jabbing > > > > When I do: > > > > foreach($_REQUEST as $key => $val) { > > $$key = $val; > >echo $key . ": " . $val . ""; > > } > > > > The output is: > > > > painDesc: Array > > > > I need to know the values of the array (IE to know what the user is > > checking), not that there is an array. I hope to save these values to > the > > database. > > > > Thank you. > > > > Ron > > > > > > > You need to iterate that array, as that holds the values of everything > sent by the browser > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas Agasthya
Re: [PHP] form validation code
http://www.php.net/manual/en/types.comparisons.php <http://www.php.net/manual/en/types.comparisons.php>The first table actually gives a very good understanding. --Shreyas On Wed, Jun 30, 2010 at 7:05 PM, Richard Quadling wrote: > On 30 June 2010 14:23, Daniel P. Brown wrote: > >(Hint: isset != empty) > > More importantly ... > > isset != !empty > > $a = Null; > $b = ''; > // $c = undefined; > $d = 'Hello'; > > isset($a) = False vs True = empty($a) > isset($b) = True vs True = empty($b) > isset($c) = False vs True = empty($c) > isset($d) = True vs False = empty($d) > > > > -- > - > Richard Quadling > "Standing on the shoulders of some very clever giants!" > EE : http://www.experts-exchange.com/M_248814.html > EE4Free : http://www.experts-exchange.com/becomeAnExpert.jsp > Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731 > ZOPA : http://uk.zopa.com/member/RQuadling > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Integers
It would also mean that 7 (8 digits which includes 0) is the highest numeric representation that you can have or go up to in an octal representation. So to take your example and represent an octal number : 00100010 (subscript 2) = 1057(subscript 8) --Shreyas On Thu, Jul 1, 2010 at 7:42 AM, Stephen wrote: > On 10-06-30 10:02 PM, David McGlone wrote: > >> Hi again >> >> I'm trying to learn about octal numbers and I don't understand this: >> >> Binary: 00100010 >> breakdown: (001)= 1 (000)= 0 (101)=5 (111)=7 >> >> I know it's similar to unix permissions, but I'm not understanding where >> for >> example: 111 = 7 >> >> > In base 10, which you use every day, we go > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 10 > > The number 10 is the number of distinct digits we use. > > In binary we only us two, 0 and 1, so 10 is 2 decimal > > So we go > > 0 = 0 decimal > 1 = 1 << important > 10 = 2 << important > 11 = 3 > 100 = 4 << important > 101 = 5 > 110 = 6 > 111 = 7 > > So binary 111 is 4 + 2 + 1 = 7 > > Stephen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
[PHP] mail() + localhost
PHP'ers, I am sure this would have been asked a zillion times but I take this as my turn to get some help. I hate to ask such rhetorical questions but quite couldn't understand how to tweak this. All I am trying to do is send a mail from my localhost to my Gmail ID. I read stuff about how the SMTP port should be accessible; should be open et al. My set-up is very simple: 1. Using Easy PHP. 2. Windows XP Also, when the comment says that you need to 'configure' your php.ini, which .ini should I modify? The reason being, I see that file in two locations, apparently. (i) C:\Program Files\EasyPHP 3.0\apache (ii) C:\Program Files\EasyPHP 3.0\conf_files *My php.ini (will remove the semi-colon)* * * ; For Win32 only. ;SMTP = localhost ;smtp_port = 25 ; For Win32 only. ;sendmail_from = m...@example.com *My code: * * * * * * * Regards, *Shreyas Agasthya
Re: [PHP] mail() + localhost
Erm... understood. I modified the changes to look like this in the "php.ini" file (the right one based on the output of phpinfo()). 3) *smtp = smtp.gmail.com* *smtp_port = 587* * * *I get : "Failed to connect to mailserver at "localhost" port 587, verify your "SMTP" and "smtp_port" setting in php.ini"* * * Regards, Shreyas On Thu, Jul 1, 2010 at 7:03 PM, Daniel Brown wrote: > On Thu, Jul 1, 2010 at 09:09, Shreyas Agasthya > wrote: > > > > All I am trying to do is send a mail from my localhost to my Gmail ID. I > > read stuff about how the SMTP port should be accessible; should be open > et > > al. My set-up is very simple: > > > > 1. Using Easy PHP. > > 2. Windows XP > > 3.) An SMTP server, I hope...? > > > Also, when the comment says that you need to 'configure' your php.ini, > which > > .ini should I modify? The reason being, I see that file in two locations, > > apparently. > > (i) C:\Program Files\EasyPHP 3.0\apache > > (ii) C:\Program Files\EasyPHP 3.0\conf_files > > In a browser, check the output of phpinfo() - specifically, the > value for "Loaded Configuration File" - and modify that, as the other > may be for the PHP CLI, another installed component using a local > override, or may not even be used at all. > > > *My php.ini (will remove the semi-colon)* > > * > > * > > ; For Win32 only. > > ;SMTP = localhost > > ;smtp_port = 25 > > Uncomment the two lines above. > > > ; For Win32 only. > > ;sendmail_from = m...@example.com > > You don't *need* to uncomment and set the `sendmail_from` option, > as long as you set an explicit `From` header in your code. More on > that after your snippet. > > > *My code: * > > * > > * > > * > > > * > > > > $from= "shreya...@gmail.com"; > > $to ="shreya...@gmail.com"; > > $subject = "PHP Testing"; > > $message = "Test Me"; > > mail ($to,$subject,$message,'From:'.$from); > > ?> > > Your code should be modified just a bit for better conformance and > portability, but I understand that you're just using it as a test. > After following the suggestions above (and remembering to restart > Apache, of course), try this: > > > $from = "sherya...@gmail.com"; > > // Gmail allows (\+[a-z0-9\.\-_]+) appended to your username to > filter emails in your Gmail box. > $to = "shreyasbr+phpt...@gmail.com "; > > // This will append (at the moment, my local time) 1 Jul 2010, 09:27:23 > $subject = "PHP Testing ".date("j M Y, H:i:s"); > > $message = "Test Me."; > > // Create your headers, remembering to terminate each line with CRLF > (\r\n) to comply with RFC [2]821. > $headers = "From: ".$from."\r\n"; > $headers .= "X-Mailer: PHP/".phpversion()."\r\n"; > > // Send it, or inform us of an error. No need to use a -f flag here. > if (!mail($to,$subject,$body,$headers)) { >echo "Ah, crap. Something's SNAFU'd here."; >exit(-1); > } > ?> > > -- > > UNADVERTISED DEDICATED SERVER SPECIALS > SAME-DAY SETUP > Just ask me what we're offering today! > daniel.br...@parasane.net || danbr...@php.net > http://www.parasane.net/ || http://www.pilotpig.net/ > -- Regards, Shreyas Agasthya
Re: [PHP] mail() + localhost
Spoke too fast. Fixed that (SMTP has to be uppercase) Now it is : *SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. c15sm7128213rvi.11* On Thu, Jul 1, 2010 at 7:25 PM, Shreyas Agasthya wrote: > Erm... understood. > > I modified the changes to look like this in the "php.ini" file (the right > one based on the output of phpinfo()). > > 3) > *smtp = smtp.gmail.com* > *smtp_port = 587* > * > * > *I get : "Failed to connect to mailserver at "localhost" port 587, verify > your "SMTP" and "smtp_port" setting in php.ini"* > * > * > Regards, > Shreyas > > On Thu, Jul 1, 2010 at 7:03 PM, Daniel Brown wrote: > >> On Thu, Jul 1, 2010 at 09:09, Shreyas Agasthya >> wrote: >> > >> > All I am trying to do is send a mail from my localhost to my Gmail ID. I >> > read stuff about how the SMTP port should be accessible; should be open >> et >> > al. My set-up is very simple: >> > >> > 1. Using Easy PHP. >> > 2. Windows XP >> >> 3.) An SMTP server, I hope...? >> >> > Also, when the comment says that you need to 'configure' your php.ini, >> which >> > .ini should I modify? The reason being, I see that file in two >> locations, >> > apparently. >> > (i) C:\Program Files\EasyPHP 3.0\apache >> > (ii) C:\Program Files\EasyPHP 3.0\conf_files >> >> In a browser, check the output of phpinfo() - specifically, the >> value for "Loaded Configuration File" - and modify that, as the other >> may be for the PHP CLI, another installed component using a local >> override, or may not even be used at all. >> >> > *My php.ini (will remove the semi-colon)* >> > * >> > * >> > ; For Win32 only. >> > ;SMTP = localhost >> > ;smtp_port = 25 >> >> Uncomment the two lines above. >> >> > ; For Win32 only. >> > ;sendmail_from = m...@example.com >> >> You don't *need* to uncomment and set the `sendmail_from` option, >> as long as you set an explicit `From` header in your code. More on >> that after your snippet. >> >> > *My code: * >> > * >> > * >> > * >> > > > * >> > >> > $from= "shreya...@gmail.com"; >> > $to ="shreya...@gmail.com"; >> > $subject = "PHP Testing"; >> > $message = "Test Me"; >> > mail ($to,$subject,$message,'From:'.$from); >> > ?> >> >> Your code should be modified just a bit for better conformance and >> portability, but I understand that you're just using it as a test. >> After following the suggestions above (and remembering to restart >> Apache, of course), try this: >> >> > >> $from = "sherya...@gmail.com"; >> >> // Gmail allows (\+[a-z0-9\.\-_]+) appended to your username to >> filter emails in your Gmail box. >> $to = "shreyasbr+phpt...@gmail.com "; >> >> // This will append (at the moment, my local time) 1 Jul 2010, 09:27:23 >> $subject = "PHP Testing ".date("j M Y, H:i:s"); >> >> $message = "Test Me."; >> >> // Create your headers, remembering to terminate each line with CRLF >> (\r\n) to comply with RFC [2]821. >> $headers = "From: ".$from."\r\n"; >> $headers .= "X-Mailer: PHP/".phpversion()."\r\n"; >> >> // Send it, or inform us of an error. No need to use a -f flag here. >> if (!mail($to,$subject,$body,$headers)) { >>echo "Ah, crap. Something's SNAFU'd here."; >>exit(-1); >> } >> ?> >> >> -- >> >> UNADVERTISED DEDICATED SERVER SPECIALS >> SAME-DAY SETUP >> Just ask me what we're offering today! >> daniel.br...@parasane.net || danbr...@php.net >> http://www.parasane.net/ || http://www.pilotpig.net/ >> > > > > -- > Regards, > Shreyas Agasthya > -- Regards, Shreyas Agasthya
Re: [PHP] mail() + localhost
Not sure where I am top-posting. I posted to my own mail so that one gets to know the latest. Nevertheless, I wouldn't go against the guidelines as I completely understand the havoc that it can create. The port is 587 as per Google; SMTP that I am using is Google's (anything wrong here?). If there is a rudimentary mistake that I am doing, please guide me. Regards, Shreyas On Thu, Jul 1, 2010 at 7:46 PM, Daniel Brown wrote: > On Thu, Jul 1, 2010 at 10:02, Shreyas Agasthya > wrote: > > Spoke too fast. > > > > Fixed that (SMTP has to be uppercase) > > > > Now it is : *SMTP server response: 530 5.7.0 Must issue a STARTTLS > command > > first. c15sm7128213rvi.11* > >(Quick note: per the list guidelines, please don't top-post in threads.) > >That error message is because you're trying to connect to an SMTPS > (secure, SSL-encrypted SMTP) server using plain text, which won't > work. If you have a plain SMTP server running, try that to get one > thing resolved at a time. Change the port to 25 in your php.ini (and, > again, restart Apache) if plain SMTP is available on the default port. > > -- > > UNADVERTISED DEDICATED SERVER SPECIALS > SAME-DAY SETUP > Just ask me what we're offering today! > daniel.br...@parasane.net || danbr...@php.net > http://www.parasane.net/ || http://www.pilotpig.net/ > -- Regards, Shreyas Agasthya
Re: [PHP] mail() + localhost
Trying again; most likely I cannot do this without SSL. --Shreyas On Thu, Jul 1, 2010 at 8:42 PM, Shreyas Agasthya wrote: > Not sure where I am top-posting. I posted to my own mail so that one gets > to know the latest. Nevertheless, I wouldn't go against the guidelines as I > completely understand the havoc that it can create. > > The port is 587 as per Google; SMTP that I am using > is Google's (anything wrong here?). If there is a rudimentary mistake that I > am doing, please guide me. > > Regards, > Shreyas > > On Thu, Jul 1, 2010 at 7:46 PM, Daniel Brown wrote: > >> On Thu, Jul 1, 2010 at 10:02, Shreyas Agasthya >> wrote: >> > Spoke too fast. >> > >> > Fixed that (SMTP has to be uppercase) >> > >> > Now it is : *SMTP server response: 530 5.7.0 Must issue a STARTTLS >> command >> > first. c15sm7128213rvi.11* >> >>(Quick note: per the list guidelines, please don't top-post in >> threads.) >> >>That error message is because you're trying to connect to an SMTPS >> (secure, SSL-encrypted SMTP) server using plain text, which won't >> work. If you have a plain SMTP server running, try that to get one >> thing resolved at a time. Change the port to 25 in your php.ini (and, >> again, restart Apache) if plain SMTP is available on the default port. >> >> -- >> >> UNADVERTISED DEDICATED SERVER SPECIALS >> SAME-DAY SETUP >> Just ask me what we're offering today! >> daniel.br...@parasane.net || danbr...@php.net >> http://www.parasane.net/ || http://www.pilotpig.net/ >> > > > > -- > Regards, > Shreyas Agasthya > -- Regards, Shreyas Agasthya
Re: [PHP] form validation and error display
David, If I understand your problem/issue here, you are talking about something called 'sticky forms'. This means - (i) the form references itself. (ii) that the form knows what the previous data was when it encounters any validation issues. You achieve (i) and (ii) by re-submitting the form with the usage of a superglobal variable called $_SERVER['PHP_SELF']. Regards, Shreyas On Sun, Jul 4, 2010 at 11:27 PM, David Mehler wrote: > Hello, > I've got a form with several required fields of different types. I > want to have the php script process it only when all the required > fields are present, and to redisplay the form with filled in values on > failure so the user won't have to fill out the whole thing again. > One of my required fields is a text input field called name. If it's > not filled out the form displayed will show this: > > > > Note, I've got $_POST* variable processing before this so am assigning > that processing to short variables. > If that field is filled out, but another required one is not that form > field will fill in the value entered for the name field. > This is working for my text input fields, but not for either select > boxes or textareas. Here's the textarea also a required field: > > value=""> > > What this does, if a user fills out this field, but misses another, it > should echo the value of what was originally submitted. It is not > doing this. Same for my select boxes, here's one: > > > -- select type -- > - Meeting - > - Event - > > > I'd also like for any not entered required fields to have an error box > around them, I've got a css class to handle this, but am not sure how > to tie it in to the fields since any one of the required fields could > not be filled in. > I'd appreciate any help. > Thanks. > Dave. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] form validation and error display
Ash - Thanks for correcting me [should I say us ;) ]. So, if my understandng is right, we should use # instead of the superglobal variable. David - Sorry to have written that. I was not aware of the implications of the grand old way of doing it. :) Regards, Shreyas On Mon, Jul 5, 2010 at 4:24 AM, Ashley Sheridan wrote: > On Sun, 2010-07-04 at 18:23 -0400, David Mehler wrote: > > > Hello everyone, > > Thanks for your suggestions. > > For my variable in the value area of the text input field I enter > > > > value=" > > > > Prior to this I assign the variable $name to: > > > > $name = stripslashes($_POST['name']); > > > > I hope this is correct. > > Sticky forms sounds exactly what i'm looking for. I've changed my > > action attribute to > > > > > > > > The first thing I do once the page is loaded is check whether or not > > submit is set, if it is not I display the form, which is in a function > > call. If submit is set I want to begtin validation, so i'm deciding to > > merge my two files in to one, I like this better. My question is say > > for example the name text field is not filled out but all the other > > required fields are how do I get the form to redisplay itself? I was > > thinking a location redirect, but this doesn't sound right. > > Thanks. > > Dave. > > > > > > On 7/4/10, Paul M Foster wrote: > > > On Sun, Jul 04, 2010 at 01:57:01PM -0400, David Mehler wrote: > > > > > >> Hello, > > >> I've got a form with several required fields of different types. I > > >> want to have the php script process it only when all the required > > >> fields are present, and to redisplay the form with filled in values on > > >> failure so the user won't have to fill out the whole thing again. > > >> One of my required fields is a text input field called name. If it's > > >> not filled out the form displayed will show this: > > >> > > >> > > >> > > >> Note, I've got $_POST* variable processing before this so am assigning > > >> that processing to short variables. > > >> If that field is filled out, but another required one is not that form > > >> field will fill in the value entered for the name field. > > >> This is working for my text input fields, but not for either select > > >> boxes or textareas. Here's the textarea also a required field: > > >> > > >> > >> value=""> > > > > > > Textarea fields don't work this way. To display the prior value, you > > > have to do this: > > > > > > > > >> -- select type -- > > >> - Meeting - > > >> - Event - > > >> > > > > > > The "value" attribute of a select field won't do this for you. You have > > > to actually set up each option with an either/or choice, like this: > > > > > > 'selected="selected"'; > > > ?>> - Meeting - > > > > > > Since doing this is pretty tedious, I use a function here instead: > > > > > > function set_selected($fieldname, $value) > > > { > > > if ($_POST[$fieldname] == $value) > > > echo 'selected="selected"'; > > > } > > > > > > And then > > > > > > > > ?>>Meeting > > > > > > HTH, > > > > > > Paul > > > > > > -- > > > Paul M. Foster > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > > > > $_SERVER['PHP_SELF'] is not to be trusted, and shouldn't be used as the > action of a form like this. > http://www.mc2design.com/blog/php_self-safe-alternatives explains it all > better than I can here, so it's worth a read, but it does list safe > alternatives. > > One thing I do when creating sticky select lists is this: > > $colours = array('red', 'green', 'blue', 'yellow', 'pink'); > > echo ''; > for($i=0; $i { >$selected = (isset($_POST['colour']) && $_POST['colour'] == > $i)?'selected="selected"':''; >echo "{$colours[$i]}"; > } > echo ''; > > Basically, this uses PHP to not only output the list from an array > (which itself can be populated from a database maybe) and select the > right option if it exists in the $_POST array and matches the current > option in the loop that's being output. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas Agasthya
Re: [PHP] Serial Numbers
Perhaps using a static variable might help? I am just guessing. --Shreyas On Tue, Jul 13, 2010 at 12:22 AM, Gary wrote: > I'm sure it is possible, but I am unsure how to do this. I have created a > Sale coupon that I was going to put up on a site that I manage, for > visitors > to print out and bring to the store. The coupon is currently a .png, > however > I was planning on converting to a pdf. I would like to put on the coupon a > serial number that increases by 1 everytime the page is viewed. I dont > really care if someone refreshes the page and skews the numbers. > > Is this possible and could someone give me some help? > > Thanks > > Gary > > > > __ Information from ESET Smart Security, version of virus signature > database 5273 (20100712) __ > > The message was checked by ESET Smart Security. > > http://www.eset.com > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] functions and global variables
My two cents on this one. Modify the $name within the function and print it. Modify the$name outside the function (means the non-global-declared $name) and print it. You will know the difference. --Shreyas On Mon, Jul 19, 2010 at 7:41 AM, Paul M Foster wrote: > On Sun, Jul 18, 2010 at 06:37:30PM -0400, David Mehler wrote: > > > Hello, > > I've got a file with a variable declared in it. For purposes of this > post: > > > > $name = $_POST['name']; > > > > Now a little later in the same file I have a custom function call that > > outputs some information. In that information is an echo statement > > outputting $name: > > > > echo $name; > > > > I'm wondering do I have to have $name declared as a global variable > > within that function? For example: > > > > function customFunction() { > > global $name > > } > > > > I've tried it both ways and both ways it works, with and without the > > global statement. I was under the impression that to be useful in a > > function variables outside were not accessible. > > Thanks. > > Dave. > > Variables declared outside a function are visible outside the function. > Variables declared inside a function are visible only within that > function. To use a "global" variable inside a function, you must declare > it global, as: > > global $globalvar; > > Paul > > -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] MySQL Query Puzzle
How about this : CREATE TEMPORARY TABLE bad_temp1 (id INT,name VARCHAR(20)); INSERT INTO bad_temp1 (id,name) SELECT DISTINCT id,name FROM SAMPLE; Regards, Shreyas On Mon, Jul 19, 2010 at 7:31 PM, Richard Quadling wrote: > On 19 July 2010 05:44, Peter wrote: > > Hi All, > > > > I have a table which contain's some duplicate rows. I just want to > delete > > the duplicate records alone > > not original records. > > > > Assume my table as look as below > > > > column1 column2 > > 1 > >a > > 1 > >a > > 2 > >b > > 3 > >c > > 3 > >c > > > > > > > > i want the above table need to be as below, After executing the mysql > > query. > > > > column1 > >column2 > > 1 > >a > > 2 > >b > > 3 > >c > > > > > > > > > > Thanks in advance.. > > > > Regards > > Peter > > > > If your table had a db generated sequential unique identifier (an > identity / autoinc), then something along these lines may be what you > are looking for ... > > -- Delete everything except the UniqueIDs we want to keep. > DELETE FROM >Table > WHERE >UniqueID NOT IN >( >-- Just get the UniqueIDs we want to keep. >SELECT >UniqueID >FROM >( >-- Get the earlist UniqueID for each Col1, Col2, > pairing. >SELECT >Col1, >Col2, >MIN(UniqueID) AS UniqueID >FROM > Table >GROUP BY >Col1, >Col2 >) >) > > UNTESTED > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Recent Influx of Unrelated Discussions
I completely agree with Dan's voice. I hear the tone. I am sure most of us here would spend a lot of time here to help each other out. Why not spend time on genuine PHP issues? Outside the scope of the discussion : Also, once they implement and get things working, I would like to request all the members to let us know the code or even the pseudo-code to let us know how they made it work. We can collect those snippets and also ask not repeated questions. Regards, Shreyas On Sat, Jul 17, 2010 at 7:43 AM, Jason Pruim wrote: > > On Jul 16, 2010, at 10:47 AM, Paul M Foster wrote: > > On Fri, Jul 16, 2010 at 11:59:49AM +0200, Arno Kuhl wrote: >> >> And Daniel, your own >>> gentle prods to keep things on track I think sets some of the >>> professional >>> tone of the list. >>> >> >> This is very true. I've administered various lists for almost ten years, >> and I know for a fact that the list administrator plays a tremendous >> role in the tone of a list. >> > > > So... By replying to this thread... Are we helping the problem or making it > worse by adding to the off topic posts? :P > > Happy Friday yall! :) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] I need me a Good Book for PHP
Joce, 6 mouth? I assume it's months. :) You can choose Head First with PHP and MySQL. Very good and I am currently learning form it; I am no veteran with the language but it's AWESOME. Also, good to know (for the PHP-veterans) will be : 1. Why are you learning PHP? 2. How do you plan to put your learning to usage? 3. Any specific things that you want to achieve from PHP? Regards, Shreyas On Mon, Jul 19, 2010 at 9:24 PM, Joce Jovanov wrote: > Hello, > > I work only 6 mouth with PHP, and now star to like more and more. Do you > someone know samo good books (tutorials) for PHP and MySQL. > Thanks > > Best Regard > Jovanov Jordan > -- Regards, Shreyas Agasthya
Re: [PHP] MySQL Query Puzzle
Just to add more perspective : You will have a table with DISTINCT values. Drop the initial table (better take a back-up); copy from the temporary table which will have only DISTINCT values. Regards, Shreyas On Mon, Jul 19, 2010 at 7:58 PM, Shreyas Agasthya wrote: > How about this : > > CREATE TEMPORARY TABLE bad_temp1 (id INT,name VARCHAR(20)); > INSERT INTO bad_temp1 (id,name) SELECT DISTINCT id,name FROM SAMPLE; > > Regards, > Shreyas > > On Mon, Jul 19, 2010 at 7:31 PM, Richard Quadling wrote: > >> On 19 July 2010 05:44, Peter wrote: >> > Hi All, >> > >> > I have a table which contain's some duplicate rows. I just want to >> delete >> > the duplicate records alone >> > not original records. >> > >> > Assume my table as look as below >> > >> > column1 column2 >> > 1 >> >a >> > 1 >> >a >> > 2 >> >b >> > 3 >> >c >> > 3 >> >c >> > >> > >> > >> > i want the above table need to be as below, After executing the mysql >> > query. >> > >> > column1 >> >column2 >> > 1 >> >a >> > 2 >> >b >> > 3 >> >c >> > >> > >> > >> > >> > Thanks in advance.. >> > >> > Regards >> > Peter >> > >> >> If your table had a db generated sequential unique identifier (an >> identity / autoinc), then something along these lines may be what you >> are looking for ... >> >> -- Delete everything except the UniqueIDs we want to keep. >> DELETE FROM >>Table >> WHERE >>UniqueID NOT IN >>( >>-- Just get the UniqueIDs we want to keep. >>SELECT >>UniqueID >>FROM >>( >>-- Get the earlist UniqueID for each Col1, Col2, >> pairing. >>SELECT >> Col1, >>Col2, >>MIN(UniqueID) AS UniqueID >>FROM >>Table >>GROUP BY >>Col1, >>Col2 >>) >>) >> >> UNTESTED >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > -- > Regards, > Shreyas Agasthya > -- Regards, Shreyas Agasthya
Re: [PHP] MySQL Query Puzzle
I am very keen to see a closure to this thread so that I can add to my snippets. Let's all know what worked best out of many solutions that have been proposed. --Shreyas On Tue, Jul 20, 2010 at 10:07 AM, Jim Lucas wrote: > Peter wrote: > >> Hi All, >> >> I have a table which contain's some duplicate rows. I just want to delete >> the duplicate records alone >> not original records. >> >> Assume my table as look as below >> >> column1 column2 >> 1 >>a >> 1 >>a >> 2 >>b >> 3 >>c >> 3 >>c >> >> >> >> i want the above table need to be as below, After executing the mysql >> query. >> >> column1 >>column2 >> 1 >>a >> 2 >>b >> 3 >>c >> >> >> >> >> Thanks in advance.. >> >> Regards >> Peter >> >> > Use the SQL command alter with the ignore flag. > > ALTER IGNORE TABLE `your_table` ADD UNIQUE ( `column1` , `column2` ) > > I tested this on my test DB and it worked fine. It erased all the > duplicates and left one instance of the multiple entry values. > > This will add a permanent unique restraint to the table. So, you will > never have dupps again. > > Jim Lucas > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] opening link in new window
I am not sure how PHP can help here. I am sure there must be a way out. With JavaScript, it s certainly possible. You can try window.open() to make this happen. It can accept a lot of parameters and a google search should give you a lot of answers. --Shreyas On Fri, Jul 23, 2010 at 10:58 AM, David Mehler wrote: > Hello, > I've got a page with an external link. I'd like to open it in a new > window, but i'm using the xhtml 1.0 strict dtd so this isn't possible. > I was wondering if php could pull this off? Failing that, and not > really wanting to go there, would javascript work for this? > Thanks. > Dave. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Encoding for W3C Validation
Rick, Probably Sebastian's fix might work but *htmlspecialchars* can help you, too. Regards, Shreyas On Wed, Aug 4, 2010 at 12:17 AM, Sebastian Ewert wrote: > Rick Dwyer wrote: > > Hello List. > > > > In the Alt section of the IMG tag below, the variable $myitem has a value > of "Who's There". > > > > echo " src='/itemimages/$mypic' alt='$myitem' width='60' > > > > When running through W3C validator, the line errors out because of the " > ' " in "Who's". > > I tried: > > $myitem=(htmlentities($myitem)); > > > > But this has no affect on "Who's". > > > > What's the best way to code this portion so the apostrophe is handled > correctly? > > > > > > TIA, > > > > --Rick > > > > > > > > > Use it > > > echo ' src="/itemimages/'.$mypic.'" alt="'.$myitem.'" width="60" ...' > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Regular expressions, filter option1 OR option2
Camilo, What exactly are you trying to achieve? Meaning: if (true) do this; if (false) do that; However, here's a link that I used long back to help me with some RegEx : http://www.gskinner.com/RegExr/ Regards, Shreyas On Wed, Aug 18, 2010 at 11:31 PM, Camilo Sperberg wrote: > Hello list :) > > Just a short question which I know it should be easy, but I'm no expert yet > in regular expressions. > I've got a nice little XML string, which is something like this but can be > changed: > > > http://tempuri.org/";>false > > The boolean value can be true or false, so what I want to do, is filter it. > I've done it this way, but I know it can be improved (just because I love > clean coding and also because I want to master regular expressions xD): > > $result = preg_match('/true/',$curl_response); > if ($result == 0) $result = preg_match('/false/',$curl_response); > > I've also tried something like: > $result = preg_replace('/^(true)|^(false)/','',$curl_response); // if not > true OR not false => replace with empty > > and also '/^true|^false/' which doesn't seem to work. > > Any ideas to filter this kind of string in just one expression? > > Thanks in advance :) > > -- > Mailed by: > UnReAl4U - unreal4u > ICQ #: 54472056 > www1: http://www.chw.net/ > www2: http://unreal4u.com/ > -- Regards, Shreyas Agasthya
Re: [PHP] Web application architecture (subdomain vs. sub directory)
I am not sure who the end-users are for your website but if you are concerned about scalability, I would definitely go for a sub-domain approach. Assuming you approach a CDN like Akamai and you want to offload the traffic to come from the cloud, it's lot easier for you to integrate with them and to maintain. The subdirectory approach, whereas, is very cumbersome and takes more work at your end to paraphrase the whole set-up should the needs change going forward. Regards, Shreyas On Thu, Aug 26, 2010 at 12:42 AM, Steven Staples wrote: > I started out not using a framework... then I started at a company who used > a "zend" like framework, worked there for a bit, then moved on, and started > using cake... > > I found that they were great for what they are... but really simplified > things too much, so I created my own framework, incorporating the classes > that I use all the time (smarty/fpdf/jquery/tinymce), and with that, I > learned a LOT about how things really worked. > > I would suggest looking at the core of the frameworks to see how things are > put together, and how they really work... but maybe make one that is more > custom to your application? > > As for subdomain vs subdirectory, if your using SSL, then you would need a > wildcard SSL which is usually more money. Eitherway you choose, you will > have to program around it. The app that I created uses subdomains, because > we were using CA SSL Certs, and the clients preferred to have their own > IP's... long story, not my call, I just program it :P > > > Steven Staples > > > > -Original Message- > > From: Peter Lind [mailto:peter.e.l...@gmail.com] > > Sent: August 25, 2010 3:01 PM > > To: a...@ashleysheridan.co.uk > > Cc: Tim Martens; php-general@lists.php.net > > Subject: Re: [PHP] Web application architecture (subdomain vs. sub > > directory) > > > > On 25 August 2010 20:54, Ashley Sheridan > wrote: > > > On Wed, 2010-08-25 at 13:45 -0500, Tim Martens wrote: > > > > > > If you're new to PHP, I would recommend not using a framework for the > > > experience you will gain with the language, as a framework will tend to > > > hide away certain caveats and peculiarities of PHP which could lead to > > > issues further down the line. Most people I know who are great PHP > > > programmers have tended to start without frameworks at first. > > > > > > Having said that, if you're looking for a rapid deployment with a > > > shorter learning curve, then a framework might be better in this > > > situation. > > > > > > > You could also argue that using a framework is more likely to promote > > good habits, as there's a bigger chance you'll be forced down good > > paths. > > > > Regards > > Peter > > > > -- > > > > WWW: http://plphp.dk / http://plind.dk > > LinkedIn: http://www.linkedin.com/in/plind > > BeWelcome/Couchsurfing: Fake51 > > Twitter: http://twitter.com/kafe15 > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > No virus found in this incoming message. > > Checked by AVG - www.avg.com > > Version: 9.0.851 / Virus Database: 271.1.1/3089 - Release Date: 08/25/10 > > 02:34:00 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Re: SEO Experts?
Avoid 302's as mush as possible. --Shreyas On Sun, Sep 26, 2010 at 8:55 PM, Al wrote: > > > On 9/26/2010 8:09 AM, David Mehler wrote: > >> Hello, >> Do we have any SEO experts on this list? I'm not one, learning only, >> reading a book and a few articles/tutorials from webmasters, and I'm >> wanting to optimize an existing site to get the best search rank >> possible. Some techniques, dos and don'ts would be appreciated. >> Thanks. >> Dave. >> > > > Google "Webmasters" is a very good resource. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Re: Continuance of the struggle (trying to understand)
Col, Can you let us know what exactly you see when you say http://localhost:/phptest.php ? Regards, Shreyas On Tue, Oct 5, 2010 at 4:20 PM, Col Day wrote: > > ""Col Day"" wrote in message > news:23.81.45586.2820b...@pb1.pair.com... > > Hi all, >> >> After my escapades with the real basics and realizing my laptop wasn't >> logged on as Administrator, I now am trying to work out why this script >> works sometimes but not others. >> >> >> >> PHP Test >> >> >> This is an HTML line >> > echo "This is a PHP line"; >> phpinfo(); >> ?> >> >> >> >> If I save this as phptest.php and open IE pointing it to >> localhost/phptest.php it works fine. Get both lines of text followed by the >> pages of gumpf about php. >> >> However if I paste this into a >> >> >> > That was weird! > > I was saying, If I paste this into a webpage I only get the "HTML" line as > before. > > Anyone have any ideas? > > PHP is obviously working as is apache. Just don't understand why they don't > show up in web pages. > > Cheers again all! > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Eclipse, Komodo, Netbeans, Zend Studio, PHP Storm, other?
Eclipse Ganymede or Galileo. The support for plug-ins is what I like. I have tried NetBeans and found it to be OK. --Shreyas On Wed, Oct 13, 2010 at 10:28 PM, Hansen, Mike wrote: > I'm about to do a lot of work on an existing code base and I think I'd like > to try an IDE. I currently use VIM for most editing. > > What IDE are you using? > > What do you like about the one you are using? > > Which ones have you tried? > > Mike > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
[PHP] Formatting an ECHO statement.
Team, A bit of silly one but like my book says, there are no dumb questions, I am asking it here. If I have : $other="Whatever"; and I do: echo 'Other Comments:' .$other. ' works perfectly well and prints the value. What if I want to, now, italicize the value of $other with the above syntax? How do I achieve it? I know we can do it this way : echo " I am $other"; but I want to learn how to do it with the above syntax like I mentioned earlier. Regards, Shreyas Agasthya
Re: [PHP] Formatting an ECHO statement.
Thanks all for their input. Some of the learnings from the thread : 1. tag is getting deprecated. 2. Use and 3. Have CSS used to do the kind of stuff I was trying. I must inform, this was already in place. 4. Keep an eye on the SE monster. Regards, Shreyas On Mon, Oct 18, 2010 at 11:43 PM, Andrew Ballard wrote: > On Mon, Oct 18, 2010 at 1:28 PM, tedd wrote: > > At 6:03 PM +0100 10/18/10, a...@ashleysheridan.co.uk wrote: > >> > >> There's nothing wrong with using as it indicates emphasised text, > >> which is semantic. Use span tags with classes only when the content > you're > >> styling has no semantic alternative. > >> > >> important message is much better for machines > (including > >> search engines, screen readers, etc) to infer a meaning for than > >> important message > >> > >> Thanks, > >> Ash > >> http://www.ashleysheridan.co.uk > > > > While using the em tag as you describe will certainly work, but what > happens > > when the designer wants to change the style of an em tag to something > else > > and doesn't want the output from your code to change? > > > > I have found it better to leave styling to the designer. > > > > That is the exactly the intended purpose of the and > tags: they simply indicate semantically that the > enclosed text is either emphasized or strong (or, if nested, the text > would be strongly emphasized? ;-) ), and it is up to CSS to define > what that should look like. The appearance can easily change at any > time without changing the HTML itself, just as you suggest. > > While the same is technically true of italic and bold, > those tags by definition imply a specific way to render the content > that they contain, which makes a real confusion in cases such as style="font-style: normal; font-weight: bold;">text. > > Andrew > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Formatting an ECHO statement.
Thanks for that detailed mail, Admin. The was an example and I wanted to understand how does one go about the whole formatting. Nonetheless, I am pretty well informed after this thread. Thanks once again, everyone. Regards, Shreyas On Tue, Oct 19, 2010 at 10:09 AM, Paul M Foster wrote: > On Mon, Oct 18, 2010 at 10:46:41PM -0400, Cris S wrote: > > > At 15:12 18 10 10, Shreyas Agasthya wrote: > > >Thanks all for their input. Some of the learnings from the thread : > > > > > >1. tag is getting deprecated. > > > > Not in HTML5. > > > > >2. Use and > > > > Both? Read that shit again, buckwheat. And by "that shit" I > > do mean the standards, not what Joe Bloe told you. > > > > >3. Have CSS used to do the kind of stuff I was trying. > > > > Uhm, yeah. @@ > > > > > I must inform, this was already in place. > > > > Then why the fuck are we discussing this? > > > > >4. Keep an eye on the SE monster. > > > > and on the "go fuck yourself" monster too. > > > > Holy fuck, I've been lurking for months. I turn away for > > one day and this is the non-PHP crap that happens? > > Please go back to lurking. We'd all appreciate it, and you'll be > happier. > > Paul > > -- > Paul M. Foster > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Reminder On Mailing List Rules
Let's adhere to the rules. --Shreyas On Fri, Oct 22, 2010 at 1:15 AM, Per Jessen wrote: > sueandant wrote: > > > Hi > > > > I'm not familiatr with the term "top-post"; could you please explain? > > http://lmgtfy.com/?q=top-post > > > > -- > Per Jessen, Zürich (3.7°C) > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > Let's adhere to the rules -- Regards, Shreyas Agasthya
Re: [PHP] Apache mod_pagespeed
Thiago, I would like to join this. Let me know how I can help you with this. Please be explicit with your requests so that we can totally test it and see if it could pose any risk to acceleration services provided by CDNs. Regards, Shreyas On Wed, Nov 3, 2010 at 11:51 PM, Thiago H. Pojda wrote: > Guys, > > Google announced this > morning< > http://googlewebmastercentral.blogspot.com/2010/11/make-your-websites-run-faster.html > >their > mod_pagespeed <http://code.google.com/speed/page-speed/docs/module.html> > to > improve Apache's performance. It really looks promising, what do you guys > think? > > Me and Daniel Brown will be running some tests with it, let us know if > you'd > like to join us. :) > > Google mentions 2x faster loading times, but they don't mention CPU cost. > > What do you think it will break? > > > Cheers, > Thiago Henrique Pojda > +55 41 8856-7925 > -- Regards, Shreyas Agasthya
Re: [PHP] Pros/Cons of using mysqli prepared statments
Tamara, In one of the earlier threads, it was mentioned mysqli APIs are more secure, faster, and actually maintained. Also, if you use some of the mysql_xxx(), you actually get a warning saying that it will be or it is being deprecated and paves the way for you to approach the same thing with mysqli_xxx(). The seniors perhaps can give you more facts which they have seen and experienced. Regards, Shreyas On Thu, Nov 4, 2010 at 1:18 PM, Tamara Temple wrote: > I'm wondering what the advantages/disadvantage of using prepared statements > with mysqli are. I'm used to using the mysqli::query and mysqli::fetch_assoc > functions to deal with retrieving data and bulding my sql statement in php > code. > > Tamara Temple >-- aka tamouse__ > tam...@tamaratemple.com > > > "May you never see a stranger's face in the mirror." > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] Fw: Spoofing user_agent
A standard HTTP Request headers is : User Agent (without the underscore). --Shreyas On Thu, Nov 25, 2010 at 2:36 PM, Ron Piggott wrote: > > Is this what you are telling me to do: > > header('user_agent: RonBot (http://www.theverseoftheday.info)'); > > Ron > > The Verse of the Day > “Encouragement from God’s Word” > http://www.TheVerseOfTheDay.info > > From: a...@ashleysheridan.co.uk > Sent: Thursday, November 25, 2010 3:34 AM > To: Ron Piggott ; php-general@lists.php.net > Subject: Re: [PHP] Fw: Spoofing user_agent > > You need to set it in the header request you make. Putting it in the script > you're using as a spider with ini_set won't do anything because the Target > site doesn't know anything about it. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > - Reply message - > From: "Ron Piggott" > Date: Thu, Nov 25, 2010 08:25 > Subject: [PHP] Fw: Spoofing user_agent > To: > > I have wrote a script to generate a sitemap of my web site. It crawls all > of the site web pages. (About 30,000) > > I need help to spoof the user_agent variable so the stats program running > in the background ( “AWSTATS” ) will treat the crawl as a bot, not browsing > usage. > > The sitemap generator is a cron job. I tried the syntax: > ini_set('user_agent', 'RonBot (http://www.theverseoftheday.info)/'/); > > This didn’t work. The browsing was attributed to the dedicated IP address. > > How do I get AWSTATS to access this, such as other entries under the > “Robots/Spiders visitors” heading: > Unknown robot (identified by 'bot*') > > I don’t mean any ill will by changing this setting. Thanks for the help. > > Ron > > The Verse of the Day > “Encouragement from God’s Word” > http://www.TheVerseOfTheDay.info > > -- Regards, Shreyas Agasthya
Re: [PHP] Fw: Spoofing user_agent
I feel you should use more of the 4th method here as you are not trying to read the file but the header level (7th layer) information of the HTTP protocol. http://php.net/manual/en/function.file-get-contents.php --Shreyas On Thu, Nov 25, 2010 at 4:11 PM, Ron Piggott wrote: > Will the header pass with using file_get_contents , or should I be using > another command, and if so, which one? Ron > > > header('User Agent: RonBot (http://www.example.com)'); > $url = "http://www.example.com";; <http://www.example.com%22;> > > $input = file_get_contents($url); > > > > The Verse of the Day > “Encouragement from God’s Word” > http://www.TheVerseOfTheDay.info > > *From:* Shreyas Agasthya > *Sent:* Thursday, November 25, 2010 4:21 AM > *To:* Ron Piggott > *Cc:* php-general@lists.php.net ; a...@ashleysheridan.co.uk > *Subject:* Re: [PHP] Fw: Spoofing user_agent > > A standard HTTP Request headers is : User Agent (without the underscore). > > --Shreyas > > On Thu, Nov 25, 2010 at 2:36 PM, Ron Piggott < > ron.pigg...@actsministries.org> wrote: > >> >> Is this what you are telling me to do: >> >> header('user_agent: RonBot (http://www.theverseoftheday.info)'); >> >> Ron >> >> The Verse of the Day >> “Encouragement from God’s Word” >> http://www.TheVerseOfTheDay.info >> >> From: a...@ashleysheridan.co.uk >> Sent: Thursday, November 25, 2010 3:34 AM >> To: Ron Piggott ; php-general@lists.php.net >> Subject: Re: [PHP] Fw: Spoofing user_agent >> >> You need to set it in the header request you make. Putting it in the >> script you're using as a spider with ini_set won't do anything because the >> Target site doesn't know anything about it. >> >> Thanks, >> Ash >> http://www.ashleysheridan.co.uk >> >> - Reply message - >> From: "Ron Piggott" >> Date: Thu, Nov 25, 2010 08:25 >> Subject: [PHP] Fw: Spoofing user_agent >> To: >> >> I have wrote a script to generate a sitemap of my web site. It crawls all >> of the site web pages. (About 30,000) >> >> I need help to spoof the user_agent variable so the stats program running >> in the background ( “AWSTATS” ) will treat the crawl as a bot, not browsing >> usage. >> >> The sitemap generator is a cron job. I tried the syntax: >> ini_set('user_agent', 'RonBot (http://www.theverseoftheday.info)/'/); >> >> This didn’t work. The browsing was attributed to the dedicated IP >> address. >> >> How do I get AWSTATS to access this, such as other entries under the >> “Robots/Spiders visitors” heading: >> Unknown robot (identified by 'bot*') >> >> I don’t mean any ill will by changing this setting. Thanks for the help. >> >> Ron >> >> The Verse of the Day >> “Encouragement from God’s Word” >> http://www.TheVerseOfTheDay.info >> >> > > > -- > Regards, > Shreyas Agasthya > -- Regards, Shreyas Agasthya
Re: [PHP] odd list bounces
Ashley, I just got one with the subject line as : ' ezmlm warning' * * On Mon, Jan 31, 2011 at 4:17 PM, Ashley Sheridan wrote: > Hiya, > > Is anyone else getting odd bounce messages? I just received one from the > list about a message that was returned as a bounce from my email > address. The fact that I was able to read an email about an email that > bounced from me suggests that things are OK my end with regards to > receiving messages. > > Thanks, > Ash > http://www.ashleysheridan.co.uk > > > -- Regards, Shreyas Agasthya
Re: [PHP] Does requesting $_SERVER variables need to query the server
Marc, $_SERVER is an array and it should have all the information. I do not know the answer for the latter part of your query. Regards, Shreyas On Thu, Feb 24, 2011 at 12:30 AM, Marc Guay wrote: > This question will probably reveal my lacking knowledge of the > fundamentals, but I'm a go for it anyway: > > When you use a $_SERVER variable, is a query made to the server to get > the information or is it just sitting in a variable all ready to go? > Reworded, is there any efficiency gained by storing the data in a > "local" variable if it's going to be used many times in the script? > My experience with jQuery has taught me to store $(objects) in local > variables if they're going to be used repeatedly because the DOM is > queried every time a jQuery object is generated, so I'm wondering if a > similar logic applies. > > Example: > > if ($_SERVER['SCRIPT_NAME'] == 'how.php') > // do stuff > if ($_SERVER['SCRIPT_NAME'] == 'why.php') > // do other stuff > > vs. > > $script_name = $_SERVER['SCRIPT_NAME']; > > if ($script_name == 'how.php') > // do stuff > if ($script_name == 'why.php') > // do other stuff > > Cheerios, > Marc > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- Regards, Shreyas Agasthya
Re: [PHP] JavaScript Injection ???
Is someone up to Cross Site Scripting? ;) --Shreyas On Mon, Apr 18, 2011 at 10:39 PM, Joshua Kehn wrote: > On Monday, April 18, 2011 at 1:06 PM, tedd wrote: > Hi gang: > > > > Quite some time ago I had a demo that showed Javascript injection. It > > was where a user could type in: > > > > alert("Evil Code"); > > > > and a JavaScript alert would be shown. > > > > But now my demo no longer works. So, what happened? Was there a php > > update that prohibited that sort of behavior or did hosts start > > setting something to OFF, or what? > > > > If you know, please explain. > > > > Thanks, > > > > tedd > > -- > > --- > > http://sperling.com/ > Not that I know of. Are you talking about on-page injection, like comments > and such? Normally JS injection would be that (bad scripts inserted by the > user on a comment form or review page) or where you are using eval() and > they dump bad code into there. > > Regards, > > -Josh___ > Joshua Kehn | josh.k...@gmail.com > http://joshuakehn.com > > > -- Regards, Shreyas Agasthya
[PHP] Urgent help - Token Generation code!
I am re-visiting the world of PHP after a really big hiatus and I am finding things veryslippery. Can someone please help me with the below code and let me know how I can print the token that is getting generated? I am using EasyPHP and I am trying to echo the $token but it wouldn't print anything. I am trying it as : http://localhost/token/URLToken.php. May I know where all I am going wrong here in my approach? 12)) { return; } if (($nWindow < 0) || (!is_integer($nWindow))) { return; } if (($nTime <= 0) || (!is_integer($nTime))) { $nTime = time(); } $nExpires = $nWindow + $nTime; if (strpos($sUrl, "?") === false) { $res = $sUrl . "?" . $sParam . "=" . $nExpires . "_" . $sToken; } else { $res = $sUrl . "&" . $sParam . "=" . $nExpires . "_" . $sToken; } return $res; } /** * Returns the hash portion of the token. This function should not be * called directly. */ function urlauth_gen_token($sUrl, $nWindow, $sSalt, $sExtract, $nTime) { if (($sUrl == "") || (!is_string($sUrl))) { return; } if (($nWindow < 0) || (!is_integer($nWindow))) { return; } if (($sSalt == "") || (!is_string($sSalt))) { return; } if (!is_string($sExtract)) { $sExtract = ""; } if (($nTime <= 0) || (!is_integer($nTime))) { $nTime = time(); } $nExpires = $nWindow + $nTime; $sExpByte1 = chr($nExpires & 0xff); $sExpByte2 = chr(($nExpires >> 8) & 0xff); $sExpByte3 = chr(($nExpires >> 16) & 0xff); $sExpByte4 = chr(($nExpires >> 24) & 0xff); $sData = $sExpByte1 . $sExpByte2 . $sExpByte3 . $sExpByte4 . $sUrl . $sExtract . $sSalt; $sHash = _unHex(md5($sData)); $sToken = md5($sSalt . $sHash); return $sToken; } /** * Helper function used to translate hex data to binary */ function _unHex($str) { $res = ""; for ($i = 0; $i < strlen($str); $i += 2) { $res .= chr(hexdec(substr($str, $i, 2))); } return $res; } ?> -- Regards, Shreyas Agasthya
Re: [PHP] Urgent help - Token Generation code!
Let me try and get back. Thanks, Jasper! On 28-May-2011, at 4:29 AM, Jasper Mulder wrote: From: shreya...@gmail.com To: lord_fa...@hotmail.com Subject: Re: [PHP] Urgent help - Token Generation code! Date: Sat, 28 May 2011 04:15:59 +0530 Jasper, Tried echoing $sToken but wouldn't work. Regards, Shreyas On 28-May-2011, at 4:11 AM, Jasper Mulder wrote: Date: Sat, 28 May 2011 03:56:26 +0530 From: shreya...@gmail.com To: php-general@lists.php.net Subject: [PHP] Urgent help - Token Generation code! I am re-visiting the world of PHP after a really big hiatus and I am finding things veryslippery. Can someone please help me with the below code and let me know how I can print the token that is getting generated? I am using EasyPHP and I am trying to echo the $token but it wouldn't print anything. I am trying it as : http://localhost/token/URLToken.php. May I know where all I am going wrong here in my approach? $sUrl = "/tstd_c_b1@s54782"; $sParam = "primaryToken"; $nTime = time(); $nEventDuration = 86400; $nWindow = $nTime + $nEventDuration; $sSalt = "akamai123!"; $sExtract = ""; // optional As a second try, what happens if you add right here the line $sGen = urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract, $nTime); Because it seems as though you just declare three functions in the code without calling them... function urlauth_gen_url($sUrl, $sParam, $nWindow, $sSalt, $sExtract, $nTime) { $sToken = urlauth_gen_token($sUrl, $nWindow, $sSalt, $sExtract, $nTime); echo $token; There are two cases: 1. You made a typo and meant 'echo $sToken;' on the above line instead 2. You omitted the part where $token is defined and used [More code that seemed fine] -- Regards, Shreyas Agasthya Best regards, Jasper Mulder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php