[PHP] User/Group rights system?
Hello, Does anyone know of an open source "user/group" based permission system built with php/MySQL? That is, the effective rights for any user on a specific secured object are computed from various permit/deny permissions assigned to the user or any of the groups he/she belongs to. PEAR::Auth seems only to support basic user authentication. Thanks, David __ Do you Yahoo!? Yahoo! Movies - Buy advance tickets for 'Shrek 2' http://movies.yahoo.com/showtimes/movie?mid=1808405861 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Clean Open Source PHP extranet app?
Hello, I am looking to create a simple "extranet" type application similar to http://www.basecamphq.com/ written by 37signals. Basically I just need a way for users to share files/projects/messages. In fact, I would just go ahead and pay for Basecamp except that it's closed source and it's only available as a hosted service. (??!?) Is there a similar open source application written in PHP/MySQL? Googling for such a project just returned a bunch of PHPnuke/Portal type applications. Not at all what I need. Any ideas? Thanks, David __ Do you Yahoo!? Win a $20,000 Career Makeover at Yahoo! HotJobs http://hotjobs.sweepstakes.yahoo.com/careermakeover -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passthru() problem
I'm trying to get the output of a shell command with PHP This is the command I'm Trying to execute, I also tried using system instead of passthru Both cases "passthru" and "system" Outputed "2" but should have outputted something like this: standalone FTP daemon [17899]: 21852 geiri[ 4h45m] (n/a) STOR /UPLOAD_HERE/moviemusic/The Soprano's - Music from the HBO Original Series KB/s: 143.87 client: client.client.de [12.2.2.3] server: 62.145.135.125:2121 (shiiit.serbinn.com) location: /MP3/ Music/ Any Idea about what could be wrong
[PHP] POSIX seteuid and similar
Hi, I am trying to create a small php program where I can control users processes. As far as I see I require Apache to run as root in order to do this (Note: I wish to access it via a webpage run through a browser). At the moment all pages are executed as user 'apache' (UID #48 in this case). Other than giving apache root access which i hear is a very bad thing to do, what other ways can i use the posix_seteuid() functions and the like. Any help at all will be really appreciated. Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [Newbie Guide] For the benefits of new members
I believe in community and helping people out, if someone is struggling then I try to help. When you have been developing for several years it is much easier to produce code as you have the experience and also the tools. Someone who is just starting to learn a language it is hard to understand what to do, and probably scared of trying new things. To have someone provide a bit of code to help, gives someone confidence to move on. I also have to product code quickly and sometimes I do not know where to start, manuals are a start, but usually they do not give the code to do specific things. My process is: - Look in a manual Search the web PHP websites and newgroups Then post on a newsgroup My thought is someone out there has had a simular problem, and solved it, then hopefully they will share the solution. David Anagram Systems http://www.anagram-sys.co.uk/ http://www.web-planets.com/davec/techsitedb/ "Mike Brum" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] While sometimes a new perspective is extremely useful on a topic, I think the problem is that a huge percentage of people don't try for themselves. If they've done all the steps in the proposed message, then it tells you to send a message explaining where you're at to the list. While it can be pretentious to send someone to the manual if they say "I read the manual, I can't figure it out", if they haven't even tried doing it for themselves yet, then it's a very viable first recommendation. Not to mention that there's MANY different points of views on many different topics in the list archives that very few people seem to search. Someone should always try to help themselves first before they start asking other people to do the work for them. It's just laziness to not even try before asking. My suggestion would be to have that message sent to a person just after signing up once, instead of to everyone on a regular basis though. my $.02 -M -Original Message- From: Van Andel, Robbert [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 1:08 PM To: PHP Mailing List Subject: RE: [PHP] [Newbie Guide] For the benefits of new members Personally, I think one of the worst replies someone on the list can do when someone new asks a question is send only a link to the manual. It's presumption that everyone will understand the way the manual is worded. There have been times when it's confused me and I needed another perspective on the topic. If you find the question juvenile or unworthy of anything more than a link to the manual, don't reply to it. Robbert van Andel -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 5:44 AM To: PHP Mailing List Subject: [PHP] [Newbie Guide] For the benefits of new members I have been following this list for the past 1 year. I find it very useful. Just by following the discussions for a couple of months one can understand a great deal about PHP. What I proposed to do is to send this mail to the list every week. Those who do not want to be bothered just filter out the [Newbie Guide] mails. Please feel free to add more points and send to the list. 1. If you have any queries/problems about PHP try http://www.php.net/manual first. You can download a copy and use it offline also. 2. If you can not get answer here try http://www.google.com next. Try searching for "php YOUR QUERY" and you may be lucky to get an answer within the first 10 results. 3. Glancing through the list archive at http://www.php.net/archives, should answer almost all common problems. 4. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable, sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1,2 & 3) and ask for help in the list. 5. Provide a clear descriptive subject line. Avoid general subjects like "Help!!", "A Question" etc. 6. When you want to start a new topic, open a new mail and enter the mailing list address [EMAIL PROTECTED] instead of replyting to an existing thread and replacing the subject and body with your message. Hope you have a good time programming with PHP. Best regards, -- Ma Siva Kumar, INTEGRATED MANAGEMENT TOOLS FOR LEATHER INDUSTRY BSG LeatherLink, Chennai. Ph: +91 44 55191757 URL : http://www.leatherlink.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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] strtotime no longer accepting many dates?
I recently upgraded my system, and all of a sudden strtotime won't handle a date/time prior to the unix start microtime.. For example echo strtotime("1965-01-01"); returns a -1 (e.i. invalid date/time format). According to the PHP4 docs: Note: The valid range of a timestamp is typically from Fri, 13 Dec 1901 20:45:54 GMT to Tue, 19 Jan 2038 03:14:07 GMT. (These are the dates that correspond to the minimum and maximum values for a 32-bit signed integer.) But dates between 1901 and 1969ish don't work anymore... Is there another date function to convert a date to a negitive unix timestamp??? Please help. Thanks David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: manual/eng
[EMAIL PROTECTED] wrote: Hi all, I tried to download the manual of php wget http://www.php.net/manual/en/ I got a lot of files but not linked to read off line the links where all to the website. http://www.php.net/manual/en/faq.php http://www.php.net/manual/en/zend.configuration-macros.php Can someone please help me with a site that I can download the manual of php in a format that I can read off line. http://www.php.net/download-docs.php regards Metta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: manual/eng
[EMAIL PROTECTED] wrote: Hi all, I tried to download the manual of php wget http://www.php.net/manual/en/ I got a lot of files but not linked to read off line the links where all to the website. http://www.php.net/manual/en/faq.php http://www.php.net/manual/en/zend.configuration-macros.php Can someone please help me with a site that I can download the manual of php in a format that I can read off line. http://www.php.net/download-docs.php regards Metta -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: manual/eng
David wrote: [snip] Sorry for being trigger happy there :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Explode and multple lines
Sweet T wrote: Hello, I am using php to explode the lines of a text file (delimited by a comma), break it into an array, and echo only one of the array elements. I have accomplished all of this, but it only echos the text for one line. How do I get php to scan multiple lines? I tried to introduce a line count, but I can't find any information on how I can create a loop. An example would be: Here is an example of how to loop through a array: $array = file('data.txt'); foreach($array as $value) { list($id, $name, $job, $dept) = preg_split('/,/', $value); echo $dept; } How is your array setup? For the below text file, I want to echo dept, 10, 20, 40 ,30 empid, name, job, dept 10,Wilma Tucker, Sales Engineer, 10 43,James Whitmore, Unix SA, 20 50,Tricia Williams, Systems Developer, 40 427, Barry Regar, Administrative Assistant, 30 Thanks! -T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mail function
If you are doing Windows, you set up SMTP in the php.ini to your mail server, mine is SMTP = 192.168.16.2, and I also set up sendmail_from = [EMAIL PROTECTED] -- Kind Regards David Anagram Systems http://www.anagram-sys.co.uk/ http://www.web-planets.com/davec/techsitedb/ "Deependra B. Tandukar" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dear all, > > Recently installed PHP in my Linux server. It says, mail function is not > enabled? How is turn this on? > > Regards, > _DT -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to trap eval error?
Hi, i am new to this list as well as to PHP. i am in a situatin where i want to eval a string like: eval('$return = $function($input);'); where $function is a string specify a function to call and $input is the input parameter for the function. $return is just whatever is returned by the $function. my problem is that if $function is NOT defined anywhere, i got a fatal error like: Fatal error: Call to undefined function: ... does anyone who how to trap this error if it can be trap at all? what i have done so far is something similar to: set_error_handler('myHandler'); eval('$return = $function($input);'); that doesn't seem to work at all as 'myHandler' is never called. i have alose tried to check $php_errormsg but that doesn't seem to be helpful as well. as a last resort, i tried: error_reporting(E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE); set_error_handler('myHandler'); eval('$return = $function($input);'); that does seem to make the error stop appearing but my handler is still not called. any idea? thanks! david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] how to trap eval error?
Jay Blanchard wrote: > [snip] > eval('$return = $function($input);'); > [/snip] > > The problem is the quotes...the string is not truly being eval'd. Change > to double quotes > > eval("$return = $function($input);"); thanks for the tip but i am sure you mean: eval("\$return = \$function(\$input);"); otherwise the variables gets expanded before they get to eval and i end up with a syntax error. i found a solution (hopefully) with: if(function_exists($function)){ eval('$return = $function($input);'); }else{ // function does not exists } which works quit nicely for now. not sure if that's a good thing to do. thanks! david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] how to trap eval error?
Cpt John W. Holmes wrote: > From: "david" <[EMAIL PROTECTED]> > > >> i found a solution (hopefully) with: >> >> if(function_exists($function)){ >> eval('$return = $function($input);'); >> }else{ >> // function does not exists >> } >> >> which works quit nicely for now. not sure if that's a good thing to do. > > Why not just do this: > > if(function_exists($function)) > { $return = $function($input); } > else > { //function does not exist; } > because i didn't know PHP can do that. thanks for the tip! any differences between the 2 version in turns of performance and safety? david -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsocketopen questions
Dear All, I write a php scripts to use the function of fsocketopen to gather some data on the web, everything is perfect when I test the scripts on the apache server installed in my pc. But when I upload the codes to the server I hosted, I always got a time out error, even after I enlarge the time out setting to 180 secs. Could you tell me why it happen and how to figure it out? Thanks, -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-CVS] cvs: php4 /ext/midgard config.m4
> > I don't think it belongs in PEAR at all. I could see the logic behind > > distributing it with PHP, but don't see any reason to distribute it in > > pear... > > > Except that isn't this what PEAR was for all along? A collection of classes > and add-on modules to extend PHP's functionality? > > I don't have anything against the Midguard folks personally, but isn't > distributing Midguard with the main PHP distribution implicitly saying PHP > supports/prefers the Midguard content management system over any other > similar system? What happens when someone else wants *their* system to be > part of the main PHP distribution? What criteria are we basing these > decisions on? > > There is also the license issue (which I know has been discussed before). > But the first thing I read on the Midguard website is: > > Midgard will always implement an OS development to publishing > solution, future releases will include APIs for implementing > commercial applications. > > Are we going to run into trouble down the road when this happens (and end up > having to take Midguard out of PHP anyway)? > > [There is also the fact that Midguard accepts donations and collects > membership fees ... how is that going to change if Midguard is part of the > main PHP distribution?] > > And as for Alexander's comment: > > Shouldn't that means that almost all extensions from ext/ > directory could be classified as PEAR thing? > > My opinion is that yes they *could* be classified that way, but it doesn't > make a lot of sense. PHP users don't have a choice of which module they > want to use for Blowfish encryption, for example ... so mcrypt is part of > the standard distribution. Perhaps the PDF modules should be, since we have > several. I don't know. > > But, to me at least, Midguard seems to be code that is a "layer above" what > I would feel belongs in the main PHP distribution. In the same way the DB > abstraction class is (even the C version of it) ... and that they both > belong in PEAR. Midgard is not exactly a layer above PHP, it's an extension to PHP, exactly like the session extension, or the gd extension. Here is my own point of view (far from objective, cause I'm from the Midgard team ;): Midgard is a CMS, like MySQL is a DBMS. MySQL has it's own module in php4/ext, as well as pgsql, oracle, etc... That gives users the choice of what DBMS they can use with PHP. I don't mind *at all* if Zope, or Websphere or whatever other CMS has its own module in php4/ext (in fact, that would give users more choice, thus that'd be better). My own 2 cents. > Just my 2 cents (and given without intent to offend). > > > -- > Colin Viebrock > Co-Founder, easyDNS Technologies Inc. > http://www.easyDNS.com/ > -- David -- PHP CVS 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-CVS] cvs: php4 /ext/midgard config.m4
missed the reply-all button... > > At 00:29 20/3/2001, [EMAIL PROTECTED] wrote: > > >Midgard is not exactly a layer above PHP, it's an extension to PHP, > > >exactly like the session extension, or the gd extension. > > > > > >Here is my own point of view (far from objective, cause I'm from the > > >Midgard team ;): > > >Midgard is a CMS, like MySQL is a DBMS. MySQL has it's own module in > > >php4/ext, as well as pgsql, oracle, etc... That gives users the choice of > > >what DBMS they can use with PHP. > > >I don't mind *at all* if Zope, or Websphere or whatever other CMS has its > > >own module in php4/ext (in fact, that would give users more choice, thus > > >that'd be better). > > > > Not quite :) The main difference is that, unlike most other extensions, > > this extension isn't a 'glue' layer that connects PHP to some external > > resource. In this case, we're including the resource itself. It's more > > similar to including the source code of MySQL or PostgreSQL inside PHP, not > > a module that connects to them... > > well, AFAIK Midgard is a glue between PHP, mysql and apache. Did you already try it >? Did you read the documentation on www.midgard-project.org ? > > > There were a few exceptions to the rule over the years (mostly in PHP 4.0) > > - PCRE, XML being the most notable ones, and the MySQL client library being > > another type of exception, made due to the huge popularity of the PHP/MySQL > > combination. > > > > There are a few open issues here, which should help us understand whether > > or not this module belongs inside PHP: > > > > - Is it mutually exclusive to other alternatives? The problem Colin raised > > does exist, there are quite a few content management applications for PHP > > out there, and it's a bit unfair to them to bundle a specific one inside PHP. > > I don't know any written as a PHP extension, only pure PHP code. > > > - The license issue - does the inclusion of midgard effect the overall > > license restrictions of PHP or not? > > I don't think so, we changed the license to be compatible with PHP. > > > - Is the midgard group willing and interested in playing by the php-dev > > rules? In particular, "Thou shalt never break the CVS build" is one of the > > 'higher laws' around here :) > > Yes, unfortunatly you can't tell a blind person not to bump into walls in an unknown >place ;) > More documentations on PHP m4 macros would help. > > > Zeev > > > > > > > -- > David -- David -- PHP CVS 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] Re: fsockopen nntp stalls
hmm, does it work with smaller newsgroups? such as php\'s one which have ~30 groups. when i wrote my own reader (using fsockopen also), i found that stalls are usually because of my own error(eg, article not found, etc) you can take a peek at jim winstead\'s code from http://lists.php.net/snapshot.tar.gz it\'s the code powering http://lists.php.net. i learnt a lot from reading his code! Good Luck! >For example: server A may have 90,000 groups to list and >stalls after transferring >70,000 or so. On the other hand, >server B may have only 300 groups to list and >stalls after >250. -- 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] Re: Security bulletin?
this is a great idea, maybe the admins can setup a php.security or something like that? >Hello everybody! > >Apart from the usual best wishes for 2002, I have a >question: does >anyone know of a good security list/newsletter/bulletin >for PHP? >Actually, any kind of good source would be great, even if >it\'s net >security in general -- what I\'m looking for is: >1. Mostly PHP security (including PHP packages with >vulnerabilities) >and >2. A good source (I\'d like to subscribe to an active >list/newsletter/bulletin so they publish info from other >sources as well >-- not only original data they found out without any >external info). > >Too much to ask? :-) > >Bogdan -- 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] file uploading => dumping into ram?
hi all, I wes doing some file upload stuff with php when i noticed that as the file is being uploaded, the entire file is stored in ram until it\'s finished. obviously, we know the problems associated with this(use up a lot of ram for large files), i\'m just wondering, is this going to be fixed soon in the next release of php? i think those people using php to upload large files will be very happy if it\'s fixed :) -- 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: Re: [PHP] file uploading => dumping into ram?
thanks, i know what u mean, but what if you have to upload bigger files? is it possible that maybe the next php release will have a option to auto write the uploading file to disk(if the file being uploaded is bigger than a certain size) while uploading instead of slurping the entire file into ram. just a suggestion for improvement. :) >set your max upload file size smaller then. default is 2mb >max. I find that >too small, I re-set mine to 5mb. I have 2g of ram on our >server, 5mb isnt a >worry to me. Id rather that then the slow speed of writing >the file to the >hd. > >-- > >Chris Lee >[EMAIL PROTECTED] > > > >\"David\" <[EMAIL PROTECTED]> wrote in message >[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... >> hi all, >> >> I wes doing some file upload stuff with php when i noticed >that as the >file is being uploaded, the entire file is stored in ram >until it\'s >finished. >> >> obviously, we know the problems associated with this(use >up a lot of ram >for large files), i\'m just wondering, is this going to be >fixed soon in the >next release of php? >> >> i think those people using php to upload large files will >be very happy if >>it\'s fixed :) -- 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] Re: session question (4.1.1)
how did u check? with a if? u should use the session_is_registered function instead, http://www.php.net/manual/en/function.session-is-registered.php if(!session_is_registered(\"user\")){ print \"invalid user\"; exit; } // your other code here and yes, turning off register globals is a good idea :) >I am trying to implement a user authentication/login system >using PHP 4.x\'s >built in session functions. Upon a successful login, there >is a >session_register(\'uid\',\'uname\',\'status\'). On pages that >require someone to >be an authenticated user I check against >HTTP_SESSION_VARS[\'uid\'] to make >sure it is not null, is greater then 0, and i also check the >HTTP_SESSION_VARS[\'uname\']. >This seemed to be working until I tried to see what would >happen if I fed >it a query string. I fed a \"secure\" >page ?action=edit&uid=3&uname=jon&status=true and my check >still failed >me, but then when i went back to the same secure page >without the bogus >query string, I was in fact authenticated as the user i >forced through. > >Is it possible that global vars even if not registered via >session_register() to end up the HTTP_SESSION_VARS array? I >was under the >impression that the OLY variables and values that would be >in this array >were those that were explicity registered via >session_register(). > >Should i disable register_globals? > >--Jon -- 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] Re: PHP Security Alert for Apache/Win32
Wow!, i tried it and it really works, this is serious man! is there a fix around it without safe mode like GED suggested? >Folks running Apache/Win32 should read this: > >http://www.securiteam.com/windowsntfocus/5ZP030U60U.html > >If you run in CGI mode you likely have a line similar to >the >following in your httpd.conf: >ScriptAlias /php/ \"C:php\" > >Also, if you run SAPI mode (apache plugin mode) and used >to run CGI, make sure that that line is commented out. > >Has someone else got an idea for a workaround, without >having >to go into safe-mode? Would safe-mode be able to prevent >this? > >-GED > >Northern.CA ===-- >http://www.northern.ca >Canada\'s Search Engine > -- 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] Re: Re: PHP Security Alert for Apache/Win32
I tried playing with ScriptAlias settings, but i given up. I now use the the Apache module instead of cgi. To change over to the Apache module: copy php4ts.dll to the windows/system(win9x/Me) or winnt/system32(winNT/2000/XP) directory. then inside httpd.conf: LoadModule php4_module c:/php/sapi/php4apache.dll AddType application/x-httpd-php .php .phtml remember to comment out the most important part after converting: # ScriptAlias /php4/ \"C:/php/\" # Action application/x-httpd-php4 \"/php4/php.exe\" # AddType application/x-httpd-php4 .php folks who are using PHP as a CGI under apache for win32, please read this: http://www.securiteam.com/windowsntfocus/5ZP030U60U.html http://www.hackers.com/new/currentnews.php?nid=5 -- 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] Re: Http request
just use post to send your username/password to the servlet >Hi, > >Can anyone tellme how I can do a http request to a servlet >from a PHP?? > >I mean, I have a username and password which I want to >send in a string(variable) to >a Servlet which authentifies >it and responses back in XML format... > >any suggestions?? > >TIA, >sandeep -- 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] Re: Send output before header location
>How can I output before send header >I see some site some output and after that it Jump to >other site >Is that maked by header localtion ?? no, if there\'s output first, then it\'s not using header(\"Location: whatever.php\"), because headers MUST be sent before any other output to the browser. there are other ways to redirect a user to another page: for example: http://www.yourdomain.com/index.html\";> you could use some javascript to do it too. -- 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] Re: I need help
If i\'m not wrong, you did not specify the php extensions dir in php.ini correctly, mine is: extension_dir = c:/php/extensions assumming c:\\php\\extensions is the php extensions are stored. pls tell me if it works, i\'ve got some oracle questions to ask u if u don\'t mind ;) >Dear Sir, > >I am facing the problem with the PHP configuration. >Whenever I try to load >the php_oci8.dll. It gives me an error > >\"Unable to load dynamic >library \'C:phpextensionsphp_oci8.dll\' - The >specified module could not be found\" > >I have tried my best to resolve this problem but all in >vain. Please let me >know if there is any solution for that. > >I am using Windows2000 and Oracle 8.1.7 and IIS 5 Web >Server. > >If there is any extra library that I need to load then >please tell me about >that and how to get it. > >Thanks and Best Regards -- 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] Re: PHP Chat REALTIME
hey, i thought about this problem last time, i figured out that there's NO WAY to do this in php, (the auto refresh does not count). somebody pls prove me wrong. intrested to continue this discussion David >I need to build a php-chat (online support system), but in >realtime. >I've develope a system that refresh in browser client in 5 >seconds. But i need a >system that works in realtime, what >i meen is when a client or the server send a >message, the >browser refresh when a message was sent. >All this without JAVA. -- 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: Re: [PHP] ok, I ask again.. how to encrypt to be able to match
u used password() to encrypt the value in mysql? u can get back a encrypted value of a value by doing a "select password('secret');" in mysql, it will return u the encrypted value, check this value against the encrypted password in mysql. is this what you're asking? :) >I've asked this several times but it doesn't seem like anyone understands my >problem, the passwords are encrypted in the database, but I don't know how >to match an unencrypted password from the login form with the database? >is it possible to encrypt the password I sent from the form in php or does >that have to be done in mysql? >in any case, how do I do it? >If you don't have anything bright to say, don't, in some of the replys I've >had earlier it sounds like you think I'm an idiot... >And even if I am, I don't want to be refered as one ;) -- 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] Re: CGI vs. ISAPI
use the ISAPI module since you are using with IIS >'m fairly new to PHP, having worked with ColdFusion in the >past. Can somebody shed >some light on to the key >differences between the CGI installation and the ISAPI >>installation. I working with IIS on Win2k and using MySQL >for a db server. 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]
Re: re: [PHP] Paypal Instant Payment Notification
simply change the fsocketopen's socket from 80 to 443 (SSL port) > I'm thinkin' the problem is that I'm not posting to > https://www.paypal.com/blah, but to > http://www.paypal.com/. How do I use the posttohost > function (or some other function) to post securely? -- 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] Re: [URGENT] PHP as an apache module on windows under cygwin
why would you need cygwin am i missing something? there's Win32 binaries availiable for apache check out: http://www.apache.org/dist/httpd/binaries/win32/ as for running it as a module for Apache(Win32), check this out: http://sg.php.net/manual/en/install.apache.php many people prefer using the CGI option under Apache(Win32) thou... - Original Message - Hi! I am very new to both windows and PHP (coming from a solaris environment), so please excuse me if the answer is glaringly obvious. I have built and installed apache (1.3.23) on a windows 2000 Professional (SP2, build 2195) box with cygwin (1.3.9, I believe). The build supports many of the modules included with apache and supports shared objects. Some of the modules are built as shared objects. Is there a way to use the win32 binaries with apache? I keep getting a win32 error when apache tries to dlopen the php module. If not, how can I build php 4.1.1 as a shared object for apache? Please assume no knowledge on my part. TIA Stephano Mariani -- 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] Re: Making apps
Laserjetter said something on 11 Feb 2002, in php.general: > I remeber a while ago there was a question asking if you could make > standalone applications but written in PHP rather than VisualBasic or C > etc and somebody replied with a website which could help. > > Could someone re-post the message please! I can't find it in the > archives! > > I think GTK might be what I'm looking for but I'd like alternatives if > it isn't. > > LJ > > > PHP-GTK is a PHP extension which allows you to write PHP program using a graphical user interface. You can use Glade for a VB style of designing the GUI. http://gtk.php.net/ is the address. Regards, David --- http://php.warpedweb.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Decode Encoded text in phpMyAdmin
Hello, How can I decode encoded text/numbers in my phpMyAdmin? I looked at BASE64, but thats not it. Any help is great. Thanks Example: 8e73b27568cb3be29e2da74d42eab6dd -- - Dave Visit http://www.geocities.com/earthtohorny for info on Computers and Upgrading. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Decode Encoded text in phpMyAdmin
So then there's no way to get it decoded :(. Ah well, thanks for your help anyway. -- - Dave Visit http://www.geocities.com/earthtohorny/ for info on Computers and Upgrading. "Joffrey Van Wageningen" <[EMAIL PROTECTED]> wrote in message 00f101c1b570$d4697450$[EMAIL PROTECTED]">news:00f101c1b570$d4697450$[EMAIL PROTECTED]... > > Hello, > > How can I decode encoded text/numbers in my phpMyAdmin? I looked > at > > BASE64, but thats not it. Any help is great. Thanks > > > > Example: 8e73b27568cb3be29e2da74d42eab6dd > > i dont wanna spoil your day, but your looking at a md5 hash... md5 is a one > way encoding scheme, no way back... md5 is used to make a sum of a load of > data and compared by a second sum to see if the data matches (like passwords > or file integrety) > > if you want 7bit encoding try base64_encoding and _decoding > > hope you can have a good night sleep :) > > mvgr, > Joffrey van Wageningen > > -- > .-[ Joffrey van Wageningen | WoLFjuh | [EMAIL PROTECTED] ]-- > | Networking Event 2000 - www.ne2000.nl - IRCnet:#ne2000, Undernet:#clue > | PGP:1024D/C6BA5863 - 3B93 52D3 CB91 9CB7 C50D FA79 865F 628A C6BA 5863 > | * We demand guaranteed rigidly defined areas of doubt and uncertainty. > | -- Douglas Adams > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: ".htaccess login id"
Mohamed Ismail Bulale said something on 19 Feb 2002, in php.general: > > To get username and password with php, use this below code: > Best regards, > > Bulale Or you could use the varibles $PHP_AUTH_USER & $PHP_AUTH_PW & $PHP_AUTH_TYPE. http://www.php.net/manual/en/features.http-auth.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Unknown Error Reason
Hi, When I try to run this, I get an error saying "invalid file permissions" and will not run. However, I then run it using php -q bank.php and this works fine. Unfortunately, there is a parse error on line 68 (apparantly) which I cannot figure out. Can anyone help me here? Thanks in advance, David Apthorpe. #!/usr/bin/php -q -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unknown Error Reason
Thanks! I think I've been working too hard :) David. Rick Emery wrote: > > First: change - > if(file_exists($info[5]){ > to - > if(file_exists($info[5])){ > > Second: ensure the file permissions are set to rwxrwxr-x for bank.php > > -----Original Message- > From: David [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 11, 2002 3:03 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Unknown Error Reason > > Hi, > > When I try to run this, I get an error saying "invalid file permissions" > and will not run. However, I then run it using php -q bank.php and this > works fine. > > Unfortunately, there is a parse error on line 68 (apparantly) which I > cannot figure out. > > Can anyone help me here? > > Thanks in advance, > > David Apthorpe. Rick Emery wrote: > > First: change - > if(file_exists($info[5]){ > to - > if(file_exists($info[5])){ > > Second: ensure the file permissions are set to rwxrwxr-x for bank.php > > -Original Message- > From: David [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 11, 2002 3:03 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Unknown Error Reason > > Hi, > > When I try to run this, I get an error saying "invalid file permissions" > and will not run. However, I then run it using php -q bank.php and this > works fine. > > Unfortunately, there is a parse error on line 68 (apparantly) which I > cannot figure out. > > Can anyone help me here? > > Thanks in advance, > > David Apthorpe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Unknown Error Reason
Hi. Sorry to bother you. I want to return my PHP script to a shell, and I have line breaks in it. However, the shell doesn't like newlines as far as I can tell (it puts it all one line). In my program, the line is split by \n. Can anyone help me with this issue? Thanks David. David wrote: > > Thanks! I think I've been working too hard :) > > David. > > Rick Emery wrote: > > > > First: change - > > if(file_exists($info[5]){ > > to - > > if(file_exists($info[5])){ > > > > Second: ensure the file permissions are set to rwxrwxr-x for bank.php > > > > -Original Message- > > From: David [mailto:[EMAIL PROTECTED]] > > Sent: Monday, March 11, 2002 3:03 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Unknown Error Reason > > > > Hi, > > > > When I try to run this, I get an error saying "invalid file permissions" > > and will not run. However, I then run it using php -q bank.php and this > > works fine. > > > > Unfortunately, there is a parse error on line 68 (apparantly) which I > > cannot figure out. > > > > Can anyone help me here? > > > > Thanks in advance, > > > > David Apthorpe. > > Rick Emery wrote: > > > > First: change - > > if(file_exists($info[5]){ > > to - > > if(file_exists($info[5])){ > > > > Second: ensure the file permissions are set to rwxrwxr-x for bank.php > > > > -Original Message- > > From: David [mailto:[EMAIL PROTECTED]] > > Sent: Monday, March 11, 2002 3:03 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP] Unknown Error Reason > > > > Hi, > > > > When I try to run this, I get an error saying "invalid file permissions" > > and will not run. However, I then run it using php -q bank.php and this > > works fine. > > > > Unfortunately, there is a parse error on line 68 (apparantly) which I > > cannot figure out. > > > > Can anyone help me here? > > > > Thanks in advance, > > > > David Apthorpe. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Returning to a Shell Script
I have a PHP script which echos several lines, with \n newlines. I want to return this to the Shell Script, with return=$( bank.php ) and print $return out. However, it doesn't know how to print new lines. Does anyone know how to do this? Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Monetary Information
Hi, I need to store monetary (UK) information in a text file. However, it is possible to either not put in the pence details, or to add more than one decimal point or >3 numbers after the decimal point. Does PHP have a function which takes a number and puts it into a locale-formatted number (in this case UK), or do I have to make one? David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Monetary Information
David wrote: > > Hi, > > I need to store monetary (UK) information in a text file. However, it > is possible to either not put in the pence details, or to add more than > one decimal point or >3 numbers after the decimal point. > > Does PHP have a function which takes a number and puts it into a > locale-formatted number (in this case UK), or do I have to make one? > > David. Sorry, I found the actual function. Thanks PHP group - most useful newsgroup around! David. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Superglobals....
Hi, Is there any way to emulate the super globals on PHP4.0.6. I've designed a system using $_GET, $_POST, etc, and I had it all running wonderfully, but I have been forced to change servers to some folks who do not seem to have an upgrade to 4.1.x in mind. What I would like to know is... is there away to make a variable global across all functions, like the $_* type vars? Without putting global $_SERVER, $_GET, $_POST, $_REQUEST, $_SESSION, $_COOKIE; at the top of each function. Thanks! David -- --- WarpedWeb.Net http://www.warpedweb.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Superglobals....
Jason Sheets said something on 24 Mar 2002, in php.general: > You might remind them that anything under PHP 4.1.2 has a security > whole that can be exploited remotely, my web host refused to upgrade > until they learned about the security implications of not doing so. > > Jason The are running a patched version. -- --- WarpedWeb.Net http://www.warpedweb.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HTML Character Parsing
Hi all, I have a textarea which will containg info from the user. This then needs to be parsed through something like htmlspecialchars() or htmlentities(). The issue is that my system really needs to do the following: 1. Accept the info 2. Check if there is any HTML syntax (, etc) 3. If YES: remove anything that might be harmful (eg FORM, etc) 4. If NO: Add replace CR/LF with The idea is that normal formatting such as , , , is ok, but I do not want off illegal stuff. I want something a little like Slashdot's stuff. Easy?? anyone know anything about this? Thanks David R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Making graphics
Another option (Maybe not the easiest, but so pretty: Newer version of Delphi/Kylix allow for web-based application deployment. You could use this and a nice graphics component like Teechart, etc. Ron Allen wrote: > Here is what I want to do. > > I am taking a poll and I would like to display the results in a bar graph > format. What is the best way to do this.hopefully you will not say GD > library! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Display HTML links as links in Blobs or TEXT output
I have a TEXT or BLOB field in my database and everthing works great when I display it in my browser with PHP except HTML links are not clickable (appear as normal text). How do I display the links in the BLOB field as actual HTML links on my web page? While I'm on the subject: How do I display PHP code examples in my BLOB output on a web page? -- 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] Display HTML linksas links in BLOB output
I have a TEXT or BLOB field in my database and everthing works great when I display it in my browser with PHP except HTML links are not clickable (appear as normal text). How do I display the links in the BLOB field as actual HTML links on my web page? While I'm on the subject: How do I display PHP code examples in my BLOB output on a web page? -- 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] Display HTML links as links in BLOB output
I have a TEXT or BLOB field in my database and everthing works great when I display it in my browser with PHP except HTML links are not clickable (appear as normal text). How do I display the links in the BLOB field as actual HTML links on my web page? While I'm on the subject: How do I display PHP code examples in my BLOB output on a web page? -- 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] eregi_replace help!
Hi, I have a rather annoying eregi_replace which I can't get to work. I have a string, $page which contains a webpage. In the page links are denoted like so: ###LINK###Link Name###URL or Section###ELINK### There are a number of these in $page. I need to use eregi_replace() to replace the above string with a proper link: Link Name Not too bad, right? However, If need to do some manipulation on the "URL or Section" bit. If it is a URL (begining with "http://";, "ftp://";, etc) then it just needs to be put there, ie: ###LINK###PHP###http://www.php.net/###ELINK### = http://www.php.net";>PHP But if it is a section on the site like this: ###LINK###Hello###Main.Section 1.Section 2.Hello World###ELINK### It need to be replaced with this: Hello Here is the rather long (an not working) eregi_replace call I have: $page = eregi_replace("###LINK##(.*)(.*)###ELINK###", "http://";, \\2) ? trim(\\2) : (strtolower(str_replace("\\", "_", eregi_replace("(/| |:|\*|\?|<|>|\|)","_",trim(\\2.".php")).">\\1", $page); 1. I dont think the regular express is really right 2. I'm getting the message "Warning: Unexpected character in input: '\' (ASCII=92) state=1 in c:\users\david\help\www\generate.php on line 24" serval times, which is the above line. Any ideas on how to make this work would be great! Thanks! Regards, David -- 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] thanks
been using php for a few months now, just wanted to say a big THANK YOU to all the developers for such a wonderful language, thanks guys! -- 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] Re: connect to a file outside the web space.
Are you trying to let the user download the file? if so, can try something like this >If one creates a file outside the web space on a server. >How doe\'s one connect to >this from a HTML or PHP page? > >As I understand it. It is not as simple as normal html >link. -- 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] Re: Question for you MySQL gurus...
have you tried MySQL Front? it\'s a really nice win32 client, check it out from: http://www.anse.de/mysqlfront/ screenshot: http://www.anse.de/mysqlfront/images/mysqlfront.gif >I have a huge project I am in the midst of developing (something similar to >www.allmusicguide.com except exclusively for Metal/Hard >Rock). I have set up >my MySQL tables/PHP code for the most part. My question is >2 part: >Of you all, do you use a GUI platform such as MySQL >Manager or MySQLGUI, >etc. or do you hard core it via Telnet and command line? -- 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] Re: http message
use fsockopen http://www.php.net/manual/en/function.fsockopen.php to \"talk\" to the remote host. >Is there a way for PHP to attempt to open a URL and return > the HTTP response >header? > For example, I want to make a PHP page which will redirect a visitor to a > mirror site if it encounters a 404 Not found error whilst > trying to open the >website homepage. This test page will reside on a seperate server. > I was thinking maybe attempting to open the homepage with > something like fopen() >and, using nested if() statements, > try the next mirror in the list > if the fopen() command didnt succeed. > Any ideas? -- 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: Re: [PHP] PHP 4.10: any way to override register_globals = OFF
you can do this to get what u want: foreach($_GET as $key => $val){ $$key = $val; } this is what u want to do, right? :) >for all in $_GET >{ >$[varname] = $_GET[varname] >} -- 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] Re: Random
should be because rand() can\'t generate such a large number for u. use $max_random_number = getrandmax(); to check http://sg.php.net/manual/en/function.getrandmax.php -- 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] Socket functions
Hi, just wondering if anyone have tried the socket functions in php http://www.php.net/manual/en/ref.sockets.php does it work on win32(apache)? i tried the simple TCP/IP example on that page but it does\'nt work for me. I\'m using 4.1.0 and enabled that entension already. -- 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: Re: [PHP] Re: Random
yeah, my linux(Mandrake 8, Apache 1.3.22, PHP 4.1.0) box also gives me a 6 digit integer each time too. but when i tried on my win32 (Win2k, Apache 1.3.22, PHP 4.1.0), it is limited to a max of 32767 as indicated with getrandmax(). the origional author of the problem probably using windows too :) >> should be because rand() can\'t generate such a large number for u. >> >> use $max_random_number = getrandmax(); to check >> >> http://sg.php.net/manual/en/function.getrandmax.php > >Hmmm... My webserver gives me no problems witht this at >all. >(Sun E250 with Solaris 8, Apache 1.3.20 and PHP4.6) >This : >$floor = 10; >$ceiling = 99; >srand((double)microtime()*100); >$random = rand($floor, $ceiling); >print $random; >?> >Gives me a 6-digit integer every time -- 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] Re: Book.
hmm, this how i use php for cron jobs: #!/usr/local/bin/php // location of php binary then just ask cron to run this script at your wish of time interval >I have a good understanding of PHP. I like to read more >documentation advanced PHP topics and also some more >information on how to run PHP from Unix, as a cron job, >how can PHP scripts be >called from Shell Scripts etc... > >Any book or doc suggestions. > >Thanks, >erisen. -- 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] PHP Logo?
hmm, i remember not too long ago, people were suggesting a new logo for php... wondering why nobody\'s discussing it now? or am i missing something? -- 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: Re: [PHP] 4.10 New Vars Question
hmm, now that i\'m trying to program with register_globals=off, what is the new $HTTP_SESSION_VARS? maybe there should be a page in the online manual describing these new variables for easy reference after all, i can\'t find reference to them other than those on the changelog too. thanks David > >Two items in the new 4.10 change-log caught my attention: > >* Introduced a new $_REQUEST array, which includes any >GET, POST or >COOKIE variables. Like the other new variables, this >variable is also >available regardless of the context. (Andi & Zeev) >* Introduced $_GET, $_POST, $_COOKIE, $_SERVER and $_ENV >variables, which >deprecate the old $HTTP_*_VARS arrays. In addition to be >much shorter to type - >these variables are also available >regardless of the scope, and there\'s no need to >import >them using the \'global\' statement. (Andi & Zeev) > >However, I can\'t seem to find any documentation regarding >these variables on the >php.net site. Any pointers? Am I >missing something obvious? 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]
Re: Re: Re: [PHP] 4.10 New Vars Question
ok, thanks Phillips! >The new vars will be listed and described in the manual >eventually (fairly soon). >For now, read the above release >notes. -- 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] Auto submit form
How do I autoload a selection from a drop down menu form based on the selection without having to click a submit button? -- 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] Loop an INSERT 10 rows from a Form
The form is no problem but how do INSERT 10 ROWS with one insert statement. I figure some kind of loop like I did with the form. When form is submitted: $query = "INSERT INTO songs VALUES ('$id', '$songname','$rating','$video', '$album_id', '$movie')"; $result = mysql_db_query("movies", $query); if ($result) { // worked This is the form: ID:size=3> Songname: Rating: Video ID: Album ID:size=2 maxsize=3> Movie ID: -- 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 Inserting Array of Rows from form
I am trying to insert an array of rows or values from a PHP form into a MySQL database. There are six columns in the table songs: id, songname, rating, video, album_id, movie. Here is what I get when I submit the form Add songs for Record Array INSERT INTO songs VALUES (' 1, blah', ' ***', ' 45', ' 2', ' ') id[0]=: 2 this is debug code INSERT Failed, check the code.this is debug code The problem seems to be with this part: for ($i=0; $i<= $songsinalbum; $i++) { $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', '$album_id[$i]', '$movie[$i]')"; } // $vals=preg_replace("^,", "", $vals); $vals=preg_replace('/^,/', '', $vals); // chop leading comma Complete code: When the user presses submit on the form this part executes: mysql_connect("192.168.0.1", "mysqluser", "mypassword"); $vals=' '; for ($i=0; $i<= $songsinalbum; $i++) { $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', '$album_id[$i]', '$movie[$i]')"; } // $vals=preg_replace("^,", "", $vals); $vals=preg_replace('/^,/', '', $vals); // chop leading comma $qry="INSERT INTO songs VALUES $vals"; echo $qry; $res=mysql_query($qry); Here is part of the form: ID: Songname: 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] Problem Inserting Array of Rows from form
I did add mysql_error which helped me solve part of the problem: I was missing a single quote in the $val line after $id[$i] and before songname : Here is the corrected code but there is still a problem, $vals .=", ('$id[$i]', '$songname[$i]', '$rating[$i]', '$video[$i]', '$album_id[$i]', '$movie[$i]')"; old code was: $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', > '$album_id[$i]', Now the problem is it only inserts one row into the table, when there should be more than one row inserted. Here is the updated code and a sample entry: Songname: Results: Add songs for Record Array 2INSERT INTO songs VALUES (' 2', ' test', ' ***', ' ', ' 1', ' ')MySQL error 0: id[0]=: 3 ID[1]: 3 Songname[1]: test Rating[1]: *** Video[1]: Album ID[1]: 1 test was added to the database Hank Marquardt wrote: > For one, as you've written it you have a mismatch of columns vs. fields -- > > You're combining id and name into one field for the insert -- thus you have > five fields trying to be inserted into a table with six elemets. > > You should have a print of the mysql_error() in your debug code ... I bet if > you did that's what it would tell you:) > > On Sun, Jul 15, 2001 at 07:17:00AM -0600, David wrote: > > I am trying to insert an array of rows or values from a PHP form into a > > MySQL database. There are six columns in the table songs: id, songname, > > rating, video, album_id, movie. > > > > Here is what I get when I submit the form > > Add songs for Record Array > > INSERT INTO songs VALUES (' 1, blah', ' ***', ' 45', ' 2', ' ') > > id[0]=: 2 this is debug code > > INSERT Failed, check the code.this is debug code > > > > The problem seems to be with this part: > > > > for ($i=0; $i<= $songsinalbum; $i++) { > > $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', > > '$album_id[$i]', > > '$movie[$i]')"; > > } > > > > // $vals=preg_replace("^,", "", $vals); > > $vals=preg_replace('/^,/', '', $vals); // chop leading comma > > > > > > Complete code: > > When the user presses submit on the form this part executes: > > > > mysql_connect("192.168.0.1", "mysqluser", "mypassword"); > > > > $vals=' '; > > for ($i=0; $i<= $songsinalbum; $i++) { > > $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', > > '$album_id[$i]', > > '$movie[$i]')"; > > } > > > > // $vals=preg_replace("^,", "", $vals); > > $vals=preg_replace('/^,/', '', $vals); // chop leading comma > > > > $qry="INSERT INTO songs VALUES $vals"; > > > > echo $qry; > > > > $res=mysql_query($qry); > > > > > > Here is part of the form: > > > > > $i = 1; > > while ($i <= $songsinalbum) { > > ?> > > > > ID:> size=3> > > > > Songname: > size=30> > > > $i++; > > }; > > > > > > > > > > -- > > 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] > > -- > Hank Marquardt <[EMAIL PROTECTED]> > http://web.yerpso.net > > Web & Database Development in PHP, MySQL/PostgreSQL > Small Office Networking Solutions - Debian GNU/Linux & FreeBSD > PHP Instructor - HTML Writers Guild <http://www.hwg.org> > *** PHP II "The Cool Stuff" starts July 16, 2001 > *** http://www.hwg.org/services/classes/p181.1.html > > -- > 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] Re: Problem Inserting Array of Rows from form
I will try without single quotes for the id and other fields which have numeric values. For the original issue I was missing two single quotes. I was missing a single quote in the $val line after $id[$i] and before songname : I really don't need the quote for id since it is a numeric value. Here is the corrected code but there is still a problem, $vals .=", ('$id[$i]', '$songname[$i]', '$rating[$i]', '$video[$i]', '$album_id[$i]', '$movie[$i]')"; old code was: $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', > '$album_id[$i]', Now the problem is it only inserts one row into the table, when there should be more than one row inserted. Here is the updated code and a sample entry: Songname: Results: Add songs for Record Array 2INSERT INTO songs VALUES (' 2', ' test', ' ***', ' ', ' 1', ' ')MySQL error 0: id[0]=: 3 ID[1]: 3 Songname[1]: test Rating[1]: *** Video[1]: Album ID[1]: 1 test was added to the database James Tan wrote: > dear david, > > did u know u do not need to put single quote to enclose number type value?? > > notice ur field select syntax: > > INSERT INTO songs VALUES (' 1 // --> 1 is not enclosed with end quote... > thus makes only 5 fields, not 6 > , blah', ' ***', ' 45', ' 2', ' ') > id[0]=: 2 > > try > INSERT INTO songs VALUES ('1', 'blah', ' ***', ' 45', ' 2', ' ') > id[0]=: 2 > > hope it helps, > > regards, > > James > > David wrote: > > > I am trying to insert an array of rows or values from a PHP form into a > > MySQL database. There are six columns in the table songs: id, songname, > > rating, video, album_id, movie. > > > > Here is what I get when I submit the form > > Add songs for Record Array > > INSERT INTO songs VALUES (' 1, blah', ' ***', ' 45', ' 2', ' ') > > id[0]=: 2 this is debug code > > INSERT Failed, check the code.this is debug code > > > > The problem seems to be with this part: > > > > for ($i=0; $i<= $songsinalbum; $i++) { > > $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', > > '$album_id[$i]', > > '$movie[$i]')"; > > } > > > > // $vals=preg_replace("^,", "", $vals); > > $vals=preg_replace('/^,/', '', $vals); // chop leading comma > > > > Complete code: > > When the user presses submit on the form this part executes: > > > > mysql_connect("192.168.0.1", "mysqluser", "mypassword"); > > > > $vals=' '; > > for ($i=0; $i<= $songsinalbum; $i++) { > > $vals .=", ('$id[$i], $songname[$i]', '$rating[$i]', '$video[$i]', > > '$album_id[$i]', > > '$movie[$i]')"; > > } > > > > // $vals=preg_replace("^,", "", $vals); > > $vals=preg_replace('/^,/', '', $vals); // chop leading comma > > > > $qry="INSERT INTO songs VALUES $vals"; > > > > echo $qry; > > > > $res=mysql_query($qry); > > > > Here is part of the form: > > > > > $i = 1; > > while ($i <= $songsinalbum) { > > ?> > > > > ID:> size=3> > > > > Songname: > size=30> > > > $i++; > > }; > > -- > 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] Pass variables with PHP_SELF?
How do you pass a variable that was passed from one form to another form and then to PHP_SELF? The first part works fine: I passed a variable from one form to another page with a form using blah.php?id=$id&songsinalbum=$songsinalbumbut when someone submits the second form the value of $songsinalbum is not passed when using PHP_SELF. Do I have to pass to another page? I want to use PHP_SELF -- 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] cURL - Error 400
Hi I was wondering if anyone could please help me with this cURL script since I keep getting error 400 from the web server: http://pastebin.ca/1392840 It worked until around a month ago which is when they presumably made changes to the site. Except I can't figure out what configuration option in the cURL PHP script needs to be changed. I can visit the site perfectly in Lynx, Firefox and IE. Thanks
Re: [PHP] cURL - Error 400
Except I also need to POST data to the server to login. After I've logged in, I then need to use cookies to maintain a session. Doing that via file_get_contents() just isn't possible. Thanks On Thu, Apr 16, 2009 at 2:30 AM, haliphax wrote: > On Wed, Apr 15, 2009 at 10:36 AM, David >> wrote: >> > I was wondering if anyone could please help me with this cURL script >> since I >> > keep getting error 400 from the web server: >> > >> > http://pastebin.ca/1392840 >> > >> > It worked until around a month ago which is when they presumably made >> > changes to the site. Except I can't figure out what configuration option >> in >> > the cURL PHP script needs to be changed. I can visit the site perfectly >> in >> > Lynx, Firefox and IE. >> >> Are you just trying to get the contents of the page, or is there >> something special you're doing? If it's just the contents you're >> after, try file_get_contents() if allow_url_fopen is set to TRUE for >> your PHP installation. >> >> http://php.net/file_get_contents >> http://php.net/allow_url_fopen >> >> Hope this helps, >> >> >> -- >> // Todd >> > >
Re: [PHP] cURL - Error 400
Hi, Sorry, that didn't work. The website is still returning error 400 with CURLOPT_COOKIESESSION and CURLOPT_COOKIE enabled. I did some experimentation in Firefox by blocking and deleting all cookies from the site. When I then visited the site, I was able to reach the logon page without returning error 400 so I doubt it's cookies that is the problem. I also tried changing the HTTP headers to: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Connection: Keep-Alive Content-Type: text/html; charset=UTF-8 Which didn't work either. Thanks On Thu, Apr 16, 2009 at 11:48 PM, haliphax wrote: > On Wed, Apr 15, 2009 at 9:17 PM, David wrote: > > Except I also need to POST data to the server to login. After I've logged > > in, I then need to use cookies to maintain a session. > > > > Doing that via file_get_contents() just isn't possible. > > > > > > Thanks > > > > On Thu, Apr 16, 2009 at 2:30 AM, haliphax wrote: > >> > >> On Wed, Apr 15, 2009 at 10:36 AM, David > wrote: > >> > I was wondering if anyone could please help me with this cURL script > >> > since I > >> > keep getting error 400 from the web server: > >> > > >> > http://pastebin.ca/1392840 > >> > > >> > It worked until around a month ago which is when they presumably made > >> > changes to the site. Except I can't figure out what configuration > option > >> > in > >> > the cURL PHP script needs to be changed. I can visit the site > perfectly > >> > in > >> > Lynx, Firefox and IE. > >> > >> Are you just trying to get the contents of the page, or is there > >> something special you're doing? If it's just the contents you're > >> after, try file_get_contents() if allow_url_fopen is set to TRUE for > >> your PHP installation. > >> > >> http://php.net/file_get_contents > >> http://php.net/allow_url_fopen > > David, please refrain from top-posting. > > As for cURL login/session handling... I have an automated script that > connects to a phpBB bulletin board, and here are the settings that > have worked for me: > > curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); > curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > curl_setopt($ch, CURLOPT_COOKIESESSION, true); > curl_setopt($ch, CURLOPT_HEADER, false); > curl_setopt($ch, CURLOPT_COOKIEFILE, "{$homedir}cookiefile"); > curl_setopt($ch, CURLOPT_COOKIEJAR, "{$homedir}cookiefile"); > curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id()); > > I would think CURLOPT_FOLLOWLOCATION and the CURLOPT_COOKIE* options > are most important for resolving your issue. > > HTH, > > > -- > // Todd >
Re: [PHP] cURL - Error 400
On Fri, Apr 17, 2009 at 8:20 PM, haliphax wrote: > On Thu, Apr 16, 2009 at 11:41 PM, David wrote: > > Hi, > > > > Sorry, that didn't work. The website is still returning error 400 with > > CURLOPT_COOKIESESSION and CURLOPT_COOKIE enabled. > > > > I did some experimentation in Firefox by blocking and deleting all > cookies > > from the site. When I then visited the site, I was able to reach the > logon > > page without returning error 400 so I doubt it's cookies that is the > > problem. > > > > I also tried changing the HTTP headers to: > > > > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > > Connection: Keep-Alive > > Content-Type: text/html; charset=UTF-8 > > > > Which didn't work either. > > > > > > > > > > Thanks > > > > On Thu, Apr 16, 2009 at 11:48 PM, haliphax wrote: > >> > >> On Wed, Apr 15, 2009 at 9:17 PM, David > wrote: > >> > Except I also need to POST data to the server to login. After I've > >> > logged > >> > in, I then need to use cookies to maintain a session. > >> > > >> > Doing that via file_get_contents() just isn't possible. > >> > > >> > > >> > Thanks > >> > > >> > On Thu, Apr 16, 2009 at 2:30 AM, haliphax wrote: > >> >> > >> >> On Wed, Apr 15, 2009 at 10:36 AM, David > >> >> wrote: > >> >> > I was wondering if anyone could please help me with this cURL > script > >> >> > since I > >> >> > keep getting error 400 from the web server: > >> >> > > >> >> > http://pastebin.ca/1392840 > >> >> > > >> >> > It worked until around a month ago which is when they presumably > made > >> >> > changes to the site. Except I can't figure out what configuration > >> >> > option > >> >> > in > >> >> > the cURL PHP script needs to be changed. I can visit the site > >> >> > perfectly > >> >> > in > >> >> > Lynx, Firefox and IE. > >> >> > >> >> Are you just trying to get the contents of the page, or is there > >> >> something special you're doing? If it's just the contents you're > >> >> after, try file_get_contents() if allow_url_fopen is set to TRUE for > >> >> your PHP installation. > >> >> > >> >> http://php.net/file_get_contents > >> >> http://php.net/allow_url_fopen > >> > >> David, please refrain from top-posting. > >> > >> As for cURL login/session handling... I have an automated script that > >> connects to a phpBB bulletin board, and here are the settings that > >> have worked for me: > >> > >> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); > >> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > >> curl_setopt($ch, CURLOPT_COOKIESESSION, true); > >> curl_setopt($ch, CURLOPT_HEADER, false); > >> curl_setopt($ch, CURLOPT_COOKIEFILE, "{$homedir}cookiefile"); > >> curl_setopt($ch, CURLOPT_COOKIEJAR, "{$homedir}cookiefile"); > >> curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id()); > >> > >> I would think CURLOPT_FOLLOWLOCATION and the CURLOPT_COOKIE* options > >> are most important for resolving your issue. > > PLEASE. > STOP. > TOP. > POSTING. > > Did you try CURLOPT_FOLLOWLOCATION? If your page uses any sort of > redirect, cURL will probably fail without this option. > > > -- > // Todd Yes, I've already tried CURLOPT_FOLLOWLOCATION. I believe it was included it in the code I initially uploaded to pastebin.ca.
Re: [PHP] cURL - Error 400
On Fri, Apr 17, 2009 at 8:55 PM, Andrew Ballard wrote: > On Fri, Apr 17, 2009 at 12:41 AM, David wrote: > > On Thu, Apr 16, 2009 at 11:48 PM, haliphax wrote: > > > >> On Wed, Apr 15, 2009 at 9:17 PM, David > wrote: > >> > Except I also need to POST data to the server to login. After I've > logged > >> > in, I then need to use cookies to maintain a session. > >> > > >> > Doing that via file_get_contents() just isn't possible. > >> > > >> > > >> > Thanks > >> > > >> > On Thu, Apr 16, 2009 at 2:30 AM, haliphax wrote: > >> >> > >> >> On Wed, Apr 15, 2009 at 10:36 AM, David > >> wrote: > >> >> > I was wondering if anyone could please help me with this cURL > script > >> >> > since I > >> >> > keep getting error 400 from the web server: > >> >> > > >> >> > http://pastebin.ca/1392840 > >> >> > > >> >> > It worked until around a month ago which is when they presumably > made > >> >> > changes to the site. Except I can't figure out what configuration > >> option > >> >> > in > >> >> > the cURL PHP script needs to be changed. I can visit the site > >> perfectly > >> >> > in > >> >> > Lynx, Firefox and IE. > >> >> > >> >> Are you just trying to get the contents of the page, or is there > >> >> something special you're doing? If it's just the contents you're > >> >> after, try file_get_contents() if allow_url_fopen is set to TRUE for > >> >> your PHP installation. > >> >> > >> >> http://php.net/file_get_contents > >> >> http://php.net/allow_url_fopen > >> > >> David, please refrain from top-posting. > >> > >> As for cURL login/session handling... I have an automated script that > >> connects to a phpBB bulletin board, and here are the settings that > >> have worked for me: > >> > >> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); > >> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > >> curl_setopt($ch, CURLOPT_COOKIESESSION, true); > >> curl_setopt($ch, CURLOPT_HEADER, false); > >> curl_setopt($ch, CURLOPT_COOKIEFILE, "{$homedir}cookiefile"); > >> curl_setopt($ch, CURLOPT_COOKIEJAR, "{$homedir}cookiefile"); > >> curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id()); > >> > >> I would think CURLOPT_FOLLOWLOCATION and the CURLOPT_COOKIE* options > >> are most important for resolving your issue. > >> > >> HTH, > >> > >> > >> -- > >> // Todd > >> > > > > > Hi, > > > > Sorry, that didn't work. The website is still returning error 400 with > > CURLOPT_COOKIESESSION and CURLOPT_COOKIE enabled. > > > > I did some experimentation in Firefox by blocking and deleting all > cookies > > from the site. When I then visited the site, I was able to reach the > logon > > page without returning error 400 so I doubt it's cookies that is the > > problem. > > > > I also tried changing the HTTP headers to: > > > > Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > > Connection: Keep-Alive > > Content-Type: text/html; charset=UTF-8 > > > > Which didn't work either. > > > > > > > > > > Thanks > > > > Does the site require a valid HTTP_REFERER? I haven't seen > CURLOPT_REFERER in any of your examples. (If I missed it somewhere, > just ignore the noise.) > > Andrew Hi, I'm pretty sure that it doesn't require a referring site. Thanks
Re: [PHP] cURL - Error 400
On Mon, Apr 20, 2009 at 9:35 PM, haliphax wrote: > On Fri, Apr 17, 2009 at 7:58 AM, David wrote: > > On Fri, Apr 17, 2009 at 8:55 PM, Andrew Ballard > wrote: > >> > >> On Fri, Apr 17, 2009 at 12:41 AM, David > wrote: > >> > On Thu, Apr 16, 2009 at 11:48 PM, haliphax > wrote: > >> > > >> >> On Wed, Apr 15, 2009 at 9:17 PM, David > >> >> wrote: > >> >> > Except I also need to POST data to the server to login. After I've > >> >> > logged > >> >> > in, I then need to use cookies to maintain a session. > >> >> > > >> >> > Doing that via file_get_contents() just isn't possible. > >> >> > > >> >> > > >> >> > Thanks > >> >> > > >> >> > On Thu, Apr 16, 2009 at 2:30 AM, haliphax > wrote: > >> >> >> > >> >> >> On Wed, Apr 15, 2009 at 10:36 AM, David < > quick.webmas...@gmail.com> > >> >> wrote: > >> >> >> > I was wondering if anyone could please help me with this cURL > >> >> >> > script > >> >> >> > since I > >> >> >> > keep getting error 400 from the web server: > >> >> >> > > >> >> >> > http://pastebin.ca/1392840 > >> >> >> > > >> >> >> > It worked until around a month ago which is when they presumably > >> >> >> > made > >> >> >> > changes to the site. Except I can't figure out what > configuration > >> >> option > >> >> >> > in > >> >> >> > the cURL PHP script needs to be changed. I can visit the site > >> >> perfectly > >> >> >> > in > >> >> >> > Lynx, Firefox and IE. > >> >> >> > >> >> >> Are you just trying to get the contents of the page, or is there > >> >> >> something special you're doing? If it's just the contents you're > >> >> >> after, try file_get_contents() if allow_url_fopen is set to TRUE > for > >> >> >> your PHP installation. > >> >> >> > >> >> >> http://php.net/file_get_contents > >> >> >> http://php.net/allow_url_fopen > >> >> > >> >> David, please refrain from top-posting. > >> >> > >> >> As for cURL login/session handling... I have an automated script that > >> >> connects to a phpBB bulletin board, and here are the settings that > >> >> have worked for me: > >> >> > >> >> curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); > >> >> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); > >> >> curl_setopt($ch, CURLOPT_COOKIESESSION, true); > >> >> curl_setopt($ch, CURLOPT_HEADER, false); > >> >> curl_setopt($ch, CURLOPT_COOKIEFILE, "{$homedir}cookiefile"); > >> >> curl_setopt($ch, CURLOPT_COOKIEJAR, "{$homedir}cookiefile"); > >> >> curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . > session_id()); > >> >> > >> >> I would think CURLOPT_FOLLOWLOCATION and the CURLOPT_COOKIE* options > >> >> are most important for resolving your issue. > >> >> > >> >> HTH, > >> >> > >> >> > >> >> -- > >> >> // Todd > >> >> > >> > > >> > >> > Hi, > >> > > >> > Sorry, that didn't work. The website is still returning error 400 with > >> > CURLOPT_COOKIESESSION and CURLOPT_COOKIE enabled. > >> > > >> > I did some experimentation in Firefox by blocking and deleting all > >> > cookies > >> > from the site. When I then visited the site, I was able to reach the > >> > logon > >> > page without returning error 400 so I doubt it's cookies that is the > >> > problem. > >> > > >> > I also tried changing the HTTP headers to: > >> > > >> > Accept: > text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 > >> > Connection: Keep-Alive > >> > Content-Type: text/html; charset=UTF-8 > >> > > >> > Which didn't work either. > >> > > >> > > >> > > >> > > >> > Thanks > >> > > >> > >> Does the site require a valid HTTP_REFERER? I haven't seen > >> CURLOPT_REFERER in any of your examples. (If I missed it somewhere, > >> just ignore the noise.) > > Have you set your CURLOPT_COOKIEFILE properly? Also--you may need to > unlink() it before you log-in using your cURL script to make sure that > any invalid cookie values (i.e., expired session ID) are cleared out. > > unlink("{$homedir}cookiefile"); > curl_setopt($ch, CURLOPT_COOKIESESSION, true); > curl_setopt($ch, CURLOPT_COOKIEFILE, "{$homedir}cookiefile"); > curl_setopt($ch, CURLOPT_COOKIEJAR, "{$homedir}cookiefile"); > curl_setopt($ch, CURLOPT_COOKIE, session_name() . '=' . session_id()); > ... > > (where $homedir is "/home/haliphax/" or some such value.) > > HTH, > > > -- > // Todd > Hi, The cookie file is currently empty but when I delete it, a new one is created once the script is ran. Thanks
[PHP] change database from mysql to mssql
Hi all I have been using mysql as the database for my PHP application. Now my manager ordered me to use Microsoft SQL Server as the database. I have been using the mysql interface to access the database, so I have to change my code. Which database interface should I use, ODBC, ADO, mssql or PEAR? Any brief suggestion or link to some good tutorial/paper would be very much appreciated. David Oilfield China Lottery Online Co. Ltd Email:[EMAIL PROTECTED] Mobile:13521805655 Phone:010-83557528-263
[PHP] why i could not use DB.php?
hi I want to use the DB.php to access mysql database, so I add the following line to my file: require_once 'DB.php'; but I get the following error info: Warning: main(DB.php): failed to open stream: No such file or directory in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 Fatal error: main(): Failed opening required 'DB.php' (include_path='.;d:\php\PEAR') in D:\Apache2\htdocs\dunj\test\member\connectDatabase.php on line 2 what happened? i am convinced that the DB.php exists under the directory 'd:\php\PEAR'. David Oilfield China Lottery Online Co. Ltd. Email:[EMAIL PROTECTED] Mobile:13521805655 Phone:010-83557528-263
Re: [PHP] import_request_variables
Dear Philip, I got this error at browser : Fatal error: Call to undefined function: import_request_variables() in /var/www/html/zm.php on line 21 - Original Message - From: "Philip Olson" <[EMAIL PROTECTED]> To: "Kalpin Erlangga Silaen" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent: Wednesday, July 07, 2004 9:23 AM Subject: Re: [PHP] import_request_variables > > > I get error : import_request_variables while I make a script to call a > > variable. > > > > This my header (in my script -- error) : > > > > import_request_variables( "GPC" ); > > > > anybody knows why this happen ? > > > So, what's the exact error PHP gives you? > > Regards, > Philip > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] import_request_variables
Dear Philip, Thank you for your suggestions, may I will upgrade my php to newer version for better results. Regards, Kalpin Erlangga Silaen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] 'application' variables not available? Alternatives?
Hi I am looking at converting a large project from ASP to PHP, and have read that there is no equivalent of global.asa in PHP. It is probably easiest if I describe the problem starting with how the ASP does it: Project uses global.asa to load a lot of 'global' constants and variables into memory. This includes translations for the web site in a number of different languages. These are loaded from text files so that changing them is easy. These items when loaded in global.asa are as if they are in an associative array which is available to the whole application - it is not destroyed when the page is destroyed! Any ideas how I could handle this in PHP? The ASP method seems sensible, as the data is much too big to load for every page, and too common to load only when required. Holding it in memory and it having application wide scope like this is fast. Loading only parts required at execution from, say, a database would surely be too costly in db calls? Anyone have any ideas about what I could do? Many thanks, David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] 'application' variables not available? Alternatives?
Thanks very much for that Vidyet. This is going to be a massive help. "Vidyut Luther" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi David, > I'd say your best bet is to use memcached. This will allow the > variables you specified to stay in memory, and be accessible to all > other applications. > > http://www.danga.com/memcached/ > > Keep in mind though, just because ASP does it in one way, you don't want > to do a bit for bit copy. You could also look into options like the > auto_prepend feature in php.ini, and the define() function. > > http://us2.php.net/define > > I personally don't like using the auto_prepend feature, but it's there > and you could use it if you like, I'm a fan of implicitly requiring > files if I need to. > > If your associative array, is really that large that it's going to slow > things down, you may also want to consider whether all your scripts need > all of the data, and then possibly define things that are only necessary > for certain classes, in the file for that class. > > You can also serialize your associative array, and store it in the > database.. but it's really all dependant on what you need, and what the > app needs. > > > > david wrote: >> Hi >> >> I am looking at converting a large project from ASP to PHP, and have read >> that there is no equivalent of global.asa in PHP. It is probably easiest >> if >> I describe the problem starting with how the ASP does it: >> >> Project uses global.asa to load a lot of 'global' constants and variables >> into memory. This includes translations for the web site in a number of >> different languages. These are loaded from text files so that changing >> them >> is easy. These items when loaded in global.asa are as if they are in an >> associative array which is available to the whole application - it is not >> destroyed when the page is destroyed! >> >> Any ideas how I could handle this in PHP? The ASP method seems sensible, >> as >> the data is much too big to load for every page, and too common to load >> only >> when required. Holding it in memory and it having application wide scope >> like this is fast. Loading only parts required at execution from, say, a >> database would surely be too costly in db calls? >> >> Anyone have any ideas about what I could do? >> >> Many thanks, David >> >> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] simple product selection guide
This is probably pretty basic but : I'd like to create a page where the end result is the product(s) listed based on certain criteria selected by the user, so I would like a drop down menu or other means that they select from and based on that selection a second list apears and then a third list, and then from those criteria have the product or products listed I have a php/mysql host. What would you recomend to develop this. Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Accelerator
I need a PHP accelerator but am not sure which one to use. I would highly prefer to not use a commercial accelerator and need one that works with PHP 5. Does anyone recommend one out of the ones that exist? Here are the ones I am aware of..but have no idea which ones are better than others. - After Burner - APC - ionCube PHP Accelerator - Turck MMCache for PHP Thanks, David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compiling PHP with external mySQL libraries
1) Does adding 'shared,' as a ./configure option mean the module is compiled as an external, dynamically loaded module as compared to the module being statically linked into the 'exe' file? So that adding 'shared,' means I must add a line in the PHP ini file to load the extension (or load with a funcion call). 2) When configuring PHP with mysql support by something like '--with-mysql=/usr' does it automatically create a shared module? i.e do both these following configs produce the same result '--with-mysql=/usr' and '--with-mysql=shared,/usr'? The reason I ask, is I see many PHP info pages that specify '--with-mysql=[DIR]' without the 'shared,' bit, and they do specify an external library with the [DIR] part, but in the mysql info section 'MYSQL_MODULE_TYPE' shows as 'external'. I thought 'shared,' would have to be added to create an external dynamic loaded module? Thanks for the help! If I posted this in the wrong group, please excuse me. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] italic, bold and underline with GD ?
Can we use some function with GD to make text italic, bold and/or underline? http://php.net/imagettftext I see we can change size and font, but not style it's not possible in PHP? Thanks in advance David -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Confused on Session Register
Hi All I was trying to write a PHP session and was confused whether to use session_register or $_SESSION. Anyone know when to use either of these? (Or an interpretation of the following line)? Use of $_SESSION (or $HTTP_SESSION_VARS with PHP 4.0.6 or less) is recommended for security and code readablity. With $_SESSION or $HTTP_SESSION_VARS, there is no need to use session_register()/session_unregister()/session_is_registered() functions. Users can access session variable like a normal variable. Thanks dave lash > -- > From: Tyler Longren[SMTP:[EMAIL PROTECTED]] > Sent: Monday, April 15, 2002 2:48 PM > To: Tom Beidler; php list > Subject: Re: [PHP] calculating US holidays > > $month = date("m"); > $day = date("d"); > if ($month == "10" && $day == "31") { > print "It's Halloween!"; > } > ?> > > you could do something similar to that. > > tyler > > - Original Message - > From: "Tom Beidler" <[EMAIL PROTECTED]> > To: "php list" <[EMAIL PROTECTED]> > Sent: Monday, April 15, 2002 2:17 PM > Subject: [PHP] calculating US holidays > > > > I need to calculate the date to see if it's a holiday, i.e. is today > > presidents day, which happens to be the third monday of february. Can > > someone point me to some code that can do that? > > > > > > -- > > 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] How to obtain unique XML Elements
Anyone have a simple technique for obtaining a unique list of elements from an XML file? Am looking for something that will identify the first opening tag ie and the single tag so that I get an array of tags that I can print out. Having a bit of trouble with regex to get something to work. Basic idea I had is to open file, read through each line with regex, add matches to array, and then do unique elements of array and write to another file. Is there a better way? -- Regards, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File uploads...
Hi all, I am updating a site accounting for register_globals = off. I have a page which allows for the uploading of a number of files. The page sends these in an "array" of files. The destination script used to have: if ($AttachmentCount > 0) { foreach($userfile as $key => $value) { AddAttachment($BPFNo, $value, $userfile_name[$key], $userfile_size[$key], $userfile_type[$key]); } } Where attachmentcount was a variable which could be 0 (no uploads) or more (counting the number of $userfile[] variables there should be. AddAttachment is a function that actually saves the attachment into a database. How would I re-do this? What I would preferably do is have the script AddAttachment for each $_FILES[] there might be. If I need to change it from an array type ($userfile[]) in the calling script, I can easily do this. Can someone help me? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com smime.p7s Description: application/pkcs7-signature
[PHP] Dumb POST Array question
Hi all, I have a multiple select called Consultants[] In one page. On the target page, how would I reference it? Would it be: $_POST['Consultants'][0] $_POST['Consultants'][1] Etc Or something else? Thanks David Russell IT Support Manager Barloworld Optimus (Pty) Ltd Tel: +2711 444-7250 Fax: +2711 444-7256 e-mail: [EMAIL PROTECTED] web: www.BarloworldOptimus.com smime.p7s Description: application/pkcs7-signature
[PHP] Form trouble
Hi, After I submited a query, if I use back then forward again the form will resubmit itself. Which I do not want. Does anyone have a solution for this problem? Thanks, David __ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Form trouble
But what about updates to the database...? Is there away not to have the information send to the server at all? Thanks, David --- Clint Tredway <[EMAIL PROTECTED]> wrote: > When the form is submitted check the database with > the info that is > being submitted. If a record matches the data being > submitted then don't > do the insert. If there is not a record there, then > insert the record.. > > HTH > Clint > > -Original Message- > From: David H [mailto:[EMAIL PROTECTED]] > Sent: Monday, November 25, 2002 2:21 PM > To: [EMAIL PROTECTED] > Subject: [PHP] Form trouble > > > Hi, > > After I submited a query, if I use back then forward > again the form will resubmit itself. Which I do not > want. Does anyone have a solution for this problem? > > Thanks, > David > > __ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up > now. > http://mailplus.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > __ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Pear vs Phplib vs adodb
I'm looking to choose a set of library code principally for database functions. So far checked out Pear, Phplib and adodb which all appear to be well crafted and easy to use. Irrespective of differences in the actual functions provided (which of course are well documented) can anyone briefly compare and contrast them from experience working with 2 or more such libraries in a production environment in terms of robustness and speed (I appreciate that speed tests have put adodb top, then phplib and finally Pear, but have people found such differences to be very noticeable and if so under what specific circumstances?) Cheers, David Eisenhart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] need advice on template engine
Hi, Smarty is trully fantastic - relatively easy to learn and use and is very powerful. I used to use the phplib template engine which was also impressive but Smarty is much more sophisticated. Some great things about Smarty:- - site pages can be cached (can save masses of time if the server is having to re-create the same database backed pages) - a well written, extensive and thorough manual (a must if you are to use Smarty to its max) - the Smarty 'presentation' code resides with the html and is consequently separated from the php code . This may be said by some to be a bad thing as the point of the such template engines is to separate the html from programming code; however I have found that in the case of phplib templates (and no doubt many other template engines) html was, by necessity, finding its way into the programming code and also the code to manage the generate the templates could become quite bulky. Smarty is practically and conceptually more elegant in that it separates 'all presentation related code' (html and smarty constructs) and logic (ie. your php), what's more, the actual lines of code that I have to write is reduced as a result. Hope that this convinces you to give Smarty a go, David Eisenhart > http://smarty.php.net seems polular > > J > > > on 04/12/02 12:40 AM, Alexander A. Savenkov ([EMAIL PROTECTED]) wrote: > > > Hi PHP. > > > > Suggest me which template engine is more popular? > > I try select engine for me but I alredy become involved in that > > number different version > > > > > > Alexander A. Savenkov > > System Administrator > > mailto:[EMAIL PROTECTED] > > JSC "Terminal GMB" > > http://www.terminalgmb.ru > > > > Justin French > > http://Indent.com.au > Web Development & > Graphic Design > > "Alexander A. Savenkov" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi Justin. > > > JF> http://smarty.php.net seems polular > > It seems to me too > but i thick may be I can miss smthng important > > > > Alexander A. Savenkov > System Administrator > mailto:[EMAIL PROTECTED] > JSC "Terminal GMB" > http://www.terminalgmb.ru > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help on OOP
> if anyone can suggest the best tutorial on OBJECTS and CLASSES, I'll be grateful. for a very well written treatment (albeit no tutorials) of most things PHP (including OOP) I'd recommend O'Reilly's book Programming PHP (by Rasmus Lerdorf and Kevin Tatroe). David Eisenhart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help Please
I can think of a couple of ways to tackle this: 1) The purest way is to do with your database design - a typical order processing database will contain a table for products, a table for customers, a table for orders, a table for order lines and so on ... If this is implemented correctly (ie the tables are correct) you should be able to do an grouping and aggregate type query on the order line table that will return the number of any particular product sold and from there you can apply the correct price. You'll need to understand relational database design to do this yourself (a v good topic to know if you're doing much in the way of database backed sites anyway). The O'Reilly Book Web Database Design with Php and MySQL uses a wine order processing application as a running example throughout (although this appears to be principally about using Php with MySQL rather than database design itself it may be worth checking out) 2) More along the lines of your suggestion below you can use the MySQL '+' operator .Every time you sell an item you can run an update query which goes something like:- UPDATE table_name SET num_of_items_sold_field= (num_of_items_sold_field + 1) WHERE product_id_field = the_product_id You can then use the value in 'num_of_items_sold_field' to determine product price. You may want to check out the MySQL list as the issue appears to be principally a database rather than a php one. If at all possible I would advocate the first approach - a properly designed database will generally always pay divis in the long run. Hope that this helps. David Eisenhart "Spiderwebb" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > From: "SpiderWebb" <[EMAIL PROTECTED]> > Subject: Help nedded > Date: 09 December 2002 16:46 > > I dont know if this is possible in PHP (Newbie) im working on a project > where each product has 3 diffierent prices depending on the amount sold so > say for example 1- 100 price A 101-299 price B and above 300 Price C. What > I need to be able to do is increment an mysql database field each time an > item is sold then look at that field to decide which price variable to write > to the price field of the database. Could someone point me in the right > direction where I could solve this or to someone who could > > Thanks in advance. > Spiderwebb > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help please: Unable to get $_POST["variable"]; to work in a form.
I am going through the introductory tutorial on http://www.php.net/ and am stuck on this page: http://www.php.net/manual/en/tutorial.forms.php I have been able to get all of the examples up to this point to work. The form is simple: it asks for a text "name", a text "age" and has a submit button. The information is submitted to action.php. Action.php contains this code: Hi . You are years old. I saved action.php as a text file with only the information above. When I enter JoeBob into the name field and 27 into the age field, I get this for output: Hi Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1 . You are Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2 years old. What can I do to remedy this? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.
This is the exact code in the HTML file: PHP Form Example Your name: Your age: I believe that is using the method POST. If there is something wrong in the HTML file, or if you have any other suggestions, then please let me know. "Hacook" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Make sure your form is sent through the method="POST" > > "David Scott" <[EMAIL PROTECTED]> a écrit dans le message de news: > [EMAIL PROTECTED] > > I am going through the introductory tutorial on http://www.php.net/ and am > > stuck on this page: > > http://www.php.net/manual/en/tutorial.forms.php > > > > I have been able to get all of the examples up to this point to work. > > > > The form is simple: it asks for a text "name", a text "age" and has a > submit > > button. The information is submitted to action.php. > > > > Action.php contains this code: > > Hi . > > You are years old. > > > > I saved action.php as a text file with only the information above. > > > > When I enter JoeBob into the name field and 27 into the age field, I get > > this for output: > > Hi > > Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1 > > . You are > > Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2 > > years old. > > > > What can I do to remedy this? > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.
Using $_REQUEST["variable"] causes the script to work. Why is this? And, why can I not use $_POST? "David Scott" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am going through the introductory tutorial on http://www.php.net/ and am > stuck on this page: > http://www.php.net/manual/en/tutorial.forms.php > > I have been able to get all of the examples up to this point to work. > > The form is simple: it asks for a text "name", a text "age" and has a submit > button. The information is submitted to action.php. > > Action.php contains this code: > Hi . > You are years old. > > I saved action.php as a text file with only the information above. > > When I enter JoeBob into the name field and 27 into the age field, I get > this for output: > Hi > Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1 > . You are > Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2 > years old. > > What can I do to remedy this? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Help please: Unable to get $_POST["variable"]; to work in a form.
I have corrected the typo and had hoped this was a simple solution, yet $_POST still doesn't work. Any ideas? "Craig Thomas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Using $_REQUEST[""] works because the vars are in the http request, but > $_POST[""] contains nothing as the other poster noted: mehtod="post" > > >>-Original Message- > >>From: David Scott [mailto:[EMAIL PROTECTED]] > >>Sent: Tuesday, December 10, 2002 1:20 PM > >>To: [EMAIL PROTECTED] > >>Subject: [PHP] Re: Help please: Unable to get $_POST["variable"]; to > >>work in a form. > >> > >> > >>Using $_REQUEST["variable"] causes the script to work. > >>Why is this? And, why can I not use $_POST? > >> > >>"David Scott" <[EMAIL PROTECTED]> wrote in message > >>[EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >>> I am going through the introductory tutorial on > >>http://www.php.net/ and am > >>> stuck on this page: > >>> http://www.php.net/manual/en/tutorial.forms.php > >>> > >>> I have been able to get all of the examples up to this point to work. > >>> > >>> The form is simple: it asks for a text "name", a text "age" and has a > >>submit > >>> button. The information is submitted to action.php. > >>> > >>> Action.php contains this code: > >>> Hi . > >>> You are years old. > >>> > >>> I saved action.php as a text file with only the information above. > >>> > >>> When I enter JoeBob into the name field and 27 into the age field, I get > >>> this for output: > >>> Hi > >>> Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1 > >>> . You are > >>> Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2 > >>> years old. > >>> > >>> What can I do to remedy this? > >>> > >>> > >> > >> > >> > >>-- > >>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] Thank you all for your help.
I corrected the typo and and $_POST works correctly now. I don't know why it didn't work the first time I corrected the typo (I think that I had to re-publish my web site or somesuch), nonetheless it is working now. Thank you all. "David Scott" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am going through the introductory tutorial on http://www.php.net/ and am > stuck on this page: > http://www.php.net/manual/en/tutorial.forms.php > > I have been able to get all of the examples up to this point to work. > > The form is simple: it asks for a text "name", a text "age" and has a submit > button. The information is submitted to action.php. > > Action.php contains this code: > Hi . > You are years old. > > I saved action.php as a text file with only the information above. > > When I enter JoeBob into the name field and 27 into the age field, I get > this for output: > Hi > Notice: Undefined index: name in c:\inetpub\wwwroot\action.php on line 1 > . You are > Notice: Undefined index: age in c:\inetpub\wwwroot\action.php on line 2 > years old. > > What can I do to remedy this? > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Editor Browser View? (Beginner Question)
If your local machine is running Windows you could also use Personal Web Server or IIS (whichever comes with your Windows) for the web server (of course you will also need a local copy of php, but this is very easy to set up) David Eisenhart "Ubergoober" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > You might consider downloading a package like foxserve > (http://sourceforge.net/projects/foxserv) for your system. This is an > apache/php bundle that will allow you to test your code from a local > instance of php. > > > "Paul Lazare" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > A Company Programmed my Homepage in PHP. Now I want to make simple changes > > like changing some text. And I want to try it alone, so I got myselv > > PHPEdit. > > > > I copied the complete Homepage on my harddisc to work on it tiht PHP Edit > > and everthing works fine. > > > > But how can I see the result of the changes (without uploading it the > > provider again)? > > > > I allready tried to click on "new browser" and it is opening an empty > > browser... > > > > sorry for the beginner question. Am I in the right newgroup for this > > question? > > > > greetings, paul > > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php