[PHP-DB] RE: [PHP-WIN] Re: Need Help in setting up a server
The IP you cited Is the IP provided by your router or modem, and not one others from out side can use to access your server. Now on the other side of that, if you go to the machine that has the WAMP installed and open a browser and point it to http://what.is.my.ip.com; you may see the public IP for that machine, which can be used for linking to your server, but is not guaranteed to stay with that machine depending on powering up and down of your systems, and your ISP's procedures for assigning IP's. Hope this helps, Warren Vail Vail Systems Technology -Original Message- From: nagendra prasad [mailto:nagendra802...@gmail.com] Sent: Tuesday, June 29, 2010 1:12 PM To: phpexpe...@yahoogroups.com; PHP DB; php mysql; php-wind...@lists.php.net Subject: [PHP-WIN] Re: Need Help in setting up a server Hi all, Thanks everyone. I just tried all of your suggestions and found that WAMP server is working by using the running WAMP server's system IP. I just typed 192.168.1.4 in the address bar and its working now. So, I came to a conclusion that if I have a static IP then I can access it from out side as well right. Correct me if I am wrong ?? So, if I am right is it possible to run a server from home ?? Best, Guru. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] _POST, _GET, _REQUEST not working
Hi Mike, You are a sharp one but alas that is not my real code. The real code for displaying var1 and var2 is: echo pvariable 1 : $var1 /p br ; echo pvariable 2 : $var2 /p br ; I have tried so many things to get this working, I am starting to think it is a CGI problem. -Original Message- From: Ford, Mike [mailto:[EMAIL PROTECTED] Sent: December 22, 2004 4:16 AM To: Keane, Warren A FIN:EX; php-db@lists.php.net Subject: RE: [PHP-DB] _POST, _GET, _REQUEST not working To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm On 20 December 2004 21:50, Warren wrote: Hello, I am running PHP 4.39 as a CGI under Tomcat 5.025, Linux 2.4.20-31.9. Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04' '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql' I cannot get the _GET function or _REQUEST functions to pick up values from a form generating even though I can see the query string values in the URL as in: http://localhost:8080/ip7/httptest.php?var1=212122var2=343434 My HTML is very simple: form action=http://localhost:8080/ip7/httptest.php; method=get input type=text name=var1 input type=text name=var2 input type=submit /form The PHP program httptest.php is also very simple: ?PHP global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; } else { $var1 ='undefined'; } if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; } else $var2 ='undefined'; // Various HMTL tags removed for simplicity echo $var1 echo $var1 Is this a direct paste from your original? If so, there's an obvious error here -- one of those should be $var2,'cos as it is you're never even echoing the value of the $_GET parameter. Cheers! Mike - Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning Information Services, JG125, James Graham Building, Leeds Metropolitan University, Headingley Campus, LEEDS, LS6 3QS, United Kingdom Email: [EMAIL PROTECTED] Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] _POST, _GET, _REQUEST not working
( ) -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: December 21, 2004 7:31 PM To: Keane, Warren A FIN:EX Cc: php-db@lists.php.net Subject: Re: [PHP-DB] _POST, _GET, _REQUEST not working Warren wrote: Thanks for your response Jochem. cheers. I realize this is not a DB specific question but this exercise is to get my mysql routines working. I did remove the declaration global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE but still do not get values. bummer. I have a sneaking suspicion that your problem might be related to the fact that you are running the cgi version of php. Funny thing, $_SERVER[QUERY_STRING] returns the query string one interim solution could be to write a function that fills the $_GET and $_POST vars - getting an array from a string like var1=334343var2=343434 is fairly trivial how does the following work for you? parse_str( $_SERVER['QUERY_STRING'], $_GET ); print_r($_GET); obviously this leaves you nowhere with POST COOKIE values. var1=334343var2=343434 but $_GET['var1'] or $_REQUEST['var1'] are empty. which of the superglobals are actually defined at all? phpinfo() shows SERVER[argv] = Array what does: print_r( $GLOBALS ); print_r( $HTTP_GET_VARS ); print_r( $HTTP_POST_VARS ); ...show you? (you might want to wrap the output in PRE tags for legibility) ( [0] = /home/www/jakarta-tomcat-5.0.25/webapps/ip7/WEB-INF/cgi/httptest.php probably a stupid question but: do you actually need tomcat? why not try a vanilla setup to begin with? have you read this page: http://nl.php.net/manual/en/language.variables.predefined.php#language.varia bles.superglobals if not why not? (read the manual from back to front, it save you lots of time in the long run) [1] = var2=343434 [2] = var1=334343 ) Very puzzling. Anyone else? -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: December 20, 2004 5:53 PM To: Keane, Warren A FIN:EX Cc: php-db@lists.php.net Subject: Re: [PHP-DB] _POST, _GET, _REQUEST not working Warren wrote: Hello, I am running PHP 4.39 as a CGI under Tomcat 5.025, Linux 2.4.20-31.9. Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04' '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql' I cannot get the _GET function or _REQUEST functions to pick up values from they are variables not functions. a form generating even though I can see the query string values in the URL as in: http://localhost:8080/ip7/httptest.php?var1=212122var2=343434 My HTML is very simple: form action=http://localhost:8080/ip7/httptest.php; method=get input type=text name=var1 input type=text name=var2 input type=submit /form The PHP program httptest.php is also very simple: ?PHP global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; all the vars listed above are super globals you don't have to declare them as global - they are everywhere! this may also be the cause of the problem, what happens when you remove this line? also have you tried var_dump() or print_r() on the $_GET/$_POST/etc arrays? ps - not a very DB related question is it? if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; } else { $var1 ='undefined'; } if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; } else $var2 ='undefined'; // Various HMTL tags removed for simplicity echo $var1 echo $var1 ? I have tried everything I can think of including using HTML POST instead of GET, setting register_globals = On/Off. leaving this off is recommended. Thanks in advance. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] _POST, _GET, _REQUEST not working
Jochem wrote: Thanks but this would be impractical for the real application. I need to gather customer data and write it to the database. I would likely use POST. I couldn't get POST to work either but am using _GET right now since I can at least see the query string value. ok - I assume then that POST values don't appear in argv as GET values do? if they do then the proposition stands. I did try if (empty($_GET)) { parse_str($_SERVER['QUERY_STRING'],$_GET); } which worked so I guess I should be able to come up with an equivalent for _POST using argv, argc. I am guessing but I also think the problem is to do with the fact that the CGI sapi is being used. I am using the CLI SAPI, I checked using php_sapi_name(). Is this causing the problem? Cheers -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] _POST, _GET, _REQUEST not working
Thanks for your response Jochem. I realize this is not a DB specific question but this exercise is to get my mysql routines working. I did remove the declaration global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE but still do not get values. Funny thing, $_SERVER[QUERY_STRING] returns the query string var1=334343var2=343434 but $_GET['var1'] or $_REQUEST['var1'] are empty. phpinfo() shows SERVER[argv] = Array ( [0] = /home/www/jakarta-tomcat-5.0.25/webapps/ip7/WEB-INF/cgi/httptest.php [1] = var2=343434 [2] = var1=334343 ) Very puzzling. Anyone else? -Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: December 20, 2004 5:53 PM To: Keane, Warren A FIN:EX Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] _POST, _GET, _REQUEST not working Warren wrote: Hello, I am running PHP 4.39 as a CGI under Tomcat 5.025, Linux 2.4.20-31.9. Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04' '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql' I cannot get the _GET function or _REQUEST functions to pick up values from they are variables not functions. a form generating even though I can see the query string values in the URL as in: http://localhost:8080/ip7/httptest.php?var1=212122var2=343434 My HTML is very simple: form action=http://localhost:8080/ip7/httptest.php; method=get input type=text name=var1 input type=text name=var2 input type=submit /form The PHP program httptest.php is also very simple: ?PHP global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; all the vars listed above are super globals you don't have to declare them as global - they are everywhere! this may also be the cause of the problem, what happens when you remove this line? also have you tried var_dump() or print_r() on the $_GET/$_POST/etc arrays? ps - not a very DB related question is it? if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; } else { $var1 ='undefined'; } if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; } else $var2 ='undefined'; // Various HMTL tags removed for simplicity echo $var1 echo $var1 ? I have tried everything I can think of including using HTML POST instead of GET, setting register_globals = On/Off. leaving this off is recommended. Thanks in advance. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] _POST, _GET, _REQUEST not working
Hello, I am running PHP 4.39 as a CGI under Tomcat 5.025, Linux 2.4.20-31.9. Configure = './configure' '--with-java=/usr/java/j2sdk1.4.2_04' '--with-servlet=/home/www/jakarta-tomcat-5.0.25' '--with-mysql' I cannot get the _GET function or _REQUEST functions to pick up values from a form generating even though I can see the query string values in the URL as in: http://localhost:8080/ip7/httptest.php?var1=212122var2=343434 My HTML is very simple: form action=http://localhost:8080/ip7/httptest.php; method=get input type=text name=var1 input type=text name=var2 input type=submit /form The PHP program httptest.php is also very simple: ?PHP global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; if(!empty($_REQUEST['var1'])) { $var1 = $_REQUEST['var1']; } else { $var1 ='undefined'; } if(!empty($_GET['var2'])) { $var2 = $_GET['var2']; } else $var2 ='undefined'; // Various HMTL tags removed for simplicity echo $var1 echo $var1 ? I have tried everything I can think of including using HTML POST instead of GET, setting register_globals = On/Off. Thanks in advance. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] sessions
I am attempting to get information from a mysql database and then use this in a session. Is there a trick to using sessions? For example, can something like below be placed anywhere in a script? (I have the session_start(); at the very top of my page.) session_register( session_username ); session_register( session_level ); $session_username = $username; $session_level = $account_level; The resulting session is session_username|N;session_level|i:0; $username is set to warren and $account_level is set to 255. Any help would be greatly appreciated as I have gone through about 5 books and searched the net and can't find an answer as to why this isn't working. - This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender and are not necessarily the views of the Mid Western Area Health Service. - gwavasig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] sessions
Thanks to everyone that replied. All working great now thanks. Warren Jochem Maas [EMAIL PROTECTED] 10/12/2004 2:47:28 pm try using the $_SESSION superglobal var (google is your friend if its new to you.) no need to register (still need to do session_start() though) just do... $_SESSION['MyValue'] = array( 'name' = $username, 'level' = $account_level ); ...or something like that. (also works for objects - which is only gets really cool in php5 - be aware that classes for objects stored in your session should be loaded BEFORE you start the session.) Warren Mason wrote: I am attempting to get information from a mysql database and then use this in a session. Is there a trick to using sessions? For example, can something like below be placed anywhere in a script? (I have the session_start(); at the very top of my page.) session_register( session_username ); session_register( session_level ); $session_username = $username; $session_level = $account_level; The resulting session is session_username|N;session_level|i:0; $username is set to warren and $account_level is set to 255. Any help would be greatly appreciated as I have gone through about 5 books and searched the net and can't find an answer as to why this isn't working. - This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient, please delete it and notify the sender. Views expressed in this message are those of the individual sender and are not necessarily the views of the Mid Western Area Health Service. - gwavasig -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] RE: [PHP] Selecting between using letters
How about the following; SELECT DISTINCT left( name, 1 ) AS idx, count( * ) FROM users GROUP BY idx produces a count of the names found for each letter, then you can make decisions about your range of letters, like a max of 250 between letters, or some such number. Warren Vail -Original Message- From: Doug Parker [mailto:[EMAIL PROTECTED] Sent: Monday, December 29, 2003 2:18 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [PHP] Selecting between using letters How would I create a select statement in MySQL that would return a range of records from the LastName field where the value starts with a designated letter - for example, returning the range where the first letter of LastName is between A and E... Any help would be greatly appreciated. http://www.phreshdesign.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Form response
Hi, RedHat 7.2 RPM with PostgreSQL 7.1.x and PHP 4.0.6 Page 111 of PHP and PostgreSQL, this form displays in Mozilla. The submit button is expected to run a script called reaction.php but it opens the script and displays the code. The response is the same with or without variable input. I changed the script file to executable: no effect. I can run 'reaction.php' from the shell and it works. What is the problem here? - form - html body A Simple Form brbr form action=reaction.php method=post input type=text name=field_1 size=10brbr input type=submit name=submitbutton /form /body /html - Reaction.php --action.php ?php if ($field_1) { echo field_1: $field_1; } else { echo nothing has been passed to this script; } ? -- run as stand alone php file - bash-2.05$ php reaction.php X-Powered-By: PHP/4.0.6 Content-type: text/html nothing has been passed to this script In: /etc/httpd/conf/httpd.conf AddType application/x-httpd-php .php (appears as above plus an entry for each of php2,3,4) LoadModule php4_modulemodules/libphp4.so LoadModule php_module modules/mod_php.so These were all uncommented in the RPM installation of RedHat 7.2. Somehow PHP is partially working... Any suggestions? I can create forms in php and tables in PostgreSQL but according to phpinfo(), php is not configured for PostfreSQL. If I survive this problem, that one is on the horizon. Does anyone have a generic list of things to do after an RPM installation of RedHat Linux 7.2 in order to use PHP with PostgreSQL? Thanks, Warren _ Send and receive Hotmail on your mobile device: http://mobile.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] php start-stop howto?
RedHat Linux 7.2 RPM installation included: PostgreSQL 7.1.3 PHP 4.0.6 Had no problem creating a database using pg but can't find the on/off button for php. PHP is installed in /usr/bin/php; /etc/php.ini; /usr/share/php I edited the php.ini file to specify a location for; usr_dir = The manual for PHP 4.2 (I have 4.0) suggested uncommenting extra module lines in http.conf. I don't know if that is an Apache, Linux or PHP file, but I can't find it in any of them. If I just start typing the hello world script linux wants to execute it after the first line. Put the entire script in an executable file and it doesn't like that either. What do I do next? Thanks, Warren _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] php start-stop howto?
Hay! It worked. A minor miracle... Thanks From: Adam Williams [EMAIL PROTECTED] To: Warren Massengill [EMAIL PROTECTED] CC: [EMAIL PROTECTED] Subject: Re: [PHP-DB] php start-stop howto? Date: Thu, 12 Sep 2002 13:19:03 -0500 (CDT) look in /etc/httpd/conf/httpd.conf when you restart apache (/etc/rc.d/init.d/httpd restart) it restarts php because php is called by apache. Adam On Thu, 12 Sep 2002, Warren Massengill wrote: RedHat Linux 7.2 RPM installation included: PostgreSQL 7.1.3 PHP 4.0.6 Had no problem creating a database using pg but can't find the on/off button for php. PHP is installed in /usr/bin/php; /etc/php.ini; /usr/share/php I edited the php.ini file to specify a location for; usr_dir = The manual for PHP 4.2 (I have 4.0) suggested uncommenting extra module lines in http.conf. I don't know if that is an Apache, Linux or PHP file, but I can't find it in any of them. If I just start typing the hello world script linux wants to execute it after the first line. Put the entire script in an executable file and it doesn't like that either. What do I do next? Thanks, Warren _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx _ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php