Re: [PHP] problem including a file
- Original Message - From: "Omar" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, December 30, 2002 1:32 PM Subject: [PHP] problem including a file > I have an include line in all the php files i write > something like --> include('connection.inc'); > The include path is d:\includes. (win nt 4, php 3.0.11) It worked fine > before but today failed to open the include file. > Does anyone has a clue about what could cause this problem? > Thank you. > Hello Omar, What error did you recieve? Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Multiple forms
- Original Message - From: "Doug Coning" <[EMAIL PROTECTED]> To: "php-general" <[EMAIL PROTECTED]> Sent: Monday, December 30, 2002 3:26 PM Subject: [PHP] Multiple forms > Hi all, > > I have an update page that has a form in it. > > However, I want to add another form in the same page. My current form acts > upon itself (i.e. Action = the same page). If I set up another form to do > the same, how would my PHP determine with action submit button was acted > upon? > > Currently, for the single form here is how it knows a form was submitted: > > if ((isset($HTTP_POST_VARS["MM_update"])) && ($HTTP_POST_VARS["MM_update"] > == "form1")) { > > How would I test which form submitted the action? > > Thanks and if I didn't make myself clear, I apologize. > > Doug > Hi Doug, I handle it like this (I think): Then, to process your form: I haven't done this in a while though, so this may not work for you. Good luck, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Missing logos
- Original Message - From: "Richard A Downing" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 31, 2002 5:54 AM Subject: [PHP] Missing logos > I have just installed 4.3.0 with apache2.0.43. > Running a standard test.php file consisting solely of: > > > > results in incorrect html with the image sources of the logo incorrectly > formed. See below. The src="d/public_html/test.php?=PHP... should, I > think be src="~/public_html/test.php?=PHP. > > I regret I'm neither an html expert nor, yet, a PHP user, the objective as > to get a system to learn with. > > As I can't find this reported here or in the bugs database, I suspect I have > made in installation error. Can anyone enlighten me? > > Thanks, > Richard Nothing is wrong with your installation. The image is just being pulled from a non-traditional location. tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3 & Apache 2
Yup, still experimental. But from what I've experienced, they work just fine together. I run Apache 2.0.43 and PHP 4.3.0 together without any problems what so ever. When you compile php with apache 2, remember to: ./configure --with-axps2 instead of ./configure --with-apxs tyler - Original Message - From: "Rasmus Lerdorf" <[EMAIL PROTECTED]> To: "Scott Seidl" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, January 01, 2003 10:59 PM Subject: Re: [PHP] PHP 4.3 & Apache 2 > It is still experimental. > > On Wed, 1 Jan 2003, Scott Seidl wrote: > > > Does the new release of PHP 4.3 have official support with Apache 2.x or is > > it still considered developmental? > > > > Thanks > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] getting result from mysql decode() function
Hi, I have this query: $decode = mysql_query("SELECT decode(\"$data\", \"$password\")"); It decodes the $data using the $password. How do I go about printing the result? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Redirect without header or javascipt
no tyler - Original Message - From: "Daniel Guerrier" <[EMAIL PROTECTED]> To: "php user group" <[EMAIL PROTECTED]> Sent: Tuesday, February 18, 2003 4:59 PM Subject: [PHP] Redirect without header or javascipt > Is there any to redirect in php with using header() > and without the use of javascript? > > __ > Do you Yahoo!? > Yahoo! Shopping - Send Flowers for Valentine's Day > http://shopping.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] What do these errors mean?
Hi, I was looking through php.ini and noticed that show_error was set to Off. I turned it On, and now I see these errors on one of my pages: Notice: Use of undefined constant option - assumed 'option' in /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37 Notice: Undefined index: option in /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37 Here's line 37-42: if ($_GET[option] == "") { print "Add Credit Card"; print " Credit Card Number: "; } What's wrong with that? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Cannot find php.ini
Default location is: /usr/local/lib/php.ini You can also do a: locate php.ini Good luck, Tyler - Original Message - From: "Kevin Paz" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 1:03 PM Subject: [PHP] Cannot find php.ini > > I've taken over a redhat server with apache/php4.1. I need to enable > register_argc_argv but I can't find the php.ini file (I've searched the > entire system). > > Would creating a new php.ini file with only register_argc_argv line work? > Where's the default location for php.ini? > > > Thanks in advance, > > Kevin > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What do these errors mean?
The actual name of the variable in that message is display_errors, not show_error. tyler - Original Message - From: "Tyler Longren" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Friday, February 21, 2003 1:01 PM Subject: [PHP] What do these errors mean? > Hi, > > I was looking through php.ini and noticed that show_error was set to Off. I > turned it On, and now I see these errors on one of my pages: > Notice: Use of undefined constant option - assumed 'option' in > /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37 > > Notice: Undefined index: option in > /usr/local/apache/htdocs/tyler/encodeDecode.php on line 37 > > Here's line 37-42: > if ($_GET[option] == "") { > print "Add Credit Card"; > print " > Credit Card Number: name=cc> > "; > } > > What's wrong with that? > > Thanks, > Tyler > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mcrypt not fully decrypting?
Hi, I'm going to start encrypting credit cards with the mcrypt functions. I encrypted the credit cards like so: $key = 'test'; $cc = "1234567890123456"; $td = mcrypt_module_open ('tripledes', '', 'ecb', ''); $key = substr ($key, 0, mcrypt_enc_get_key_size ($td)); $iv_size = mcrypt_enc_get_iv_size ($td); $iv = mcrypt_create_iv ($iv_size, MCRYPT_RAND); // Initialize encryption handle if (mcrypt_generic_init ($td, $key, $iv) != -1) { // Encrypt data $ciphertext = mcrypt_generic ($td, $cc); mcrypt_generic_deinit ($td); // Reinitialize buffers for decryption mcrypt_generic_init ($td, $key, $iv); $plaintext = mdecrypt_generic ($td, $ciphertext); // Clean up mcrypt_generic_deinit ($td); mcrypt_module_close ($td); print "Ciphertext: $ciphertext"; print "Plaintext: $plaintext"; } Sometimes, when I decrypt a cc it contains binary data...it's not fully decrypted. There's some plaintext in it and there's also binary. Does anyone know why this happens or how I can fix it? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP5?
the latest stable version of PHP works just fine with Apache 2.0.47. tyler - Original Message - From: "Jonathan Villa" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 23, 2003 11:47 AM Subject: [PHP] PHP5? > Has anyone installed PHP 5 on Apache 2.0.47? What version of Apache 2 > works best with PHP 5? > On both Windows and Linux? > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Using link to submit a form
Hi everyone, Can I replace "Submit" buttons on forms with a text button? I need to be able to click on a link: Edit and have it submit the form. The form only contains one field...does anyone know how to do this? I've been searching google for an answer, but couldn't find any info that really applies to my question. This isn't exactly a PHP related question, but php is hugely involved in this project. Thanks! Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_error() problem?
Hi, I'm running an UPDATE query on my table. After executing the query, I check mysql_error() to see if there's any errors: if (mysql_error() == "") { // success } else { // failure } mysql_error() is always empty even if the query didn't succeed. So it always thinks it succeeds. I remember having this problem once quite a while ago. I remember somebody telling me that it had something to do with UPDATE. Is there a better way to check for errors? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_error() problem?
hmmm...perhaps that was it. When I had this issue before, someone told me to check mysql_affected_rows() when using issuing an UPDATE query. I'll give that a shot. Thanks! Tyler - Original Message - From: "CPT John W. Holmes" <[EMAIL PROTECTED]> To: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Wednesday, August 06, 2003 3:35 PM Subject: Re: [PHP] mysql_error() problem? > From: "Tyler Longren" <[EMAIL PROTECTED]> > > I'm running an UPDATE query on my table. After executing the query, I > check > > mysql_error() to see if there's any errors: > > if (mysql_error() == "") { > > // success > > } > > else { > > // failure > > } > > > > mysql_error() is always empty even if the query didn't succeed. So it > > always thinks it succeeds. I remember having this problem once quite a > > while ago. I remember somebody telling me that it had something to do > with > > UPDATE. Is there a better way to check for errors? > > Please define "didn't succeed"... There is a difference between the query > "generated an error" which is caught with mysql_error() and the query "did > not affect any rows" which is caught by mysql_affected_rows(). > > ---John Holmes... > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Templates, custom functions, mysql
Hi list, I'm using TemplatePower (http://templatepower.codocad.com/) as my template engine. There will be multiple rows of results, and the data is stored in the $tpl->assign(); parts. The function gets projects for a given employee. My function is at the bottom of this e-mail. The problem is that I can't get the results to be printed to my $template, or $home_tpl. $home_tpl is named home.tpl, and that's where the html code is that displays the results from worker_projects(); Can anyone help me out here? If you need more info, just let me know. Tyler Longren [EMAIL PROTECTED] CODE BELOW function worker_projects() { $template = $home_tpl; $tpl = new TemplatePower("$template"); $tpl->prepare(); // Begin getting consulting projects. $consultingproject_sqltext = "SELECT customer.custid,customer.ownorgname,customerorder.custid,consultingproject.p rojectid,consultingproject.description,consultingproject.startdate,consultin gproject.enddate,consultingprojectassign.workerid,consultingprojectassign.pr ojectid FROM consultingproject,consultingprojectassign, customerorder, customer WHERE consultingprojectassign.workerid='$_COOKIE[workerid]' AND consultingproject.projectid=consultingprojectassign.projectid AND consultingproject.ordid = customerorder.ordid AND customer.custid = customerorder.custid ORDER BY enddate ASC"; $consultingproject_sql = mysql_query("$consultingproject_sqltext"); if (mysql_num_rows($consultingproject_sql) < "1") { $tpl->newBlock('no_consulting_projects'); $tpl->assign("no_consulting_projects","You don't have any consulting projects."); } else { $alternate = "1"; $tpl->newBlock('consulting_projects'); while ($row = mysql_fetch_array($consultingproject_sql)) { $tpl->newBlock('consulting_projects_data'); $tpl->assign("consulting_projectid","$row[projectid]"); $tpl->assign("consulting_company","$row[ownorgname]"); $tpl->assign("consulting_startdate","$row[startdate]"); $tpl->assign("consulting_enddate","$row[enddate]"); if ($alternate == "1") { $color = "#ff"; $tpl->assign("row_color","$color"); $alternate = "2"; } else { $color = "#cecece"; $tpl->assign("row_color","$color"); $alternate = "1"; } } } mysql_close($connection); $tpl->printToScreen(); return $tpl; // End getting consulting projects. } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Duplicate records
why not just make the 'id' field in the table auto_increment? tyler - Original Message - From: "Steve Marquez" <[EMAIL PROTECTED]> To: "MySQL List" <[EMAIL PROTECTED]> Cc: "PHP eMail List" <[EMAIL PROTECTED]> Sent: Friday, June 06, 2003 2:40 PM Subject: [PHP] Duplicate records > Hello. > > I am adding a record to a MySQL Database using PHP. I have the records > listed by the field: $id_num. > > I want the DB to be updated only with new id numbers, and return an error if > there is a duplicate number already in the DB. > > Here is the code I am using: > > > $insert_data = "INSERT into articles > > Values ( 'edit', ' href=\"delete.php?id_num=$id_num\">delete', '$id_num', '$title', > '$author', '$article_contents', '$start_date', '' );"; > > $response = mysql_query( $insert_data, $dbh ); > > > $get_table_data = "SELECT * FROM ccfs"; > $response = mysql_query( $get_table_data, $dbh ); > > ?> > > Can anyone help me? Hope this makes sense. > > Thanks! > > Steve Marquez > Marquez Design > [EMAIL PROTECTED] > > www.marquez-design.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions?
Did you try taking a look at the manual? Tyler - Original Message - From: "Lee Elenbaas" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 18, 2003 1:06 PM Subject: [PHP] Sessions? > Hi, > > I have failed to find the information I am looking for on session management > by PHP - do they use cookies? Is there a way to use URL rewriting? How do I > find the timeout time? is there a way to close a session manually? > It seem to me like all those questions got to have answers for them > somewhere, I just look in the wrong place > Help is appreciated :-) > > lee > > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.490 / Virus Database: 289 - Release Date: 16/06/2003 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploading images
Hi, I'm trying to upload a small image via a form. This code worked with php versions prior to 4.1.0. I assume it would still work if register_globals was turned on. Here's the error: Warning: fread(): supplied argument is not a valid stream resource in /home/sites/site2/users/tyler/web/upload.php on line 28 And here's line 28: $data = fread(fopen($_POST['binFile'], "r"), filesize($_POST['binFile'])); Am I doing that correctly? If you need to see more code, let me know. Thanks everyone! Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image upload into database
Are you trying to upload the same image as you did at home? If so, size isn't the problem if you can do it from home. It might be a timeout issue. There might be something in php.ini you can set for timeout. You can specify the max filesize to upload in php.ini also. Good luck, Tyler On Wed, 24 Jul 2002 19:43:37 -0400 (EDT) Jesse Lawrence <[EMAIL PROTECTED]> wrote: > I've setup an image upload feature on a site, which > uploads images into a mysql database. > > The uploads are working absolutely as expected on my > local computer (the server), but when someone else > tried to upload, only 1/3 of the image was uploaded. > Could it be a matter of size? I was originally using > just a Blob, and have since switched to a Long Blob. > Any thoughts or comments on this would be greatly > appreciated. > > Thanks a bunch, > > Jesse > > __ > > Post your ad for free now! http://personals.yahoo.ca > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pdf to html
Hi, I've been searching around for ways to convert pdf to html. I haven't had much luck. I have a client that has a bunch of pdf's stored in a mysql table. They don't want their users to have to download the pdf file, they want the pdf to be displayed in the web browser all the time. Google has something that allows them to convert pdf to html, so, is it possible for me to do the same? These pdf's are graphic intensive...there's not much plain text. Thanks everyone, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Paying Job...
Charge by which ever will get you the most money. tyler On Thu, 25 Jul 2002 11:46:38 -0400 Gerard Samuel <[EMAIL PROTECTED]> wrote: > Basically, someone is looking to get a database driven site built, > and Ive never written code for money before. > Im looking for advice, as to how the experienced coders in here charge > > for their work. > Do you charge by the page, script or by the hour (that would be nice). > > Thanks for any input you may provide... > > -- > Gerard Samuel > http://www.trini0.org:81/ > http://dev.trini0.org:81/ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Paying Job...
Why even bother charging money if you aren't out to make as much as you can? That's just my point of view. tyler On Thu, 25 Jul 2002 11:59:28 -0400 "Martin Clifford" <[EMAIL PROTECTED]> wrote: > <> > > Why didn't you just say, "Charge by whichever will screw the client > the worst."? Jesus. > > Martin > > >>> Tyler Longren <[EMAIL PROTECTED]> 07/25/02 11:44AM >>> > Charge by which ever will get you the most money. > > tyler > > On Thu, 25 Jul 2002 11:46:38 -0400 > Gerard Samuel <[EMAIL PROTECTED]> wrote: > > > Basically, someone is looking to get a database driven site built, > > and Ive never written code for money before. > > Im looking for advice, as to how the experienced coders in here > > charge > > > > for their work. > > Do you charge by the page, script or by the hour (that would be > > nice). > > > > Thanks for any input you may provide... > > > > -- > > Gerard Samuel > > http://www.trini0.org:81/ > > http://dev.trini0.org:81/ > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Installation Problem
I'm not sure exactly what you're saying, but it sounds to me like you didn't configure --with-mysql for the new server. You MUST do that. ./configure --with-apxs=/blah/blah --with-mysql If you don't have --with-mysql compiled into the php binary, mysql functions won't work. Tyler On Tue, 30 Jul 2002 09:34:04 +0100 "Mark Colvin" <[EMAIL PROTECTED]> wrote: > I have a development web server php 4.0.6 apache and mysql and > everything works OK. I installed the same software onto a new server > that will be the production server but I hit problems when my scripts > try and hit the db on the new server. Comparing the phpinfo details > for both, the new server does not have a mysql section it. I copied > the original php.ini onto the new server and restarted apache after > the installation. Where have I missed this in the installation process > and how should I resolve it? As an aside question, is there any > glaring issues I may encounter if I upgrade php to 4.2.2 from 4.0.6? > > > > This e-mail is intended for the recipient only and > may contain confidential information. If you are > not the intended recipient then you should reply > to the sender and take no further ation based > upon the content of the message. > Internet e-mails are not necessarily secure and > CCM Limited does not accept any responsibility > for changes made to this message. > Although checks have been made to ensure this > message and any attchments are free from viruses > the recipient should ensure that this is the case. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] still need help with crash on make
Use apache 1.3.26 and it'll work. Just change the configure line: ./configure --with-mysql --with-apxs=/path/to/apxs Apache 2 is troublesome. tyler On Wed, 31 Jul 2002 17:27:30 -0500 "Kirk Babb" <[EMAIL PROTECTED]> wrote: > Could somebody help me with this?.I posted yesterday with only one > reply...please read the following and let me know where I'm going > wrong. THANKS!!! > > -Kirk > > BEGIN MESSAGE > > > > > Yes, I configured apache with mod_so enabled and the > > module is there. Still crashes on make. > > > >-Kirk > > You chose to compile PHP as a DSO this requires apache to have the > mod_so module, you can check this by doing a > httpd -l in your apache's bin directory. > > I'm attempting to compile php 4.2.2 and apache 2.0.39 (both of which > > I downloaded today) on mandrake 8.1. I've followed the generic > > unix directions on php.net and at these steps > > > > $root> ./configure --with-mysql --with-apxs2=/www/bin/apxs > > > > followed by > > > > $root> make > > > > the process crashes with errors at the end of the make: > > > > -DTHREAD=1 -g -O2 -pthread -DZTS -prefer-pic -c php_functions.c > > php_functions.c:93:27: missing binary operator before '!' > > make[3]: *** [php_functions.lo] Error 1 > > make[3]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > > make[2]: *** [all-recursive] Error 1 > > make[2]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > > make[1]: *** [all-recursive] Error 1 > > make[1]: Leaving directory `/usr/local/php-4.2.2/sapi' > > make: *** [all-recursive] Error 1 > > > > Can somebody point out what I need to do to correct this? It > > doesn't make sense that the code I downloaded from php.net would > > have a problem since that's a stable release. > > > > TIA! > > > > -Kirk > > > > -- > > K.B. BABB > > email: [EMAIL PROTECTED] > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -Pushkar S. Pradhan > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] toolbar.google.com
It's called Google Magic. I don't really know the answer to your question. Google does a lot of really neat things (like converting pdf to html). tyler On Thu, 1 Aug 2002 08:17:35 +0100 "Lord Loh." <[EMAIL PROTECTED]> wrote: > Google uses php to make a software download and installs it through > the browser! > > How does this work ? > > Lord Loh. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] My SQL speed.
> Should this be asked in a mysql list ? Please suggest a NNTP server! You could always take this to the mysql mailing list [EMAIL PROTECTED] tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hacker?
block his ip at the router. tyler On Sun, 11 Aug 2002 16:21:07 -0600 "RPS Internet" <[EMAIL PROTECTED]> wrote: > My server is getting odd request form an outside computer. Upon > looking into the requests I have found his PHP Config file is point to > my server as the HTTP_VIA and other vars. I am wondering how I can > deny him access since he is forwarding all request through my server > with these settings. My server is only running ports 22, 25 and 110 so > will his requests still run php since it is installed? > > > Thanks, > Josh Thomas > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hacker?
So what? You don't want him using your stuff anyway do you? tyler On Sun, 11 Aug 2002 16:33:17 -0600 "RPS Internet" <[EMAIL PROTECTED]> wrote: > What about all the users of his web site that are requesting his php > scrpts that are compiling through my server? > > -----Original Message- > From: Tyler Longren [mailto:[EMAIL PROTECTED]] > Sent: Sunday, August 11, 2002 4:15 PM > To: RPS Internet > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP] Hacker? > > > block his ip at the router. > > tyler > > On Sun, 11 Aug 2002 16:21:07 -0600 > "RPS Internet" <[EMAIL PROTECTED]> wrote: > > > My server is getting odd request form an outside computer. Upon > > looking into the requests I have found his PHP Config file is point > > to my server as the HTTP_VIA and other vars. I am wondering how I > > can deny him access since he is forwarding all request through my > > server with these settings. My server is only running ports 22, 25 > > and 110 so will his requests still run php since it is installed? > > > > > > Thanks, > > Josh Thomas > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Proxy taking me to localhost.com
This is the greatest php related question I have ever seen. tyler On Wed, 28 Aug 2002 15:23:48 -0400 [EMAIL PROTECTED] wrote: > > Hey, > I am on a cable connection...and to connect to the net my provider > gave me an address where my browser would get automatically > configured...maybe because of that I am goint to localhost.com? I may > be way off track here coz I dont know the first thing about what the > heck a proxy itself is but. > > > Please reply, > -Ryan. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Hardware Address
using exec() or system() will only be able to execute commands on the machine php is installed on. I sometimes wonder how universities and broadband isp's do this. I'd be interested in seeing how it works. Sorry, I'm not much help anymore. tyler On Fri, 6 Sep 2002 01:24:07 +0200 <[EMAIL PROTECTED]> wrote: > Hi, > > The best way I think is to use exec() or system() to ask that to the > system. May be someone knows something better too. > > -- > > Nicos - CHAILLAN Nicolas > [EMAIL PROTECTED] > www.WorldAKT.com - Hébergement de sites Internet > > "Chris Cook" <[EMAIL PROTECTED]> a écrit dans le message de news: > [EMAIL PROTECTED] > > Hello all, > > > > I am working on a LAN application and am interested in obtaining the > user's > > network card address to limit usage of the program. Is there a way > > to do this in PHP? > > > > I am on a network that uses DHCP so using the IP address probably > > wont > work > > and I am also worried about IP spoofing. > > > > Thanks for any help you can provide, > > Chris > > > > > > _ > > Send and receive Hotmail on your mobile device: > > http://mobile.msn.com > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Count in PHP
$sql = mysql_query("SELECT * FROM table ORDER BY whatever"); echo(mysql_num_rows($sql)); that should do it. tyler On Tue, 10 Sep 2002 00:58:26 -0400 "Chuck \"PUP\" Payne" <[EMAIL PROTECTED]> wrote: > I am wanting to do a count in PHP. I want to be able to count the > number of records from a given database and display this count on the > page. Can this be done using PHP or is the sql thing? > > Chuck Payne > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] subdomain
Try this: $subdomain = $_SERVER["SERVER_NAME"]; And then get all the text before the first ".". Tyler On Wed, 11 Sep 2002 10:55:56 +1000 "Liam MacKenzie" <[EMAIL PROTECTED]> wrote: > G'day everyone, > > I have a dilemma... > I'm running BIND locally, with a wildcard A record. > That means that if someone goes to http://somebullshit.mydomain.com/ > they'll get my page up. > > What I want to do is catch that subdomain into a variable... Is there > a PHP global that can get that? > So, if someone goes to http://liam.mydomain.com/, the page will echo > "Hello Liam" > > Any ideas guys? > > Cheers, > Liam > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Don't read if easily offended...
You should check to make sure the variable isn't empty. And if it is put some other name in there (like Bill Clinton). Cuz if you go to just http://fuckedyourmum.com, you just get: "fucked your Mum!!!" for text. Just a suggestion, Tyler On Wed, 11 Sep 2002 12:08:03 +1000 "Liam MacKenzie" <[EMAIL PROTECTED]> wrote: > Give a man a day at home sick with nothing to do, and you get some... > Interesting results... > > http://bill.clinton.fuckedyourmum.com/ > > Try your mate's name in there... =) > > Thank's for everyone's help in producing this absolutely useless > masterpiece! > > Cheers, > Liam > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange bug(?) when opening lots of files
How long does the script tend to run before it just "quits"? Perhaps a timeout is set too low in php.ini. Take a look at max_execution_time in php.ini tyler On Tue, 17 Sep 2002 23:14:46 +0100 Shane Wright <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Hi > > One of my pages opens ~100 files, reads from them, and closes them, > (only one file open at a time). > > The problem is that the page just dies mid-way through execution - no > errors, no segfault, it just dies and returns a blank page to the > user. the problem goes away if I reduce the number of files accessed. > > its a build of PHP 4.1.2 on Linux running as an Apache module, (if it > makes any odds, the configure line is below). > > I can't see anything on bugs.php.net about this - has anyone seen this > before (and, of course, the crucial question; what can I do to fix > it?) > > Any help appreciated, > > Thanks > > - -- > Shane > http://www.shanewright.co.uk/ > Public key: http://www.shanewright.co.uk/files/public_key.asc > > > './configure' '--with-gd' '--enable-gd-native-ttf' > '--enable-track-vars' > '--enable-sysvsem' '--enable-sysvshm' '--enable-calendar' > '--with-zlib' '--prefix=/opt/php-4.1' > '--with-config-file-path=/usr/local/etc/httpd/conf' > '--enable-memory-limit' '--with-db2=/usr' '--with-db3=/usr' > '--with-gdbm=/usr' '--with-ndbm=/usr' '--with-dbase' '--with-xml' > '--with-expat-dir=/usr' '--enable-debugger' '--enable-ftp' > '--with-ttf' '--with-jpeg-dir=/usr' '--enable-bcmath' '--with-openssl' > > '--enable-trans-sid' '--with-mysql=/usr' '--with-xpm-dir=/usr/X11R6' > '--with-png' '--with-png-dir=/usr' '--with-imap' '--with-dom=/usr' > '--with-bz2' '--with-curl' '--with-mhash=/usr' '--with-mcrypt=/usr' > '--with-pgsql' '--with-gmp' '--with-gettext' '--with-iconv' > '--with-kerberos' '--enable-xslt' '--with-xslt-sablot' > '--with-freetype-dir=/usr' '--with-apxs=/usr/sbin/apxs' > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.0.7 (GNU/Linux) > > iD8DBQE9h6lW5DXg6dCMBrQRAhhiAKCIo1xdyyDtx7fT8SO8Xz4bfWOg7QCfdjE3 > STUVeNEID6bzu4+hq+PqCI4= > =zZqL > -END PGP SIGNATURE- > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHPTriad on Windows XP?
Did you even try to find the answer by yourself? You could have found the answer to this on the PHPTriad(now called Sokkit) homepage: http://www.phpgeek.com/sokkit/ The answer is listed under "Sokkit Requirements". tyler On Tue, 1 Oct 2002 17:19:13 -0500 "Stephen" <[EMAIL PROTECTED]> wrote: > Just wondering but is it possible to install and use PHPTriad on > Windows XP Professional? I had it on my Windows 98 machiene but then > formatted and went up to Windows XP Pro. > > Thanks, > Stephen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP version
yes, that would work much better. tyler On Tue, 01 Oct 2002 20:11:21 -0400 Brad Bonkoski <[EMAIL PROTECTED]> wrote: > Sorry... > I think: > http://www.php.net/manual/en/function.phpversion.php > will be more inline with what you want... > -Brad > > Alex Shi wrote: > > > Is there any way to report PHP version? > > > > -- > > --- > > TrafficBuilder Network: > > http://www.bestadv.net/index.cfm?ref=7029 > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP version
You can get it out of this variable: _SERVER["SERVER_SOFTWARE"] tyler On Tue, 1 Oct 2002 20:03:25 -0400 "Alex Shi" <[EMAIL PROTECTED]> wrote: > Is there any way to report PHP version? > > > -- > --- > TrafficBuilder Network: > http://www.bestadv.net/index.cfm?ref=7029 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The latest PHP version??? NOT Ver7.2??
latest version is: 4.2.3 not 7.2 tyler On Wed, 2 Oct 2002 10:36:08 +0800 (CST) ¼ÒÎÄ ·½ <[EMAIL PROTECTED]> wrote: > thanks. > > Can you email me??? > > _ > Do You Yahoo!? > "·¢¶ÌÐÅÓ®ÊÖ»ú,¿ìÀ´²Î¼ÓÑÅ»¢¾ÞÐÇÐã!" > http://cn.ent.yahoo.com/star/midautumn/index.html > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] redirection
I think that's pretty much your only option. You could use javascript to redirect if you wanted. Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: "Renaldo De Silva" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, June 05, 2002 1:45 PM Subject: [PHP] redirection > is there any way other than > > header("Location: http://www.php.net/";); > > to redirect to another page. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] days between two timestamps
Hi, I have two different timestamps: 20020603164114 and 20020605054710 Is there a simple way to get the number of days between the two dates? thanks, tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] days between two timestamps
Hi All, Yes, they are mysql timestamps. I'll just use the query John suggested and modify it to fit my needs. I was originally going to do something like Martin suggested, but if I can do it right in MySQL, I'll do it that way. Thanks all! tyler - Original Message - From: "1LT John W. Holmes" <[EMAIL PROTECTED]> To: "Tyler Longren" <[EMAIL PROTECTED]>; "php-general" <[EMAIL PROTECTED]> Sent: Wednesday, June 05, 2002 10:09 AM Subject: Re: [PHP] days between two timestamps > Since those look like MySQL timestamps, I would suggest you do it in your > query. > > SELECT TO_DAYS(column1) - TO_DAYS(column2) AS Difference FROM table > > Adapt to your needs. > > Explain what your overall mission is and there is probably a query that'll > return just that. > > If you want to use PHP, format those timestamps into something strtotime() > will convert to a unix timestamp, find the difference in seconds, and > convert the number of seconds into days. > > ---John Holmes... > > - Original Message - > From: "Tyler Longren" <[EMAIL PROTECTED]> > To: "php-general" <[EMAIL PROTECTED]> > Sent: Wednesday, June 05, 2002 11:01 AM > Subject: [PHP] days between two timestamps > > > > Hi, > > > > I have two different timestamps: > > 20020603164114 > > and > > 20020605054710 > > > > Is there a simple way to get the number of days between the two dates? > > > > thanks, > > tyler > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Best way to store 1000 char in a database
What do you mean "the best way"? Do you mean which data type you should give the field? A bit more info please. :-) Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 8:50 PM Subject: [PHP] Best way to store 1000 char in a database What is the best way to store text with up to 1000 characters in a mySQL database? Sorry for the slightly of topic posting but I am not going to join another mailing list unless I have to. I am going to create a weekly qoute generator thingy for my site. JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with MySQL
you need to put your $myrow in a while loop: while ($myrow = mysql_fetch_array($result)) { $title = $myrow[title]; $videoid = $myrow[videoid]; $catergory = $myrow[catergory]; $appraisal = $myrow[appraisal]; // blah blah blah everything else } Tyler Longren Captain Jack Communications www.captainjack.com [EMAIL PROTECTED] - Original Message - From: "Chuck Payne" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Friday, June 14, 2002 11:03 PM Subject: [PHP] Problem with MySQL Hi, I am working on a movie database I have two database that I am calling from but the problem I am having when I ask it to go and fetch all the movies with the same title, it stops and only shows one. Here is a basic layout... if($videoid) { $result = mysql_query("SELECT * FROM library WHERE videoid=$videoid",$db); $myrow = mysql_fetch_array($result); // The Myrows $title = $myrow[title]; $videoid = $myrow[videoid]; $catergory = $myrow[catergory]; $appraisal = $myrow[appraisal]; // Some where here it's not working. $sql = "SELECT concat_ws(' ', fname, lname)as actor FROM actormovie WHERE title = '$title' ORDER by lname"; $result = mysql_query($sql); print $sql; $actor = ""; while ($myrow = mysql_fetch_array($result)) { $actor = $myrow[actor]; $actor .= "" . $actor . "\n"; } What am I doing wrong? It only show one record and it show more. Chuck Payne -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Need help
If you don't have cURL Installed yet, you can get it for Win32 here: http://curl.haxx.se/download.html On Tue, 2002-06-18 at 09:30, Barbara wrote: > I want to know how I have to install cURL on my apache server. My apache server is >running on Windows ME. > Thanks for all. > Barbara Guillen. > Spain -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Error Reporing Questions with Mac
Perhaps it was a typo, but "parse error on line 1" does state the line number. tyler On Tue, 2002-06-18 at 09:57, Kevin Ruiz wrote: > I'm running php 4 on a unix server and am experiencing a problem with error > reporting I'm getting on my mac. > > When I get a parse error it won't tell me what line the error is on...it > simply says "parse error on line 1". When I test the page on a pc I get an > error message that I can use... "parse error on line 143". > > Does anyone have any ideas? I get the same error when using IE for both OS > X and 9. > > Thanks in advance, > Kevin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] linux: how can I check if php/mysql is working properly?
Just for future reference, you don't actually need to put the 'echo' before the phpinfo(). Calling phpinfo() by itself will print the desired info. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 18 Jun 2002 15:30:38 -0400 (EDT) Scott <[EMAIL PROTECTED]> wrote: > If you told RH to install PHP/MySQL/Apache then everything should be > ok. I forget the default document root, but what happens if you put a > test.php with this in it: > > > echo phpinfo(); > > ?> > > Other than that it should work out of the box, just make sure you get > the patches. > > > > > On Tue, 18 Jun 2002, Phil Schwarzmann wrote: > > > i have some php files in /var/www/html/ and none of the php is > > working properly. > > > > all i've done so far is installed Linux Red Hat 7.2 and > > php/mysql/apache is supposedly already installed with Redhat. How > > do I get this stuff configured? Anyone have a nice link? > > > > > > > > -- > - > Now Playing: Simple Minds - All The Things She Said > Server Uptime: 189 days > > www.scottah.com > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 4.3 and php_pgsql.dll
Why don't you just use 4.2? I wouldn't use 4.3 on a linux box, let alone a windows xp machine. Give it a try with 4.2. If it works, then it is indeed a version conflict. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 18 Jun 2002 21:30:22 -0700 (PDT) Alexander Javier <[EMAIL PROTECTED]> wrote: > hello people, i seem to have a little problem here. I > hope someone could help. > > i have a machine running apache on linux and another > one with apache on winxp. > > i've downloaded and installed the php-4.3-alpha > version s for linux and windows. mysteriously, the > php_pgsql.dll is not included in the windows zip file. > so, i used the one that came with php-4.2 for > windows. > > i used php as a sapi module in apache. apache displays > an error message that says it fails to load the > php_pgsql.dll extension. > > could it be of the version conflict? or what? please > help!!! > > > > > = > > > > > __ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] increasing max size to upload
Change upload_max_filesize in php.ini to the value you desire. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Thu, 20 Jun 2002 12:12:33 -0400 "Anil Garg" <[EMAIL PROTECTED]> wrote: > hi, > > how can i change the maximum size of the file being uploaded?? > The line below does not seem to help me: > > > Do i need to make some more changes?? > php ver i am using is mod_php4-4.1.2 > > I dont have a php.ini file anywhere!! i just have a file php.ini-dist > in/usr/local/etc/ ...but i dont think it is being used. > > thanx > anil > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] display_error=Off in php.ini
Did you restart your webserver after you made the change in php.ini? If you didn't, make sure you restart it now. Restarting your webserver should fix it. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Fri, 21 Jun 2002 12:57:34 -0400 "Anil Garg" <[EMAIL PROTECTED]> wrote: > Hi, > > In php.ini file i have set: > display_errors = Off > log_errors = /var/log/php-errors.log > > but i cant see anything coming in to php-errors.log file. > I have tried to change the query in my php code...but it dispays error > on the gui( the display errors doesnt seem to get off). > > I hope someone can help me with this. > > thanx > anil > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Security problem?
No. The only way they can get your source is by ftping or having shell access to your server. And even then, they'd have to have read perms on your web folder/files. If you were to have a lot of unknown people jacking around on your server, you have a lot of other stuff to worry about that who's gonna steal your mysql username/password. They can't just say: Download http://yoursite.com/file_with_good_info.php and get the php-source, all they'd get is the HTML source. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 25 Jun 2002 20:46:04 +0100 "Peter" <[EMAIL PROTECTED]> wrote: > When you have the standard > > $link = mysql_connect("localhost","username","secretpassword"); > > Would it not be possible for someone to use PHP from another server to > download your source and find out your MySQL details including > password? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Uploading files
Hello, I usually use this code to upload files when I have a form with It no longer works for some reason: $data = fread(fopen("$_POST[passcodeFile]", "r"), filesize("$_POST[passcodeFile]")); Here are the errors that it produces: Warning: fopen("", "r") - Success in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 146 Warning: stat failed for (errno=2 - No such file or directory) in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 146 Warning: fread(): supplied argument is not a valid File-Handle resource in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 146 The "$data =" line is line number 146. Does anyone seen anything wrong with this? Thanks, -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] forms and files
Hi, I have a form kinda like this: the rest of the form is there too. And $PHP_SELF is set to $PHP_SELF = $_SERVER[PHP_SELF] at the top of the page. When I select a passcodeFile file to upload and click the "upload" button, I am presented with this on the next page: "You need to specify a file to use." Here's what I did: if ($_POST[passcodeFile] == "") { print "You need to specify a file to use."; } Any ideas why it does that even if I do select a file? Thanks, tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] forms and files
On Tue, 2 Jul 2002 23:45:56 +0800 Jason Wong <[EMAIL PROTECTED]> wrote: > On Tuesday 02 July 2002 23:34, Tyler Longren wrote: > > Hi, > > > > I have a form kinda like this: > > > enctype=multipart/form-data> > > > > You really should use "" around your tag values. What you have is > invalid HTML. > > > the rest of the form is there too. And $PHP_SELF is set to > > $PHP_SELF =$_SERVER[PHP_SELF] at the top of the page. > > > > When I select a passcodeFile file to upload and click the "upload" > > button, I am presented with this on the next page: > > "You need to specify a file to use." > > > > Here's what I did: > > if ($_POST[passcodeFile] == "") { > > print "You need to specify a file to use."; > > } > > > > Any ideas why it does that even if I do select a file? > > 1) print_r($_POST) to see what you have, while you're at it, do the > same for $_FILES. > > 2) Use the example(s) in the manual, once you have them working modify > to suit. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development > * > > /* > Nature always sides with the hidden flaw. > */ that worked. I had to use _FILES instead of _POST I still get these errors though: "Warning: fopen("", "r") - Success in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151 Warning: stat failed for (errno=2 - No such file or directory) in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151 Warning: fread(): supplied argument is not a valid File-Handle resource in /usr/local/apache/htdocs/cj/aanr/admin/passcode_admin.php on line 151" And here's the line that produces them: $data = fread(fopen("$_FILES[passcodeFile_name]", "r"), filesize("$_FILES[passcodeFile]")); any ideas on that one? This is the problem I have been working on for a few days now. Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help - I'm New
you must be tired from searching the manual all day for your answer. :) Check here: http://www.php.net/manual/en/install.apache.php There's a section on installing with Win32 -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 2 Jul 2002 17:14:32 -0400 "admin" <[EMAIL PROTECTED]> wrote: > Hi, first let me introduce myself... > > My name is Kit, and I own the domain below > and host sites from off that domain. > > I'm new to using PHP...and need some help. > > 1. I have apache for win32 1.3.26 setup > on my w2k pro at home, and need to know > how to enable PHP in the config. > > 2. I also have a PHP website, and need to know > how to include "FORMS" for subscribing to newletters > in a file called "header.php" > > <*** http://www.myispnet.net ***> >Administrator >My ISP Network >[EMAIL PROTECTED] > <*** http://www.myispcentral.net ***> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Stupid install ???
I'll assume you're using Apache. Did you add (or uncomment) the relavent lines in httpd.conf? Check the php installation manual for the lines to add. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 9 Jul 2002 12:02:27 -0500 "Hopp3r" <[EMAIL PROTECTED]> wrote: > I have installed PHP4.2.1 and when I open a browser to look at a test > php page? all I see is the php code, not the output of phpinfo(). I > know it is something small that I have overlooked. Can someone help? > Please??? > > Thanks in advance, > RC Hopp3r > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SQL field problem
I think you want to use group by: SELECT * FROM table GROUP BY kat; -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Wed, 10 Jul 2002 19:40:11 +0200 <[EMAIL PROTECTED]> wrote: > Hello > > I have a problem with mysql.I create a table with a field "kat".In > this field are entries like this : > > Light > Dark > Dark > Light > Robot > Find > Dark > Light > > You see that all entries are not unique.So i want to list as output > all entries but only once.If the word "Dark" is in the table 6 times > php should output dark only 1 time. How should i solve this problem ? > > Thanks! > chris > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HTTP_USER_AGENT?
It works for you because you have register_globals set to "on" in php.ini. If you set it to "off" it won't work any longer. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Thu, 11 Jul 2002 08:07:48 +0530 "Balaji Ankem" <[EMAIL PROTECTED]> wrote: > It is working fine for me!!! > > > -Original Message- > From: George Hester [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 11, 2002 8:03 AM > To: [EMAIL PROTECTED] > Subject: [PHP] HTTP_USER_AGENT? > > > I have this in my web site not in an executable folder: > > > > My First PHP Program > > > > > > > No problem. I then put this in the same folder: > > > > My Second PHP Program > > > > > > > Nothing appears. What's wrong? > > > -- > George Hester > _ > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] need help about this
"Table 'book_auth' already exists" means that you're trying to create the 'book_auth' table again, even though it already exists. Remove the old 'book_auth' table to create the new one. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Thu, 11 Jul 2002 13:51:43 +0700 [EMAIL PROTECTED] wrote: > MySQL Error : Database Error > Error Number: 1050 Table 'book_auth' already exists > --- > - > what this meant? > what should i do for correct this > thaank you for your help > > sincerly your > -- tjandra > > > == > This email is confidential and may also be privileged. > If you are not the intended recipient, please notify me immediately > and delete the original message. You should not copy or use it for > any other purpose, nor disclose its > contents to any other person. Thank you. > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php4apache.dll...
Use this file instead: php4apache2.dll It's supposedly in the sapi directory. Did you search the internet for this subject before you posted? If not, you should have. There's lots of info on this "missing" file. if you can't find a working version anywhere, mail the php-dev mailing list, they can probably help you out more. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Thu, 11 Jul 2002 16:22:27 +1000 "Peter" <[EMAIL PROTECTED]> wrote: > Howdy > > can any one remember where to get the apache2 ver of php4apache.dll? > > Cheers > > Peter > "the only dumb question is the one that wasn't asked" > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Table Making
I'm not sure if you can do that because you have to go row by row when writing html, not column by column. I could be mistaken though. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Wed, 10 Jul 2002 22:34:15 -0800 "Jason Soza" <[EMAIL PROTECTED]> wrote: > Thanks for the code improvement, but that will still print results > from left to right, top to bottom, i.e. the items ascend left to right > in the rows. I'm not concerned with the actual order that they come > out of MySQL in, just how they're displayed. > > Basically, instead of this: > 1 2 3 4 5 > 6 7 8 9 10 > 11 12 13 14 15 > > I want this: > 1 6 11 > 2 7 12 > 3 8 13 > 4 9 14 > 5 10 15 > > Thanks again for the help, though. > > Jason Soza > > -Original Message- > From: Analysis & Solutions [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, July 10, 2002 10:13 PM > To: PHP List > Subject: Re: [PHP] Table Making > > > Jason: > > On Wed, Jul 10, 2002 at 10:04:45PM -0800, Jason Soza wrote: > > > > I have this nice piece of code to take my SQL result and organize it > > into > a > > nice 5 column table: > > Nice is in the eye of the beholder... Here's what I think is nice: > > echo "\n"; > echo " \n"; > > while ($row = mysql_fetch_array($sql, MYSQL_ASSOC)) { > echo ' ' . $row['grad_year'] . > "\n"; > } > > echo " \n"; > echo "\n\n"; > > If you want to reverse the order, use an ORDER BY clause in your query > string. > > --Dan > > -- >PHP classes that make web design easier > SQL Solution | Layout Solution | Form Solution > sqlsolution.info | layoutsolution.info | formsolution.info > T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y > 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling with mysql
I've never compiled php with the path to mysql. I've done this on lots of different servers, and it always works. I don't know if it's the proper way of doing things, but it does work. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Fri, 12 Jul 2002 10:02:40 +0930 (CST) Michael Hall <[EMAIL PROTECTED]> wrote: > > Another PHP compilation question ... > > I've just compiled PHP 4.2.1 --with-mysql. I added no path to mysql, > and it worked fine as it always does. However, I'm keen to add > mod_python as a DSO to Apache as well, and noticed in PHP's INSTALL > notes that I'll probably need to recompile PHP with a path to mysql: > > --with-mysql=/somewhere/or/other/ > > 1. Is this always the case? > > 2. Where would the path be likely to be on RedHat 7.2 with MySQL rpms? > > TIA > > > Michael Hall [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] compiling and php.ini
If you do: --with-mysql, it can't be disabled in php.ini, however you can change options in php.ini that deal with connecting to a mysql server. If you had copied the php.ini-dist file, your magic_quotes would probably have been set to "on". I'm not sure if the php.ini-recommended gets updated after running the configure script. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Fri, 12 Jul 2002 09:56:52 +0930 (CST) Michael Hall <[EMAIL PROTECTED]> wrote: > > I've just compiled PHP 4.2.1 with Apache 1.3.24 on RedHat 7.2. > Everything works just fine as usual. I've got a couple of queries, > however. > > I compiled with the --enable-magic-quotes option, then figured this > was a bad move as I've been caught out before with scripts that assume > it is on. So, I copied the php.ini-recommended file to php.ini, and > now phpinfo() tells me that magic_quotes_gpc and magic_quotes_runtime > are off. > > So, does compiling with --enable-magic-quotes have any effects if > magic quotes are turned off in php.ini? Are they "really" off? > > Can all "--enable-whatever" options be turned on/off in php.ini, > regardless of ./configure options? > > Does the "-with-config-file-path" option set the expected path to > php.ini(I always thought it was to Apache)? How come PHP still works > whether the file is there or not? > > TIA > > > > Michael Hall [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] uploads work sometimes
Hi, I have a form: And the code that processes the form: if ($_FILES['pdfFile']['name'] == "") { print "You must select a file to upload"; } else { // code to add data to db } This works on my server at home (when I select a file to upload, it sees the filename in $_FILES['pdfFile']['name'], but on a server at work, it's blank so I see the error "You must select a file to upload". Any ideas on why this might happen? Is there anything in php.ini that could be wrong (it works here at home when register_globals is set to on or off)? Thanks everyone, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Apache 2.0 + PHP
In a production environment: no for fun: yes -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Tue, 16 Jul 2002 09:13:41 +0930 (CST) Michael Hall <[EMAIL PROTECTED]> wrote: > > I've had a hunt through the mail archives but can't find a definite > answer: > > Is Apache 2.0.x and PHP 4.2.x/4.3.x on Linux a viable proposition yet > in a production environment? > > I guess the diversity of experiences described in the archives > probably means no, but what is the current opinion? Some of the > archive messages I read are quite old now. > > > > Michael Hall [EMAIL PROTECTED] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 4.3.x..
You could have found the answer to this question right on the front page of php.net. 4.3.x is indeed the current development version. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Mon, 15 Jul 2002 14:00:26 -0230 "Kondwani Spike Mkandawire" <[EMAIL PROTECTED]> wrote: > One of the threads above Speak of PHP 4.3 I was not > aware that it existed... Is it still in its Testing stages? > How come its not on the PHP Website? Are there any > great modifications to it? > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Password in script
It's fine. There's no other way to do it really. Somebody would have to be able to see the source to the php file before they could see the password for mysql. They won't get it just by viewing the webpage that's already been parsed by php. -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Fri, 19 Jul 2002 10:03:02 +0700 "Sailom" <[EMAIL PROTECTED]> wrote: > I am new to PHP and MySQL and never have experience in this area. I > am writing a PHP script that connects to MySQL server. I have to put > a password of MySQL into the PHP script. I think it may not be > secured. What do you think? How can I make it more secure? Thanks. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Password in script
Yes, good point Anas. Make sure that you have mysql set up right. Make sure the root mysql user has a password set and that people can't connect from "%". tyler On Thu, 18 Jul 2002 20:19:05 -0700 (PDT) Anas Mughal <[EMAIL PROTECTED]> wrote: > > Also, allow MySQL connections only from your server. > > Tyler Longren <[EMAIL PROTECTED]> wrote: It's fine. There's no > other way to do it really. Somebody would have > to be able to see the source to the php file before they could see the > password for mysql. They won't get it just by viewing the webpage > that's already been parsed by php. > > -- > Tyler Longren > Captain Jack Communications > [EMAIL PROTECTED] > www.captainjack.com > > > > On Fri, 19 Jul 2002 10:03:02 +0700 > "Sailom" wrote: > > > I am new to PHP and MySQL and never have experience in this area. I > > am writing a PHP script that connects to MySQL server. I have to put > > a password of MySQL into the PHP script. I think it may not be > > secured. What do you think? How can I make it more secure? Thanks. > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > - > Do You Yahoo!? > Yahoo! Autos - Get free new car price quotes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php 4.2.1 and MySQL
No extra parameters have been added to the mysql_connect() function. The error you're seeing is straight from mysql...so it's really not php. Mysql says "Using password: YES" because you're trying to login in with a password. If you took out "password" in the mysql_connect() function, it'd say "Using password: NO". Go into mysql and make sure the username/password haven't been changed and make sure the machine that php is on is allowed to connect to the mysql server. Good luck, -- Tyler Longren Captain Jack Communications [EMAIL PROTECTED] www.captainjack.com On Mon, 22 Jul 2002 08:32:35 -0700 "Brian McLaughlin" <[EMAIL PROTECTED]> wrote: > We recently upgraded to php 4.2.1 with Apache and our scripts that > access MySQL now fail in mysql_connect().Apache shows the > following: > > Warning: Access denied for user: '[EMAIL PROTECTED]' (Using > password: YES) in /var/apache/share/scripts/ais/itweb/projects.php on > line 40 > > Warning: MySQL Connection Failed: Access denied for user: > '[EMAIL PROTECTED]' (Using password: YES) in > /var/apache/share/scripts/ais/itweb/projects.php on line 40 > Sorry... Could not connect to database > > Not sure why it says it's using password: YES. The call is > mysql_connect("host", "fred", "password") as it always has been. I > thought that perhaps the function call has changed to include an extra > parameter or something, but haven't found anything that says that's > true. > > Can someone tell me what I can do to get these scripts working again? > All of my scripts that use MySQL are failing in this same way. > > Thanks, > > Brian McLaughlin > [EMAIL PROTECTED] > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and 4.2.1
I actually enjoy all the security releases. They give me something to do at work! tyler On Mon, 22 Jul 2002 11:55:31 -0500 (CDT) Greg Donald <[EMAIL PROTECTED]> wrote: > On Mon, 22 Jul 2002, Marko Karppinen wrote: > > > PHP Security Advisory: Vulnerability in PHP versions 4.2.0 and > > 4.2.1 > > Not only did I get to re-write all my apps the past few months because > of the new register_globals default that was imposed by `the php > group`... > > Now I get to upgrade my PHP install once a month or so cause of new > security holes.. Yay! > > Wasn't this new register_globals setting supposed to enhance security? > > How would you like to be a sys admin with dozens of machines to > upgrade before you can proceed with anythign else? > > Can anyone say Ruby? > > > -- > Greg Donald > http://destiney.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse error in mysql_query()
Error: Parse error: parse error, expecting `']'' in /usr/local/apache/htdocs/UP/index.php on line 871 Line 871: mysql_query("INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_POST[domainregister_years$i]','$_POST[domainregister_price$i]')"); Anyone know why that parse error is happening? I can't find a missing "]" anywhere. Any help would be greatly appreciated. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Sorry, should have mentioned that I tried quoting them already. That gives a T_VARIABLES parse error. Thanks for the reply, Tyler On Mon, 2003-12-22 at 12:30, Sam Masiello wrote: > Perhaps it doesn't like the fact that you don't have quotes around your > array keys? > > --Sam > > > Tyler Longren wrote: > > Error: > > Parse error: parse error, expecting `']'' in > > /usr/local/apache/htdocs/UP/index.php on line 871 > > > > Line 871: > > mysql_query("INSERT INTO domainregistrations > > (domain,type,years,price) VALUES > > > ('$_POST[domainregister_domain$i]','$_POST[domainregister_type$i]','$_PO > ST[domainregister_years$i]','$_POST[domainregister_price$i]')"); > > > > Anyone know why that parse error is happening? I can't find a > > missing "]" anywhere. > > > > Any help would be greatly appreciated. > > > > Thanks, > > Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error in mysql_query()
Hi Matt, I put this right above like 871: print "$_POST[domainregister_domain$i]"; So now that "print" line is 871. It produces the exact same error as the mysql_query() line. The reason I'm doin it like this is cuz I'm dynamically generating forms, and lots of the fields are the same, just with different numbers at the end: ex: domainregister_domain1 domainregister_domain2 Those field names are generated by PHP for the form, and now I'm doing the page to process that form. Would doing $_POST['domainregister_domain'][$i] get the correct value from my "domainregister_domain1" field if $i=1? Thanks, Tyler Thanks, Tyler On Mon, 2003-12-22 at 12:47, Matt Matijevich wrote: > [snip] > Sorry, should have mentioned that I tried quoting them already. That > gives a T_VARIABLES parse error. > > Thanks for the reply, > Tyler > [/snip] > > What happens if you comment out the mysql statement and just echo the > variables? > > echo $_POST[domainregister_domain$i] > $_POST[domainregister_type$i]; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error in mysql_query()
Doing this fixed it: mysql_query("INSERT INTO domainregistrations (domain,type,years,price) VALUES ('$_POST[domainregister_domain]$i','$_POST[domainregister_type]$i','$_POST[domainregister_years]$i','$_POST[domainregister_price]$i')"); I just moved the $i to the outside of the [] and it works now. Thanks for everyone's input..helped me open my eyes a bit. Tyler On Mon, 2003-12-22 at 12:51, John W. Holmes wrote: > Tyler Longren wrote: > > Error: > > Parse error: parse error, expecting `']'' in > > /usr/local/apache/htdocs/UP/index.php on line 871 > > > > ('$_POST[domainregister_domain$i]', > > If you're going to be creating array keys like that, break out of the > string to do it. > > ('" . $_POST['domainregister_domain' . $i] . "', ... > > Having a key like that kind of begs the question of why you're not just > using $_POST['domainregister_domain'][$i], though... > > -- > ---John Holmes... > > Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ > > php|architect: The Magazine for PHP Professionals – www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Getting results from Select Multiple HTML tag
Hi, http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple I read that. Doesn't work in php since the whole register_globals thing. Now, when I get the results from a form, they're all in a $_POST[] array. Example. When I have a I would have to access the values of the "test" field like this: count($_POST['test']); But since I have to have the [] in the name="" ()part, I get parse errors when trying to read it: ex: count($_POST['test[]']); That doesn't even look right. Anyone understand what I'm tryin to get at? Any help would be great. Best Regards, -- Tyler Longren J.D. Web Services, L.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting results from Select Multiple HTML tag
Oh yea, I also searched the archives at http://marc.theaimsgroup.com/?l=php-general There were quite a few releated postings, but no answers! Mostly it was dick heads telling people that need help to RTFM. So, if you don't have any real help for me, then disregard my question. Telling me to RTFM won't help cuz I've red that section. Don't tell me to STFA (search the fuckin archives???), cuz I've done that also. Thanks for your understanding! tyler On Mon, 2004-01-05 at 22:05, Tyler Longren wrote: > Hi, > > http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple > > I read that. Doesn't work in php since the whole register_globals > thing. Now, when I get the results from a form, they're all in a > $_POST[] array. Example. > > When I have a > I would have to access the values of the "test" field like this: > count($_POST['test']); > > But since I have to have the [] in the name=" MULTIPLE>" ()part, I get parse errors when trying to read it: > ex: count($_POST['test[]']); > > That doesn't even look right. Anyone understand what I'm tryin to get > at? Any help would be great. > > Best Regards, > -- > Tyler Longren > J.D. Web Services, L.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Getting results from Select Multiple HTML tag
Hi Tom, $_POST['test'][] doesn't work. I thought I had tried $test = $_POST['test'] before and it didn't work. I just tried it though and it seemed to work. Thanks Tom! Tyler On Mon, 2004-01-05 at 22:20, Tom Rogers wrote: > Hi, > > Tuesday, January 6, 2004, 2:05:47 PM, you wrote: > TL> Hi, > > TL> http://www.php.net/manual/en/faq.html.php#faq.html.select-multiple > > TL> I read that. Doesn't work in php since the whole register_globals > TL> thing. Now, when I get the results from a form, they're all in a > TL> $_POST[] array. Example. > > TL> When I have a > TL> I would have to access the values of the "test" field like this: > TL> count($_POST['test']); > > TL> But since I have to have the [] in the name=" MULTIPLE>>" ()part, I get parse errors when trying to read it: > TL> ex: count($_POST['test[]']); > > TL> That doesn't even look right. Anyone understand what I'm tryin to get > TL> at? Any help would be great. > > TL> Best Regards, > TL> -- > TL> Tyler Longren > TL> J.D. Web Services, L.C. > > > try $_POST['test'][] > or copy it to another array > > $test = $_POST['test']; > > print_r($test); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_affected_rows() function
Hi, I don't think mysql_affected_rows() is working like it should for me. In the manual for mysql_affected_rows() it has this (Example 1): /* this should return the correct numbers of deleted records */ mysql_query("DELETE FROM mytable WHERE id < 10"); printf("Records deleted: %d\n", mysql_affected_rows()); However, when I do this: $delete_assignment = mysql_query("DELETE FROM consultingprojectassign WHERE workerid='$assigned[$i]'"); printf("Records deleted: %d\n", mysql_affected_rows()); It always says "Records deleted: 0". Even though the record was, indeed, deleted. I have an if statement also that says if mysql_affected_rows() < "1", then print an error message. Well, since it always returns 0, no matter what, the error is always shown, even when the record is deleted. As I understand it, if no WHERE clause is in the query, then it will automatically return a 0. As you can see, my query above does have a WHERE clause. Can anyone help me out? Thanks!!! Best Regards, -- Tyler Longren J.D. Web Services, L.C. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] counting charactors
Hi Philip, strlen() will work. http://www.php.net/manual/en/function.strlen.php Best Regards, -- Tyler Longren J.D. Web Services, L.C. On Wed, 2004-01-07 at 01:25, Philip J. Newman wrote: > can someone point me to the right place for a thing that would count charactors in a > string? > > --- > Philip J. Newman > Master Developer > PhilipNZ.com [NZ] Ltd. > [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_affected_rows() function
Hi Cpt, That's not the exact code. The exact code is below. Multiple workers are being selected from a MULTIPLE form field. I just use a while loop do go through the selected ones to delete them individually. PHP Version: 4.3.4 MySQL Version: 4.0.17 $i="0"; while ($i <= "$selected") { $delete_assignment = mysql_query("DELETE FROM webprojectassign WHERE workerid='$assigned[$i]'"); $i++; } if (mysql_affected_rows($delete_assignment) < "1") { $tpl->newBlock('message'); $tpl->assign("message","ERROR: There was an error deleting those workers from the project."); } else { $tpl->newBlock('message'); $tpl->assign("message","The workers have been deleted from the project."); } If you (or anyone else) know of another way I should be doing this, please let me know. I'm open to any suggestions. Best Regards, -- Tyler Longren J.D. Web Services, L.C. On Tue, 2004-01-06 at 15:14, CPT John W. Holmes wrote: > From: "Tyler Longren" <[EMAIL PROTECTED]> > > > I don't think mysql_affected_rows() is working like it should for me. > > In the manual for mysql_affected_rows() it has this (Example 1): > > > > /* this should return the correct numbers of deleted records */ > >mysql_query("DELETE FROM mytable WHERE id < 10"); > >printf("Records deleted: %d\n", mysql_affected_rows()); > > > > However, when I do this: > > $delete_assignment = mysql_query("DELETE FROM consultingprojectassign > > WHERE workerid='$assigned[$i]'"); > > printf("Records deleted: %d\n", mysql_affected_rows()); > > > > It always says "Records deleted: 0". Even though the record was, > > indeed, deleted. I have an if statement also that says if > > mysql_affected_rows() < "1", then print an error message. Well, since > > it always returns 0, no matter what, the error is always shown, even > > when the record is deleted. > > I can't see a reason why that wouldn't work. Is that your exact code, i.e. > you're not doing anything else between the mysql_query() call and the > mysql_affected_rows() call? What versions of PHP/MySQL are you using? > > ---John Holmes... > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Web hosting for PHP/MySQl development
I suggest www.csoft.net They've got great servers. They provide inexpensive PHP/MySQL web hosting. I think you get as many databases as you desire. They also have telnet, ssh, and probably emacs. They probably have everything else you listed too. You have the option of having an OpenBSD server. Good stuff. Tyler Longren -Original Message- From: Chris Lott [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 18, 2001 7:37 PM To: PHP General Subject: [PHP] Web hosting for PHP/MySQl development Any recommendations for a good, savvy host for doing some PHP/MySQL development? Not looking for a free service, obviously, but somebody with: knowledgeable tech support, good mysql/php 4/zend support, decent mail handling, and developers tools like: telnet/ssh, emacs, procmail, crontab access, etc. Where are you php developers doing your hosting? I have been scouring this list archives, but everyone is focussed on free or extremely cheap. I also know about the PHP hosts listing, but the problem with that is you never know if the positive comments are real or not, and only people experienced with a host can tell you if they are any good or not! via private mail is fine, if you want to share that good thing with one person instead of the list... c -- Chris Lott -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] getting what's between
Hello, I've been reading a LOT on how to solve my problem today, but haven't been able to come up with anything yet. Here's my problem: I have an html file that contains many table rows like this: Item1Item1 Again Item2Item2 Again Item3Item3 Again Item4Item4 Again And so on. I want to search this html for a table row that has 'Item3' in the first cell. And the second cell should contain 'Item3 Again'. I know that I can do this with something like this: $file = fopen("http://localhost/html.html", "r"); $data = fread($file, 1); $results = eregi("Item3Item3 Again", $data); However, this won't exactly work for me, because that contents of the second cell will change daily, so tomorrow, the third table row could look like this: Item3Item3 Has Changed I was thinking I could use sscanf() to do this, but couldn't get anything to work. I've tried everything I can think of. Sorry if the explanation of my problem was hard to understand, I don't exactly understand it myself. Thanks everybody!!! Regards, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Next month
Hello, How do I get the number of the next month (Ex: 4). And when the current month reaches 12, the next month would be 1 and the next year would be 2002. Anybody know how I can accomplish this? Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] mysql_fetch_array()
"; while ($row=mysql_fetch_array($sql_result)) { print ""; foreach ($row as $field) print "$field"; print ""; print "Get it"; print ""; print ""; } print ""; ?> Try that, you tried to call $mysql_query, when you needed to call mysql_query. In your code, $mysql_query isn't a variable, it's a function in PHP. -Original Message- From: Deependra B. Tandukar [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 07, 2001 9:34 PM To: [EMAIL PROTECTED] Subject: [PHP] mysql_fetch_array() Greetings! I am using PHP and MySQL in RedHat 6.0. I have used mysql_fetch_array() to display the datas in web page but all the columns are printed twice. What can be the wrong with my code: "; while ($row=mysql_fetch_array($sql_result)) { print ""; foreach ($row as $field) print "$field"; print ""; print "Get it"; print ""; print ""; } print ""; ?> But it works fine with mysql_fetch_row() however it does not pass the pass the variable ID. Looking forward to hearing from you. Warm regards, DT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Weird problem with Win2k
Hello everybody, I haven't made any changes to my system lately. This box is running Win2k w/ SP1. Whenever I try to run php.exe, I get the following error: Application popup: php.exe - Entry Point Not Found: The procedure entry point ??_U@YAPAXI@Z could not be located in the dynamic link library MSVCRT.dll. Does anybody have any idea why this occurs? This also happens when I try to run Paint Shop Pro. So it's not PHP itself. When PHP is started on boot, the error is logged to the event log. Anybody seen anything like this before? Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] accepting credit cards
Hello everyone, I know this has been discussed many times before. I even read the past threads in the list archives. I've written a shopping cart/catalog that uses mysql on the backend. I need to be able to accept cc orders. Is Paypal a good choice? I've never really use any service like this before. When the user orders an item, will they have to leave my website? Thanks, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] What's wrong with this code?
$file = fopen("includes/about.inc", "r"); $data = fread($file, 2400); $stripped = stripslashes($data); $formatted_data = nl2br($stripped); echo "$formatted_data"; Any ideas why that doesn't work on one server but it will work on another server? The server it works on is Win2k, IIS5, php4.0.4pl1. The server it doesn't work on is Linux, Apache, php4.0.4pl1. Any ideas why this won't work? Just to be sure, I did a chmod 777 about.inc, so file permissions isn't it. Thanks everyone, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] redirection to another page function
header ("Location: http://www.location.com/home.html"); > -Original Message- > From: Carlos Fernando Scheidecker Antunes [mailto:[EMAIL PROTECTED]] > Sent: Sunday, April 22, 2001 8:19 PM > To: PHP-GENERAL > Subject: [PHP] redirection to another page function > Importance: High > > > Hello all! > > Is there any PHP native function to redirect to another page or URL? > > I would like that once the user clicks on home.php4 and a few > verifications are done, he/she would be redirected to home.html. > > Thanks, > > C.F. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] if... then... else with HTML
1st HTML here 2nd HTML here > -Original Message- > From: Martin Thoma [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 7:41 AM > To: [EMAIL PROTECTED] > Subject: [PHP] if... then... else with HTML > > > Hello ! > > I want to do something like > > if (condition) > output this html-block > else > output that html-block > > > Without printig or echoing the html-block out (because the block has a > lot of ", which I all would have to slash out...) > > How can I do that ? > > Martin > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Now, why doesn't this work?
Hello everybody, My host seems to be having some weird problems. Here's a piece of code: if (($this_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$thismonth' ORDER BY timestamp ASC")) && ($next_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$nextmonth' ORDER BY timestamp ASC"))) { do this(); } else { print ("MySQL query DIDN'T RETURN DATAError No.:".mysql_errno(). "MySQL Error:". mysql_error(). ""); } Now, this is the error that I get from this: MySQL query DIDN'T RETURN DATA Error No.:1064 MySQL Error:You have an error in your SQL syntax near 'WHERE month = '4' ORDER BY timestamp ASC' at line 1 Why I get this, I don't know. The code hasn't changed in a few days, and it just started doing that today. This also works on my home Win2k box, and Slackware box. The versions of PHP, MySQL, and apache are the same on my host and on my Linux box. The version of php and mysql are the same on ALL of the machines (host, Win2k, Slackware). Any ideas? Thanks everyone, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Now, why doesn't this work (update)?
Also, I ran this SQL on the regular mysql client, and it returned the correct data...for some reason if I run it in PHP, I get the SQL syntax error. Tyler > -Original Message- > From: Tyler Longren [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 9:20 PM > To: PHP-General > Subject: [PHP] Now, why doesn't this work? > > > Hello everybody, > > My host seems to be having some weird problems. > Here's a piece of code: > > if (($this_month_sql = mysql_query("SELECT * FROM $mysql_shows_table WHERE > month = '$thismonth' ORDER BY timestamp ASC")) && ($next_month_sql = > mysql_query("SELECT * FROM $mysql_shows_table WHERE month = '$nextmonth' > ORDER BY timestamp ASC"))) { > do this(); > } > else { > print ("MySQL query DIDN'T RETURN > DATAError No.:". mysql_errno(). "MySQL Error:". > mysql_error(). > ""); > } > > Now, this is the error that I get from this: > MySQL query DIDN'T RETURN DATA > Error No.:1064 > MySQL Error:You have an error in your SQL syntax near 'WHERE month = '4' > ORDER BY timestamp ASC' at line 1 > > Why I get this, I don't know. The code hasn't changed in a few > days, and it > just started doing that today. This also works on my home Win2k box, and > Slackware box. The versions of PHP, MySQL, and apache are the same on my > host and on my Linux box. The version of php and mysql are the > same on ALL > of the machines (host, Win2k, Slackware). > > Any ideas? > > Thanks everyone, > Tyler > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Now, why doesn't this work? (this thread can die off now)
Yup...it was the table. I have 2 sets of variables on my config.inc file. One is for my local servers, the others are for remote servers (the host). I didn't have $mysql_shows_table defined in the remote servers section. Sorry about that everyone. This thread can die now. Tyler > -Original Message- > From: Jason Murray [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 23, 2001 9:27 PM > To: 'Tyler Longren' > Subject: RE: [PHP] Now, why doesn't this work? > > > > :) > > read the updated message..forgot to say that I've done that > > already in the orig message. > > You said you'd executed it yourself - you didn't say that you'd > executed the SQL that PHP is sending to MySQL. Get it to output > that SQL, copy it from the web browser and execute it. > > I suspect the $mysql_shows_table or whatever it's called is not > being set. > > Jason > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] upload/download of files (This is LONG)
Hello everyone, Here's my problem: I need to be able to upload some info about an mp3 to a database (name, filename, size, and file_type). I can do this already, and it works just fine. After the info is added to the database, the mp3 is uploaded to music/$binFile_name. Here's the code I have to put info into the db and upload the file to the music directory: $data = addslashes(fread(fopen($binFile, "r"), filesize($binFile))); $strDescription = addslashes(nl2br($txtDescription)); $album_sql = mysql_query("SELECT * FROM albums WHERE id = '$album_id' AND artist_id = '$artist_id'"); $album = mysql_fetch_object($album_sql); $sql = "INSERT INTO music (artist_id, artist, album_id, album_title, track_name, track_number, mp3_type, description, filename, filesize, filetype) VALUES ('$artist_id', '$artist', '$album_id', '$album->album_title', '$track_name', '$track_number', '$mp3_type', '$strDescription', '$binFile_name', '$binFile_size', '$binFile_type')"; $result = mysql_query($sql, $db); mysql_free_result($result); $len = strlen($data); if ($fp = fopen("../../music/$binFile_name", "wb")) { if ($size = fwrite($fp, $data, $len)) { print "Thanks, $binFile_name has been added to our database."; fclose ($fp); } else { print "$binFile_name couldn't be written to, perhaps some permissions are wrong?"; } } else { print "$binFile_name couldn't be opened (or created), please try again."; } One problem begins when trying to play that MP3. When I try to play the MP3, it NEVER plays. Is there some headers that need to be sent while uploading the file? Here's the code I use to let users download the mp3: while ($row = mysql_fetch_array($sql)) { $artist = $row["artist"]; $artist_id = $row["artist_id"]; $id = $row["id"]; $track_name = $row["track_name"]; $type = $row["mp3_type"]; $filename = $row["filename"]; if ($alternate == "1") { $color = "#ff"; $alternate = "2"; } else { $color = "$color1"; $alternate = "1"; } print "$artist$track_name$type"; } So the final dl link ends up being: Track Name I can download this in IE, but it still won't play, and when I do a "Save Target As" the file name is all screwed up. If the link was this: http://localhost/sweetleaf/music/Provoke - Quick Blast.mp3>Quick Blast you'd think the filename I'd download would be "Provoke - Quick Blast.mp3". When doing a Save Link As, this is the filename: ProvokQuicBlast.mp3. Any ideas why? Also, when downloading in NS, I get this: The parameter is incorrect. Any idea what that means? thanks for sitting through all of this. I hope you can offer me some help. :) Regards, Tyler Longren P.S. If you'd like more of my code to look @, just let me know. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] URL redirection
if ($varTwo == $varOne) { header('Location: http://www.location.com/page.html'); } else { echo "You stay right where you are!"; } Tyler > -Original Message- > From: Jamie Saunders [mailto:[EMAIL PROTECTED]] > Sent: Sunday, May 06, 2001 5:21 PM > To: [EMAIL PROTECTED] > Subject: [PHP] URL redirection > > > > Hi, > > Is there a PHP function that will redirect the current page to > another url? > > e.g. > > if ($varTwo == $varOne) { > > URL redirection code > > } else { > > echo "You stay right where you are!"; > } > > Thanks. > > > Jamie Saunders > Mail: [EMAIL PROTECTED] > Web: http://jamie-s.co.uk > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] problem with my sessions
In rightcolumn.inc, I have a form to let users log in to the site. In config.inc I have session code, and site wide variables (such as $mysql_host, and $mysql_user). Here's the relavent part of rightcolumn.inc: print " Login Username: Password: "; if (($login_error) && ($login == "yes")) { print "$login_error"; } print ""; if (!($HTTP_SESSION_VARS["username"])) { print " "; } else { print "Logout"; } print ""; This for is submitted to $PHP_SELF. config.inc is included on EVERY page on the site. Here's the relavent part of config.inc: mysql_connect("$mysql_host","$mysql_user","$mysql_pass"); mysql_select_db("$mysql_db"); $sql = mysql_query("SELECT * FROM $mysql_user_table WHERE username = '$username' AND password = '$password'"); $num = mysql_num_rows($sql); if ($num < "1") { $login_error = "Wrong username/password"; } else { session_start(); session_register('username'); session_register('password'); print "Level 5"; print "$username"; } Now, when I log in, $HTTP_SESSION_VARS["username"] and $HTTP_SESSION_VARS["password"] are NOT accessable on $PHP_SELF, but they are after I refresh $PHP_SELF...But then when I move to another page on the site (with config.inc included @ the very top, before anything is sent to the browser), the $HTTP_SESSION_VARS["username"] ($username) and $HTTP_SESSION_VARS["password"] ($password) are lost. Can anybody offer me any help? I've been trying to get this to work for 48 hours now. I've re written this thing sooo many times. I almost had it once, but changed something and it stopped. Thanks, Tyler Longren -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Strange
if ($userid && $password) { $res = pg_exec($db, "SELECT userid FROM users WHERE userid='$userid' AND password='$password'"); $x = pg_numrows($res); if ($x==1) { $verified_user = $userid; session_register ("$verified_user"); Header ("Location: main.php"); } } else { Header ("Location: login.php") } need the header() that sends you back to login.php in the else loop? Tyler > -Original Message- > From: paket [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, May 09, 2001 12:33 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Strange > > > Hello. > > This is a script fragment that I am working on. It's purpose is to > validate a user by checking a database to see if the userid and password > match what has been supplied. Here it is: > > if ($userid && $password) > { > $res = pg_exec($db, "SELECT userid FROM users WHERE > userid='$userid' AND password='$password'"); > $x = pg_numrows($res); > if ($x==1) > { > $verified_user = $userid; > session_register ("$verified_user"); > Header ("Location: main.php"); > } > } > Header ("Location: login.php") > > Here is what is supposed to happen - if both $userid and $password exist, > we try to pull a record from the database ( database connection is not > shown). If the number of rows returned in 1, all is good and we register > the userid and head off the the main page. If not, we go back to the login > page. > > The problem is that the user is ALWAYS re-directed back to the login page > (login.php) even when the userid and password are correct. BUT if I make > these changes, it works: > > Header ("Location: main.php"); echo $userid; <--- new line > > Now, by my reasoning, the new line should't ever be executed, and if it > were, it should kick out an error. So, what is going on here? > > thanks > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Can't connect to mysql after applying MS Hotfix
Hello everybody, Lastnight, I was building a site. Multiple SQL queries were being made on every page. Everything worked nice and smooth. I downloaded and applied the patch for MS01-026 which effects IIS 4.0 and 5.0. I rebooted after applying the hotfix, and after that, NONE of my php scripts can connect to mysql. It's not a problem with mysql, because I can successfully connect to mysql through the client and can execute queries. Anybody know what's up with this? Also, while playing around lastnight...I wrote some weird code that kills inetinfo.exe on Win2k boxes. It's attached if anyone wants to look @ it (please do and see if you get the same results). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Uptime script?
exec(uptime); or system(uptime); Tyler > -Original Message- > From: Ryan Christensen [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 11:43 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Uptime script? > > > I know I've seen one before, and before I go write my own version, does > anyone know of a PHP script that echoes the uptime of a server (Linux) in > days,hour,minutes, etc? > > Thanks! > > > Ryan Christensen > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] no connection to mysql
Hello everyone, PHP just stopped being able to connect to mysql. mysqld-nt is running, and is running alright becuase I can connect, select databases, and execute sql queries through the mysql client. However, when I try to establish a connection through PHP, the connection never gets made. This just started happening 2 days ago. This also happens on one of my machines at school. Here's the code I'm using to test (which has worked fine before): No data could be retrieved."; } else { while ($row = mysql_fetch_array($sql)) { $id = $row["id"]; print "$id"; } } } else { print ("SQL NOT executed.Error No.:" . mysql_errno() . "Error: " . mysql_error() . ""); } } else { print ("Database NOT selected.Error No.:" . mysql_errno() . "Error: " . mysql_error() . ""); } } else { print ("Connection NOT established.Error No.:" . mysql_errno() . "Error: " . mysql_error() . ""); } ?> Has anybody else experienced any problems like this? I think this started happening after I accidentally wrote some bad code that killed inetinfo.exe (IIS). PHP hasn't been able to connect to MySQL since then. Thanks everyone, Tyler -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] mysql error, dont see why.. please help
Shouldn't it be: mysql_query("UPDATE user_polls SET url = '$file_name' WHERE uid = '$UserName' AND type = '$type") or die (mysql_error()); Maybe I'm wrong. -- Tyler Longren [EMAIL PROTECTED] Currently Unemployed www.noworkfortyler.com On Tue, 22 May 2001 17:00:35 EDT [EMAIL PROTECTED] wrote: > Here is the command. > > mysql_query("UPDATE user_polls WHERE uid = '$UserName' AND type = '$type' SET > url = '$file_name'") or die(mysql_error()); > > Output > You have an error in your SQL syntax near 'WHERE uid = 'Oblivion' AND type = > 'music' SET url = 'test'' at line 1 > > This is SOOO weird. > PLEASE HELP > > - Peter > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Date (Year) .. adding..
Try that. Tyler > -Original Message- > From: Jason Caldwell [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 22, 2001 11:20 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Date (Year) .. adding.. > > > I'm trying to figure out how to add to the year: > > for($x=0; $x<20; $x++) > { > $year = date("Y" + $x); > print($year . "\n"); > } > > I've tried several variations on the above and cannot get the year to come > out. > > Any suggestions? > > Thanks > Jason > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]