[PHP] PHP, MySQL & multiple commands??
I'd like to be able to run a mysql_query() once while executing more than one mysql command... for example: while($row = mysql_fetch_array($result)) { $query_cmd = "INSERT INTO tblTest1 (number) VALUES (1);"; $query_cmd .= "INSERT INTO tblTest2 (id, val) VALUES(LAST_INSERT_ID, 'some data');"; mysql_query($query_cmd); } When I run code similar to that listed above, I get a mysql error "error at line 1." -- however, if I run the INSERTS separately -- no error. Is there a way I can run multiple commands within one string? Thanks Jason -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to defeat winroute [proxy]?
Hi. I've tried this: header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-control: private"); header("Cache-control: no-cache"); header("Cache-control: no-store"); header("Cache-control: must-revalidate"); header("Cache-control: proxy-revalidate"); header("Cache-control: max-age=0"); header("Pragma: no-cache"); session_cache_limiter('private, must-revalidate'); ( and session_cache_limiter('nocache') ) But it doesn't work - winroute cache everything. Does anyone know any solution? -- Best regards, Evgeny mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Problem with HTTP_POST_VARS
Duh! Thanks guys that's what I was missing. -Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 8:33 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Problem with HTTP_POST_VARS put a $ before HTTP_POST_VARS be: $Agree_to_Terms_of_Membership=$HTTP_POST_VARS["Agree_to_Terms_of_Membership" ]; Op vrijdag 26 juli 2002 02:29, schreef u: > Hello, > > I'm trying to do a simple form for a local organization and I'm running > into problems with the server. I am unable to get any of the variables in > the html code to post across to the php file. So, I'm figuring > register_globals is off. So I change my code to use HTTP_POST_VARS and > HTTP_GET_VARS and get this error: > > Parse error: parse error in > /usr/local/etc/httpd/vhosts/htdocs/scripts/join.php on line 3 > > Here is a snippet of the first few lines of my code: > > > > $Agree_to_Terms_of_Membership = > HTTP_POST_VARS["Agree_to_Terms_of_Membership"]; > $realname = HTTP_POST_VARS["realname"]; > $Company_Name = HTTP_POST_VARS["Company_Name"]; > $Description = HTTP_POST_VARS["Description"]; > $Street_Address = HTTP_POST_VARS["Street_Address"]; > > I did a phpinfo and their ISP is running PHP Version 4.0B2 and I can see > track_vars is on. > > What is going on here? Any suggestions as to what I'm doing wrong? > > Thanks. > > Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with HTTP_POST_VARS
You missed the $ before HTTP_POST_VARS. its $HTTP_POST_VARS (its a variable, not a constant. only constants dont have a $ before them) Jason Reid [EMAIL PROTECTED] -- AC Host Canada www.achost.ca - Original Message - From: "bob" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 6:29 PM Subject: [PHP] Problem with HTTP_POST_VARS > Hello, > > I'm trying to do a simple form for a local organization and I'm running into > problems with the server. I am unable to get any of the variables in the > html code to post across to the php file. So, I'm figuring register_globals > is off. So I change my code to use HTTP_POST_VARS and HTTP_GET_VARS and get > this error: > > Parse error: parse error in > /usr/local/etc/httpd/vhosts/htdocs/scripts/join.php on line 3 > > Here is a snippet of the first few lines of my code: > > > > $Agree_to_Terms_of_Membership = > HTTP_POST_VARS["Agree_to_Terms_of_Membership"]; > $realname = HTTP_POST_VARS["realname"]; > $Company_Name = HTTP_POST_VARS["Company_Name"]; > $Description = HTTP_POST_VARS["Description"]; > $Street_Address = HTTP_POST_VARS["Street_Address"]; > > I did a phpinfo and their ISP is running PHP Version 4.0B2 and I can see > track_vars is on. > > What is going on here? Any suggestions as to what I'm doing wrong? > > Thanks. > > Rob. > > > -- > 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] Problem with HTTP_POST_VARS
Hello, I'm trying to do a simple form for a local organization and I'm running into problems with the server. I am unable to get any of the variables in the html code to post across to the php file. So, I'm figuring register_globals is off. So I change my code to use HTTP_POST_VARS and HTTP_GET_VARS and get this error: Parse error: parse error in /usr/local/etc/httpd/vhosts/htdocs/scripts/join.php on line 3 Here is a snippet of the first few lines of my code: http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] pdflib, NEED HELP with function problem (newby)
Hello, Using php v 4.2.2 with pdflib support, on apache v. 1.3, and redhat linux 7.2. I for some reason can not get a pdf_setfont, pdf_set_text_pos, pdf_[anything], to work inside a function. What is going on. All the pdf extensions work find as long as I dont try to use them inside a function that I create. ie: PDF_set_text_pos($p, 80, 670); PDF_show($p, "Requirements:"); works just fine outside of a function but if I put the same thing inside a function like so function help() { PDF_set_text_pos($p, 80, 670); PDF_show($p, "Test:"); } I will not get Test text to display inside the PDF document, If I change this, so that I add a position to it, like so: function help($position_y) { PDF_set_text_pos($p, 80, $position_y); PDF_show($p, "Test:"); } I get this error: Warning: pdf_set_text_pos(): supplied argument is not a valid pdf object resource in /var/www/html/form/test.php on line 16 What am I doing wrong? Jeff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New way to make select boxes auto select
i used the same techniqu a while back when i worked with Fast Template. scenario: - present a user with a form to input - there are several text fields and several select options - if there is/are error(s) upon form submission, we will call the same template file and insert proper error messages at appropriate places, normally close to the input field. - we would also luv to make the select option field to DEFAULT to the PREVIOUS value that WAS selected. with the technique that Nathan describe below, you can do just that. At present i have dropped this technique as I have switched to Smarty. Smarty can do all this with its {html_optios blah blah blah}. Recently I made frequent use of Webreference javascript to make select boxes that are related to each other. ie changing(selecting) a left select box would make a right select box change accordingly. I am trying to apply Smarty to this but my javascript knowledge is too shallow. after submitting a form with errors, the 2 select boxes will default back when the script starts. which is NOT what i want. if nebody have done this, appreciate your help. -- roger --- Nathan Cook <[EMAIL PROTECTED]> wrote: > You may already be doing it like this, but I think I found a new way to > make select boxes auto-select (what data they put in) a lot easier. All you > have to do is put a variable in each select tag that is equal to the value > of the select option i.e.: -- then all you > have to do is base the variable on that $$interest = > "selected"; quick and easy with out having to loop through an if elseif > statement. Let me know if you like that method or have any objections. > > Full example below. > > print("\n"); > // creates a variable with a name based on > // the value of interest with a value of "selected" > $$interest = "selected"; > print("- Select One -\n"); > print("Teacher\n"); > print("Lego Enthusiast\n"); > print("Student\n"); > print("Homeschool Parent\n"); > print("Browsing\n"); > print("Afterschool\n"); > print("Boys & Girls Club\n"); > print("YMCA\n"); > print(" \n"); > > [ Nathan Cook | [EMAIL PROTECTED] ] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > __ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Selecting databases
You need to look at mysql_list_dbs(), this returns an array of all available databases on a connection. -- MGS2 Online http://www.mgs2online.f2s.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] install issues on Solaris
> In article <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] > says... > > ok unix.h problem solved but now it's saying can't locate > .libs/libZend.a > > any ideas? > > > > > > Furrfu - don't tar all *nix with the same brush :-) Presumably, for some > reason, that file hasn't been created? Have a look in the libs directory > under your tarball extraction directory; but perhaps the few lines out of > make output prior to the error might be useful? the last few lines of the make are as follows: . . . . . . zend_sprintf.lo `test -f zend_sprintf.c || echo './'`zend_sprintf.c /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_ini.lo `test -f zend_ini.c || echo './'`zend_ini.c /bin/sh ../libtool --silent --mode=compile gcc -DHAVE_CONFIG_H -I. -I. -I../mainzend_qsort.lo `test -f zend_qsort.c || echo './'`zend_qsort.c /bin/sh ../libtool --silent --mode=link c -g -O2 -prefer-non-pic -static -o.lo zend_ini_scanner.lo zend_alloc.lo zend_compile.lo zend_constants.lo zend_dyn.lo zend_opcode.lo zend_operators.lo zend_ptr_stack.lo zend_stack.lo zend_variabndent.lo zend_builtin_functions.lo zend_sprintf.lo zend_ini.lo zend_qsort.lo -ld ../libtool: ar: not found make[1]: *** [libZend.la] Error 1 make[1]: Leaving directory `/usr/local/php-4.2.2/Zend' make: *** [all-recursive] Error 1 Cheers Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] slow reading from socket
Hi I am building (or attemting to build) an msn messenger class. I am having problems reading from the socket. I open a connection with fsockopen(), i then write commands to the socket with fputs(). I am reading wth fgets(). It is all fine if I am reading one line returned by the server, the script runs quickly. However is i wish to read multiple lines the script basically stops. I am working with code like this to read multiple lines... fp; $this->response = ''; while($line = fgets($fp, 1024)) { $this->response .= $line; } return $this->response; } ?> I think it may be geting into an infinite loop. With nntp protocol you can test for a fullstop and then stop reading, does anyone know if there is somthing like this in msn messenger protocol? has anyone else had this problem. I rewrote the class using the socket functions such as socket_create(), socket_connect() and socket_read() but had the same problems. Is it a problem with my code or is it somthing to do with the way the server is working? help me! Thanks, Mike -- MGS2 Online http://www.mgs2online.f2s.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Need regular match help - possibly
Hi > for the first case - using "\n", try : >ereg_replace('\n+', '\n\n\n', $str) This is right, apart from the fact that \n characters will no be parsed with single quotes. Try this... Sorry, just a minor thing. Mike -- MGS2 Online http://www.mgs2online.f2s.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reg exp to remove line feeds before lines starting with white space
> On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote: > > > > In order to read the headers into an array of header key/value fields > > i would like a reg exp to remove all new lines/line feeds before a > > line starting with one or more white spaces or tabs. Pardon my prior post. I only saw "how to remove new lines/line feeds" and not the second part of the sentence "before a line starting with one or more white spaces or tabs." preg_replace('/[\r\n]+[ \t]+/', ' ', $header); --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD Library for Windows
It comes with the zip file of that distribution - and it works fine (except for TTF which I can't for the life of me get to work on Win32) frak! "Peter" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Jadiel, > > i do that the file ur after and tried sending it to u but ur server rejected > it. > > > -Original Message- > > From: Jadiel Flores [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, 24 July 2002 9:03 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP] GD Library for Windows > > > > > > I'm trying to develop a thumbnail creation module for a website > > but I can't > > get gd library to work in a Win2000 Advanced Server, PHP 4.2.1, IIS 5. > > > > Does anybody has the php_gd.dll for this version?? > > > > Thanks. > > > > > > Jadiel Flores > > - > > http://www.abargon.com > > [EMAIL PROTECTED] > > (52-55) 52-29-80-34 > > > > > > > > -- > > 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] Help invoking a regexp
Hi I have this regular expression: (((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|www\.[-a-z0-9.]+)[^ .,;\t<">\):] Which is supposed to match hyperlinks. I would like to use this from php to grab all hyperlinks in a text file and return them in an array. I've messed around with the function preg_match_all() but I just can't seem to get it to work. Any suggestions would be very appreciated. Thanks, Nicklas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reg exp to remove line feeds before lines starting withwhite space
On Thu, 25 Jul 2002, Nicklas af Ekenstam wrote: > I'm trying to do some parsing of mail headers and since not all > headers follow the pattern: > > X-Header-A: A string > X-Header-B: Another string that is longer > X-Header-C: And this string is very very long compared > > But may very well look like this: > > X-Header-A: A string > X-Header-B: Another string that is > longer > X-Header-C: And this string is very very long > compared I imagine you want something like (untested): $str = preg_replace('/\n[ \t]+/s', ' ', $str); miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Parse error - new set of eyes?
> elseif ((!isset($HTTP_SESSION_VARS['clk']) || > (!isset($HTTP_SESSION_VARS['holy_cow']) || > (!isset($HTTP_SESSION_VARS['ipaddy']) || (!isset($HTTP_SESSION_VARS['a'])) Your parenthesis don't match up, if I can count correctly today. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error - new set of eyes?
Ok, I noticed a couple things. One: There's no } ending your elseif statement. Two (and the big one): Why all the opening brackets before your isset() functions? I'm not sure if you're trying to do some nested logic in there, but if so it will be much more readable if you use nested if statements instead of a single huge statement. If you quickly count you'll see that you've got 8 opening brackets and only 5 closing ones. That's where your problem lies. At 02:40 PM 7/25/2002 -0600, you wrote: >I am getting a parse error on line 14, I am trying to make sure session vars >are being set before rendering the page. This is lines 12,13,14 & 15. Any >help is appreciated. >Jas > >if ((!$u_name) || (!$p_word)){ > header("Location: index.php"); > session_destroy(); > exit; } >/* Check for missing session vars */ >elseif ((!isset($HTTP_SESSION_VARS['clk']) || >(!isset($HTTP_SESSION_VARS['holy_cow']) || >(!isset($HTTP_SESSION_VARS['ipaddy']) || (!isset($HTTP_SESSION_VARS['a'])) { > /* Begin logging of client info to database table since session vars are >not present */ > require '/path/to/connection/class/db.php'; > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_match() occurence position
On Thu, 25 Jul 2002, lallous wrote: > Yes, I'm aware of the strpos() or any other non-regexp string functions... > > but it is either I use regexp to match a certain pattern or I'll have to > write a char-by-char parser to emulate regexp searching and yet get the > position of the occurence! Once you have found the matching string with preg_match, you can use strpos() to see where it was. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] pdf to html
On Thu, 25 Jul 2002, David Buerer wrote: > I can think of many reasons why displaying the pdf in the browser is a last > resort and not a first resort. Especially in situations where the reader is > not installed. > > Like Tyler, I would be quite interested to see if anyone has any ideas on > how to convert from pdf to html. It's exceptionally difficult if you want to preserve the graphics. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: timestamp triggered only on update?
hehe.. ofcourse i ment: ...this will trigger both on insert and update. "Ragnar" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Maybe the wrong forum, but im giving it a try. > > Im used to for instance 2 columns in each table indicating when it was > created and when it was last updated: > > Changed_date > Registered_date > > In mysql it seems it is only possible to define a column as a timestamp, and > this will trigger both on insert and delete. Is it possible to define > changed_date to trigger only on update in mysql or do i have do give the > correct timestamp "manually" from php? > > Thanx > > -R > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: secure sockets
Josh Levine wrote: > Warning: fsockopen(): no SSL support in this build in > /usr/home/research/htdocs/tests/secure2.php4 on line 6 > > I did include OpenSSL support...is there something else I need to > include? Nevermind, I just re-built it from scratch again and it worked. Now I'm just having trouble matching cipher suites, but I think that's more of a Java thing than a PHP thing. --Josh Levine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MSDE with PHP 4
Hi, Has anyone used PHP alongside MSDE? I've recently taken a brief look at freetds which allows a UNIX/LINUX box to talk to an MSSQL/SYBASE server, but I cannot find any metion of MSDE. Can anyone shed any light on this or report any successes? Cheers Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: timestamp triggered only on update?
I believe MySQL will only automatically update one TIMESTAMP field per record, according to their online docs. It will update if you don't specify a value when inserting a new record. You can also use the DATETIME field type which stores data as -MM-DD HH:MM:SS. This is what I use because it's easier to read by humans. Date and time are inserted into all DATETIME fields in a record automatically when set to allow NULL. You can then easily convert this to a Unix timestamp easily using the MySQL UNIX_TIMESTAMP() function when doing a query. PHP also has similar date/time conversion commands. I'm not a MySQL expert, so, the above my not be totally accurate, it's based on my own experience. Monty > From: [EMAIL PROTECTED] (Ragnar) > Organization: na > Reply-To: "Ragnar" <[EMAIL PROTECTED]> > Newsgroups: php.general > Date: Fri, 26 Jul 2002 00:19:02 +0200 > To: [EMAIL PROTECTED] > Subject: timestamp triggered only on update? > > Maybe the wrong forum, but im giving it a try. > > Im used to for instance 2 columns in each table indicating when it was > created and when it was last updated: > > Changed_date > Registered_date > > In mysql it seems it is only possible to define a column as a timestamp, and > this will trigger both on insert and delete. Is it possible to define > changed_date to trigger only on update in mysql or do i have do give the > correct timestamp "manually" from php? > > Thanx > > -R > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] timestamp triggered only on update?
Maybe the wrong forum, but im giving it a try. Im used to for instance 2 columns in each table indicating when it was created and when it was last updated: Changed_date Registered_date In mysql it seems it is only possible to define a column as a timestamp, and this will trigger both on insert and delete. Is it possible to define changed_date to trigger only on update in mysql or do i have do give the correct timestamp "manually" from php? Thanx -R -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Paying Job...
> Do you charge by the page, script or by the hour (that would > be nice). We do this sort of thing in, basically, one of three ways... 1. Client gives us a budget and we give them a clear idea of what that budget will get them. 2. Client gives us a good idea of what they want to achieve and we provide a quote to get them there. 3. Client gives us all the content they have and we go to it and write an invoice for our work when we are done. Number 3 is pretty rare. For 1 and 2 we always get approvals on the work as we go and we always work to the budget that we've got (either from their end or from our quoute). Documenting what is covered within the quote is important so that you have a way to increase the invoice if the client comes back asking for added features that were not originally included. We've found that most clients like the idea of a fixed fee so they know what they are up for. The key to doing this is to make sure that you don't end up losing out by not making clear what that money will buy. CYA, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unset array here?
On Thu, Jul 25, 2002 at 10:26:03PM +0200, Bas Jobsen wrote: > Hello, > > I have this example code: > function doprint($a){foreach($a as $value)echo $value;} > doprint(array('1','test','hello','and')); > > Question, is the array in memory after the function call? > So, should it be better to use this: > > function doprint($a){foreach($a as $value)echo $value;} > doprint($temp=array('1','test','hello','and')); > unset($temp); Depends on the scope you're talking about. The first way doesn't set the array into memory outside the function, but it goes into memory inside the function as $a. The second way puts it into memory twice, first as $temp and second as $a. Now, I'm not certain of what happens to your memory allocation inside the function. I don't believe PHP automatically cleans up memory under such circumstances. If I'm correct and you want to keep memory down, you could do an unset() INSIDE the function. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Parse error - new set of eyes?
Hi: On Thu, Jul 25, 2002 at 02:40:28PM -0600, Jas wrote: > I am getting a parse error on line 14, I am trying to make sure session vars > are being set before rendering the page. This is lines 12,13,14 & 15. The way you posted it here, it's hard to tell which line is which. Layout your script the same way it will look in your email, then run it. More importantly, we need to see the error message. There are TONS of different parse errors that can happen. Plus, I bet if you read the message, and THINK about what it says, it'll give you a clue what to look for. > if ((!$u_name) || (!$p_word)){ Use empty($var) rather than (!$var) to avoid warnings where the var isn't even set. > header("Location: index.php"); Location needs a full URI: http://www.foo.com/index.php. But, I don't think any of those will produce parse errors. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: two php.ini on windows????
Yep, it's CGI! It's compiled in binary with the force-cgi-redirect enabled. Need to turn this off in PHP since I'm using IIS, not apache. It's not working very well but at least, running websites with different php versions work well. THanks "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Yea, I recently put them into 2 different directories. I'm doing the > research on cgi vs. isapi right now. Anyway, I create a test site and it > showed up okay, got the error message about the security-alert, something > about the cgi that can not be accessed directly. My impression is that they > are working. Just need to modify the php.ini or something. > > Thanks! > "Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Christoph Grottolo wrote: > > > If you use cgi, no problem, just put the php.ini into the php > > > directory (instead of the windows directory). This works. > > > > > > sorry, forgot to write: > > put the different versions of php into different directories (i.e. > > c:\php\php421 and c:\php\php430) > > > > Christoph > > > > >> There are a couple of websites I had to move from one machine to this > > >> window machine and it introduced two new problems. There are two > > >> different version of PHP, however IIS can work with two different > > >> version of PHP without a problem. The 2nd problem is to have two > > >> different php.ini file from two different PHP version to work > > >> together. > > >> > > >> Have anyone experience this problem? What would be the best solution > > >> to the problem? Recommended Solution to the problem? Suggestion? > > >> Upgrading a couple of websites that use the old version of PHP is not > > >> an option right now. That would take way too long and there's not > > >> enough time for that right now. > > >> > > >> Thanks, > > >> FletchSOD > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] patch of php
Thanks! -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 4:13 PM To: Hong Tian Cc: [EMAIL PROTECTED] Subject: Re: [PHP] patch of php On Thu, 25 Jul 2002, Hong Tian wrote: >I download patch of php-4.2.0-to-4.2.2.patch.gz from http://www.php.net and >try to update our PHP 4.2.0 to 4.2.2. But I can't find instructions how to >update PHP by using this patch of php-4.2.0-to-4.2.2.patch.gz. Could anyone >tell me how to patch it or where can I find this information to update PHP >by this patch? gunzip php-4.2.0-to-4.2.2.patch.gz cd /path/to/php_source cat /path/to/php-4.2.0-to-4.2.2.patch |patch you might also try 'man patch' -- Greg Donald http://destiney.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: two php.ini on windows????
Yea, I recently put them into 2 different directories. I'm doing the research on cgi vs. isapi right now. Anyway, I create a test site and it showed up okay, got the error message about the security-alert, something about the cgi that can not be accessed directly. My impression is that they are working. Just need to modify the php.ini or something. Thanks! "Christoph Grottolo" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Christoph Grottolo wrote: > > If you use cgi, no problem, just put the php.ini into the php > > directory (instead of the windows directory). This works. > > > sorry, forgot to write: > put the different versions of php into different directories (i.e. > c:\php\php421 and c:\php\php430) > > Christoph > > >> There are a couple of websites I had to move from one machine to this > >> window machine and it introduced two new problems. There are two > >> different version of PHP, however IIS can work with two different > >> version of PHP without a problem. The 2nd problem is to have two > >> different php.ini file from two different PHP version to work > >> together. > >> > >> Have anyone experience this problem? What would be the best solution > >> to the problem? Recommended Solution to the problem? Suggestion? > >> Upgrading a couple of websites that use the old version of PHP is not > >> an option right now. That would take way too long and there's not > >> enough time for that right now. > >> > >> Thanks, > >> FletchSOD > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: I didnt understand the how work pathtovars, a php gpl script
I make my own : What u think about : begin "; echo "REQUEST_URI $REQUEST_URI "; echo "SCRIPT_NAME $SCRIPT_NAME "; echo "PATH_INFO $PATH_INFO "; echo "PATH_TRANSLATED $PATH_TRANSLATED "; // Array ( ) Array ( ) PHP_SELF /path2vars/index.php/var1,val1/var2,val2/ // REQUEST_URI /path2vars/index.php/var1,val1/var2,val2/ // SCRIPT_NAME /path2vars/index.php // PATH_INFO /var1,val1/var2,val2/ // PATH_TRANSLATED c:\\easyphp\\www\\var1,val1\\var2,val2\\ exit(); */ //phpinfo(); // we will transform vars from 1 style to 2 style // 1) http://localhost/path2vars/index.php?&var1=val1&var2=val2 en // 2) http://localhost/path2vars/index.php/var1,val1/var2,val2/ // that will permit a better crawls with web crawlers // from type 1) to type 2) function normurl2trans($url) { // we cut the url in 2 part 1 to keep and the other to manipulate $urldecoup = split($GLOBALS[SCRIPT_NAME],$url); $urldecoup[1] = str_replace('?&','&',$urldecoup[1]); // for easily progs $urldecoup[1] = strtr($urldecoup[1], '&=', '/,'); // map particulars chars return $urldecoup[0].$GLOBALS[SCRIPT_NAME].$urldecoup[1].'/'; } // from type 2) to type 1) function trans2norm($url) { // we cut the url in 2 part 1 to keep and the other to manipulate $urldecoup = split($GLOBALS[SCRIPT_NAME],$url); $urldecoup[1] = strtr($urldecoup[1],'/,','&='); // map particulars chars $urldecoup[1] = $urldecoup[0].$GLOBALS[SCRIPT_NAME].'?'.$urldecoup[1].'/'; return str_replace('&/','',$urldecoup[1]); // for easily progs } // little test unit for fonctions //echo normurl2trans ("http://localhost/path2vars/index.php?&var1=val1&var2=val2";); //echo trans2norm("http://localhost/path2vars/index.php/var1,val1/var2,val2/";); /* // the vars parser : // we make it here not in a fucntions for globals vars context // works at each case no vars 1 2 ... **/ $urltemp = str_replace($SCRIPT_NAME.'/','',$PHP_SELF); // get string to explode // gives var1,val1/var2,val2/ // we had to cut into with / $urldecoup = split('/',$urltemp); // gives Array ( [0] => var1,val1 [1] => var2,val2 [2] => ) $urltempsize = count($urldecoup)-1; // we dont treat the last elemnts that is empty for ($urltempi=0;$urltempi<$urltempsize;$urltempi++) { $nameval = split(',',$urldecoup[$urltempi]); // cut 2 elts var1,val1 ${$nameval[0]} = $nameval[1]; // affect $var1 with value val1 //$var1="val1"; } // end parse /* // little test unit echo "$var1"; echo "$var2"; */ /** here is a little query string parser to get work web crawlers url test : http://localhost/path2vars/index.php?&var1=val1&var2=val2";); echo "lien ni1"; echo $var1.''; echo $var2.''; ? **/ ?> =end cut Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suppressing errors
> > > $query = "select user_id from users where username='$username'"; > > > $query_db = @mysql_query($query, $db_connection); > > > $row = @mysql_fetch_array($query_db); > > > if($row) { > > > $message[] = "That username is already taken. Please select > > > another."; > > > } else { > The error is one from mysql stating that I am trying to add a duplicate > entry. I would rather handle this in my code hence the following lines in > my code. That error message wouldn't come from any of the lines above. You're not INSERTing anything, just SELECTing. Are you sure there isn't another mysql_query() somewhere else without an @ in front of it?? ---John Holmes... - Original Message - From: "Preston Wade" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 4:58 PM Subject: RE: [PHP] suppressing errors > The error is one from mysql stating that I am trying to add a duplicate > entry. I would rather handle this in my code hence the following lines in > my code. > > if($row) { > $message[] = "That username is already taken. Please select > another."; > } else { > > Thanks for the response. > > Thanks, > Preston > > > > -Original Message- > > From: "1LT John W. Holmes" <[EMAIL PROTECTED]>@INTERNET@HHC > > Sent: Thursday, July 25, 2002 2:53 PM > > To: Preston Wade; [EMAIL PROTECTED] > > Subject: Re: [PHP] suppressing errors > > > > What is the error you get? > > > > ---John Holmes... > > > > - Original Message - > > From: "Preston Wade" <[EMAIL PROTECTED]> > > To: <[EMAIL PROTECTED]> > > Sent: Thursday, July 25, 2002 3:20 PM > > Subject: [PHP] suppressing errors > > > > > > > Hello All, > > > > > > I am trying to use the "@" symbol to suppress errors returned by a > > > mysql_query call. This doesn't seem to be working as I get an new page > > with > > > the error in it in my browser. Any help with this would be greatly > > > appreciated. > > > > > > Here is a snippet of the code I am using > > > > > > $query = "select user_id from users where username='$username'"; > > > $query_db = @mysql_query($query, $db_connection); > > > $row = @mysql_fetch_array($query_db); > > > if($row) { > > > $message[] = "That username is already taken. Please select > > > another."; > > > } else { > > > > > > Thanks, > > > Preston > > > > > > > > > -- > > > 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] Re: two php.ini on windows????
Christoph Grottolo wrote: > If you use cgi, no problem, just put the php.ini into the php > directory (instead of the windows directory). This works. sorry, forgot to write: put the different versions of php into different directories (i.e. c:\php\php421 and c:\php\php430) Christoph >> There are a couple of websites I had to move from one machine to this >> window machine and it introduced two new problems. There are two >> different version of PHP, however IIS can work with two different >> version of PHP without a problem. The 2nd problem is to have two >> different php.ini file from two different PHP version to work >> together. >> >> Have anyone experience this problem? What would be the best solution >> to the problem? Recommended Solution to the problem? Suggestion? >> Upgrading a couple of websites that use the old version of PHP is not >> an option right now. That would take way too long and there's not >> enough time for that right now. >> >> Thanks, >> FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] suppressing errors
The error is one from mysql stating that I am trying to add a duplicate entry. I would rather handle this in my code hence the following lines in my code. if($row) { $message[] = "That username is already taken. Please select another."; } else { Thanks for the response. Thanks, Preston > -Original Message- > From: "1LT John W. Holmes" <[EMAIL PROTECTED]>@INTERNET@HHC > Sent: Thursday, July 25, 2002 2:53 PM > To: Preston Wade; [EMAIL PROTECTED] > Subject: Re: [PHP] suppressing errors > > What is the error you get? > > ---John Holmes... > > - Original Message - > From: "Preston Wade" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, July 25, 2002 3:20 PM > Subject: [PHP] suppressing errors > > > > Hello All, > > > > I am trying to use the "@" symbol to suppress errors returned by a > > mysql_query call. This doesn't seem to be working as I get an new page > with > > the error in it in my browser. Any help with this would be greatly > > appreciated. > > > > Here is a snippet of the code I am using > > > > $query = "select user_id from users where username='$username'"; > > $query_db = @mysql_query($query, $db_connection); > > $row = @mysql_fetch_array($query_db); > > if($row) { > > $message[] = "That username is already taken. Please select > > another."; > > } else { > > > > Thanks, > > Preston > > > > > > -- > > 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] Re: Sessions : overriding variable values
1) session_start() is not really required on any other pages beside the index.php because session_register take care of that for you. 2) It should work when you try session_register() on the index.php, use a makeup name, like session_register("user") then assign the data to it, like $user[username] = "whatever" & $user['password'] = "passwhatever". This is a simplier way and it does work. "Petre" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi > I am still battling alot with understanding how sessions work (don't > work in my case). > > Firstly: I am trying to find a reliable method for coding with sessions > that will work on basically any server and any browser; meaning no > cookies and passing the SID to all url's manually. > My app has the following ( amongst others) > index.php = login page with form and 2 fields (username / password), > session_start() > On the action page, I session_start() again, and then > session_register("username","password") and I don't need to give them > values as the form fields are called that and PHP generates them for me > (register_globals = on). > This works great, on ALL subsequent pages in the app, I can simply call > $username and $password, and it works. > > BUT, my app has alot of iterations, and now I'm battling to understand > how to change these session variables "on the fly" in a sensible manner; > in particular when it comes to forms that "generate" their own variables > on submit. > > It seems like my problem comes in that I can only set a session variable > once it "exists" , ie, on the action page, and then also, that the app > goes "backwards" allowing you to change your options, yet, when yuou do, > the variables does not contain the new variables. > > The fact that the app also doesn't have a specific "end" means I also > don't know where to place the session_destroy()... > > I have made 4 small pages to illustrate : > > index.php > -- -- > session_start(); > ?> > enctype="multipart/form-data"> > > > Username > > > > Password > > > > > > > > > -- -- > page2.php > -- -- >session_start(); > session_register("username","password"); > ?> > This is username: > This is password: > enctype="multipart/form-data"> > > > First Variable > > > > Second Variable > > > > > > > > > -- -- > page3.php > -- -- >session_start(); > session_register("first","second"); > ?> > This is username: > This is password: > This is first variable: > This is second variable: > To Page 2 > To Page 4 > -- -- > page4.php > -- -- >session_start(); > ?> > This is username: > This is password: > This is first variable: > This is second variable: > To Page 3 > -- -- > > Also, not sure if it is browser related, but on mine, I sometimes get 2x > SESSIONID= added to the end of the URL, even though I > clearly put it in once only... > > Am I missing the point here? > Plz help to make things clearer to me... > The only way I can get above scanario to work is to add the variable > manually to all the url's as I've been coding all along. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: two php.ini on windows????
If you use cgi, no problem, just put the php.ini into the php directory (instead of the windows directory). This works. If you use isapi, i think it's not possible, but i'm not shure. Christoph Scott Fletcher wrote: > Hi! > > There are a couple of websites I had to move from one machine to this > window machine and it introduced two new problems. There are two > different version of PHP, however IIS can work with two different > version of PHP without a problem. The 2nd problem is to have two > different php.ini file from two different PHP version to work > together. > > Have anyone experience this problem? What would be the best solution > to the problem? Recommended Solution to the problem? Suggestion? > Upgrading a couple of websites that use the old version of PHP is not > an option right now. That would take way too long and there's not > enough time for that right now. > > Thanks, > FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: two php.ini on windows????
Are you using the CGI executable or the server plug in thingy? If you're using one of each, the server module looks for C:\windows\php.ini and the executeable looks for php.ini in the same directory as the executeable. If you have two CGI versions, you could rename one and rename its php.ini accordingly i.e. php4.exe and php4.ini but I don't know if this would work. There is something in the help (CHM version anyway) about running PHP3 and PHP4 together but PHP3 didn't have the server extensions did it? "Scott Fletcher" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Hi! > > There are a couple of websites I had to move from one machine to this window > machine and it introduced two new problems. There are two different version > of PHP, however IIS can work with two different version of PHP without a > problem. The 2nd problem is to have two different php.ini file from two > different PHP version to work together. > > Have anyone experience this problem? What would be the best solution to the > problem? Recommended Solution to the problem? Suggestion? Upgrading a > couple of websites that use the old version of PHP is not an option right > now. That would take way too long and there's not enough time for that > right now. > > Thanks, > FletchSOD > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Parse error - new set of eyes?
I had experienced similar problem like that in the past. Part of it had to do with the header() function. Your script checked out fine, just like mine did. Try remarking the line of code where hte header is and see if you don't have hte parse error, if this is the case then it's the header(). "Jas" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am getting a parse error on line 14, I am trying to make sure session vars > are being set before rendering the page. This is lines 12,13,14 & 15. Any > help is appreciated. > Jas > > if ((!$u_name) || (!$p_word)){ > header("Location: index.php"); > session_destroy(); > exit; } > /* Check for missing session vars */ > elseif ((!isset($HTTP_SESSION_VARS['clk']) || > (!isset($HTTP_SESSION_VARS['holy_cow']) || > (!isset($HTTP_SESSION_VARS['ipaddy']) || (!isset($HTTP_SESSION_VARS['a'])) { > /* Begin logging of client info to database table since session vars are > not present */ > require '/path/to/connection/class/db.php'; > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Parse error - new set of eyes?
I am getting a parse error on line 14, I am trying to make sure session vars are being set before rendering the page. This is lines 12,13,14 & 15. Any help is appreciated. Jas if ((!$u_name) || (!$p_word)){ header("Location: index.php"); session_destroy(); exit; } /* Check for missing session vars */ elseif ((!isset($HTTP_SESSION_VARS['clk']) || (!isset($HTTP_SESSION_VARS['holy_cow']) || (!isset($HTTP_SESSION_VARS['ipaddy']) || (!isset($HTTP_SESSION_VARS['a'])) { /* Begin logging of client info to database table since session vars are not present */ require '/path/to/connection/class/db.php'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] two php.ini on windows????
Hi! There are a couple of websites I had to move from one machine to this window machine and it introduced two new problems. There are two different version of PHP, however IIS can work with two different version of PHP without a problem. The 2nd problem is to have two different php.ini file from two different PHP version to work together. Have anyone experience this problem? What would be the best solution to the problem? Recommended Solution to the problem? Suggestion? Upgrading a couple of websites that use the old version of PHP is not an option right now. That would take way too long and there's not enough time for that right now. Thanks, FletchSOD -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] unset array here?
Hello, I have this example code: function doprint($a){foreach($a as $value)echo $value;} doprint(array('1','test','hello','and')); Question, is the array in memory after the function call? So, should it be better to use this: function doprint($a){foreach($a as $value)echo $value;} doprint($temp=array('1','test','hello','and')); unset($temp); Thanks, Bas -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: GD Library
Instead of : ;extension=php_gd.dll Try: extension=php_gd.dll Sign ; is a comment... so you must delete it ... -- Lp, Mitja "Ryan Moore" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > I am trying to use GD Library on a windows 2000 installation of PHP. > php_gd.dll is in the extensions folder and the line: ";extension=php_gd.dll" > is in my php.ini file, but I recieve the error: "Fatal error: Call to > undefined function: imagecreate()" when I try to use the > imagecreate(100,100) function. Any ideas? > > Thanks! > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] patch of php
On Thu, 25 Jul 2002, Hong Tian wrote: >I download patch of php-4.2.0-to-4.2.2.patch.gz from http://www.php.net and >try to update our PHP 4.2.0 to 4.2.2. But I can't find instructions how to >update PHP by using this patch of php-4.2.0-to-4.2.2.patch.gz. Could anyone >tell me how to patch it or where can I find this information to update PHP >by this patch? gunzip php-4.2.0-to-4.2.2.patch.gz cd /path/to/php_source cat /path/to/php-4.2.0-to-4.2.2.patch |patch you might also try 'man patch' -- Greg Donald http://destiney.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mySQL Queries using PHP's SESSION variables
On Thu, Jul 25, 2002 at 02:51:13PM -0400, Anup wrote: > Hello, I am stuck here. In the name of efficiency I want to lower the number > of callls to the database. So I am trying to give the most stringent query > possible. This is the problem: I have stored the surfers shopping cart, > where each item is stored as a session variable.Now on the database I have > ALL inventory items, but I want to only display the details of what the user > has in his cart. > eg. : I want something like this: > > $result = mysql_query("SELECT * from Inventory where ItemNumber is in > $HTTP_SESSION_VARS"); Other folks have made suggestions, but this is way simpler. Assuming the session vars and ItemNumber are numbers: $result = mysql_query('SELECT * from Inventory where ItemNumber IN (' . implode(',', $_SESSION) . ')'); If it's strings: $result = mysql_query("SELECT * from Inventory where ItemNumber IN ('" . implode("','", $_SESSION) . "')"); --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reg exp to remove line feeds before lines starting with white space
On Thu, Jul 25, 2002 at 12:36:27PM +0200, Nicklas af Ekenstam wrote: > > In order to read the headers into an array of header key/value fields > i would like a reg exp to remove all new lines/line feeds before a > line starting with one or more white spaces or tabs. In ereg_replace() you can use [[:space:]] as the pattern and replace it with ' '. That will grab all whitespace characters and replace them with a one space. To do that with preg_replace() use \s. --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] suppressing errors
What is the error you get? ---John Holmes... - Original Message - From: "Preston Wade" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 3:20 PM Subject: [PHP] suppressing errors > Hello All, > > I am trying to use the "@" symbol to suppress errors returned by a > mysql_query call. This doesn't seem to be working as I get an new page with > the error in it in my browser. Any help with this would be greatly > appreciated. > > Here is a snippet of the code I am using > > $query = "select user_id from users where username='$username'"; > $query_db = @mysql_query($query, $db_connection); > $row = @mysql_fetch_array($query_db); > if($row) { > $message[] = "That username is already taken. Please select > another."; > } else { > > Thanks, > Preston > > > -- > 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] For all those trying to compile PHP 4.2.x with Apache 2.0.39 !!!!!
This will allow you to compile PHP 4.2.x as a shared object into Apache 2.0.39. Credits to somebody on Google Groups (I can't recall, but I needed an answer to this too a couple weeks back)... 1. Open up the file php_functions.c in /sapi/apache2filter/ 2. Change MODULE_MAGIC_AT_LEAST to AP_MODULE_MAGIC_AT_LEAST (Note the addition of "AP_") 3. Save the php_functions.c file and try running configure again Keep in mind this is experimental and thus should not be used on production web sites (even though we've been using Apache 2.0.39+PHP 4.2.1/4.2.2 for a few weeks without issues on two of our servers). -- Aaron Gould [EMAIL PROTECTED] Web Developer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] String Manipulation
>Wow, Thank you for the explanation, it helped out a lot ;) >I don't know regex very well, but I hope that this will give me a better >understanding of it. >Thank you Yet again, >Mike > good luck understanding. personally it is one of those things that I dust off and pull out the help docs everytime I need it... never use it enough to sit down and really become proficient at writing them, and each time I do it is like pulling teeth. Would love to see a nice walkthrough with excercises and such, just havn't bothered. Instead I suffer through each time it must be used to accomplish an end goal. End results from a carefully crafted regex cannot be beat though. Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD Library
If you dowloaded the PHP 4.2.2 installer you don't have the php_gd.dll in your machine, you have to download the PHP 4.2.2 zip package from php.net and overwrite all your files in the php folder, this zip file contains all the dll's for windows including the php_gd.dll, then remove the ; in the Windows Extensions part of your php.ini corresponding to the gd library and check that the extension_dir in Paths and Directories has the same directory where the extensions are. At 01:44 PM 7/25/2002 -0500, you wrote: >I am trying to use GD Library on a windows 2000 installation of PHP. >php_gd.dll is in the extensions folder and the line: ";extension=php_gd.dll" >is in my php.ini file, but I recieve the error: "Fatal error: Call to >undefined function: imagecreate()" when I try to use the >imagecreate(100,100) function. Any ideas? > >Thanks! > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Jadiel Flores - http://www.abargon.com [EMAIL PROTECTED] (52-55) 52-29-80-34 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] conditional image generation problem
Hi, I have a problem with conditional image generation. If I generate an image without any conditional statments, then everything works fine. But if i introduce conditional statment, then no image is generated in either case of the condition. Has anyone dealt with this dilema before? Thanks in advance, alex P.S. I am generating a hit-counter image. The set-up is very basic: if admin looks at the page, then image should be generated and displayed if anyone else loads the page, no image should be generated. my code goes smth like this: -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] OT project dev prroces was .. Paying Job...
On 25 Jul 2002 at 12:12, Matt Babineau wrote: > When first speaking with a client, would you charge an initial > constation fee for lets say conference calls? How would you invoice > stuff like this? on a monthly basis? Or every two weeks? Hi, I apologize for adding some noise but I really don't know of a good list for these things. I keep planning on putting my smartarchitectures.com site to use for this as so many problems are non langauge specific but we always ask in our favorite language list. Anyhow, Here is how I have done and prefer to do a project (but TMTOWDI of course) Initial meeting is free. This has usually be filtered by sales or some other means. But I always think talking ideas is worth time. I'm a bit cautious about giving out any really good ideas in this meeting. Try to see if client is serious. From this meeting I then work up an estimate of the followin ... oh heck here is a proposal I did (my first "proposal" since I become a free-lancer): http://www.coremodules.com/customer/memphisworks_proposal.php The client did not accept me :(. They went with someone else. I did mention to the client, are you ready, that they use HR XML standards so seekers and suppliers of jobs can talk to the site via XML .. that means that you the job seeker would not have to repeate the same old thing (if you have your resume in a database like your dear friend) but could just upload the XML file of your resume and thus populate all the fields and that the supplier could upload job offers via XML and not pay some drone to create typos in forms. Even though the client was in the HR business she had never heard of XML. Oh well. I go into more detail about what the proposal above refers to here: http://www.coremodules.com/process/doc_process.php Yes, some of that comes from some Proejct Management books I've read. I believe a system, even if flawed, is better than no system at all. NOTE, yes, I know some links are broken from that page. BTW, at the ad agency I worked at, we billed on a regular schedule. Peter -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions : overriding variable values
Hi I am still battling alot with understanding how sessions work (don't work in my case). Firstly: I am trying to find a reliable method for coding with sessions that will work on basically any server and any browser; meaning no cookies and passing the SID to all url's manually. My app has the following ( amongst others) index.php = login page with form and 2 fields (username / password), session_start() On the action page, I session_start() again, and then session_register("username","password") and I don't need to give them values as the form fields are called that and PHP generates them for me (register_globals = on). This works great, on ALL subsequent pages in the app, I can simply call $username and $password, and it works. BUT, my app has alot of iterations, and now I'm battling to understand how to change these session variables "on the fly" in a sensible manner; in particular when it comes to forms that "generate" their own variables on submit. It seems like my problem comes in that I can only set a session variable once it "exists" , ie, on the action page, and then also, that the app goes "backwards" allowing you to change your options, yet, when yuou do, the variables does not contain the new variables. The fact that the app also doesn't have a specific "end" means I also don't know where to place the session_destroy()... I have made 4 small pages to illustrate : index.php Username Password page2.php This is username: This is password: First Variable Second Variable page3.php This is username: This is password: This is first variable: This is second variable: To Page 2 To Page 4 page4.php This is username: This is password: This is first variable: This is second variable: To Page 3 Also, not sure if it is browser related, but on mine, I sometimes get 2x SESSIONID= added to the end of the URL, even though I clearly put it in once only... Am I missing the point here? Plz help to make things clearer to me... The only way I can get above scanario to work is to add the variable manually to all the url's as I've been coding all along. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HOWTO: ODBC-PHP-Apache2
Hello folks, Apologies for the cross-post, but I wanted to announce the publication of a new HOWTO on compiling ODBC support into PHP and Apache with the iODBC Driver Manager: It's available at the www.iodbc.org site in the left hand column. You may view the document directly at: http://www.iodbc.org/odbc-php-apache2.html Please provide feedback and comments! Best regards, Andrew Hill Director of Technology Evangelism - OpenLink Software What is Virtuoso? http://www.openlinksw.com/virtuoso/whatis.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] suppressing errors
Hello All, I am trying to use the "@" symbol to suppress errors returned by a mysql_query call. This doesn't seem to be working as I get an new page with the error in it in my browser. Any help with this would be greatly appreciated. Here is a snippet of the code I am using $query = "select user_id from users where username='$username'"; $query_db = @mysql_query($query, $db_connection); $row = @mysql_fetch_array($query_db); if($row) { $message[] = "That username is already taken. Please select another."; } else { Thanks, Preston -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD Library
Not only the solution just posted, but I was using this before and needed to set the dll used to php_gd2.dll, I am pretty sure it got renamed in one of the more recent releases of PHP. Matt Babineau MCWD / CCFD - e: [EMAIL PROTECTED] p: 603.943.4237 w: http://www.criticalcode.com PO BOX 601 Manchester, NH 03105 -Original Message- From: Ryan Moore [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 2:44 PM To: [EMAIL PROTECTED] Subject: [PHP] GD Library I am trying to use GD Library on a windows 2000 installation of PHP. php_gd.dll is in the extensions folder and the line: ";extension=php_gd.dll" is in my php.ini file, but I recieve the error: "Fatal error: Call to undefined function: imagecreate()" when I try to use the imagecreate(100,100) function. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printing results from mysql fetch array
Well yah.. I mean you can move the array pointer by simply looping through the array 16 times. But why not simply take care of this in your SELECT statement? "SELECT .. blah blah blah.. ORDER BY firstname DESC LIMIT 16, 1" Returns one row starting with the 16th row ordered by the firstname in descending order. -Kevin - Original Message - From: "Tyler Durdin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 1:01 PM Subject: [PHP] printing results from mysql fetch array > If I select all from my db how can I print the individual results? For > example, say i want to print record number 16 from the firstname column into > a table. How can i accomplish this? I have all of my db access coded and > have it selecting all from the db, but i want to print individual records > into my table. Can I set the records to variables and use something like > I am really lost here please help! > > > > _ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] GD Library
[snip] I am trying to use GD Library on a windows 2000 installation of PHP. php_gd.dll is in the extensions folder and the line: ";extension=php_gd.dll" is in my php.ini file, but I recieve the error: "Fatal error: Call to undefined function: imagecreate()" when I try to use the imagecreate(100,100) function. Any ideas? [/snip] Remove the ";" in front of the extension listing in your .ini file and restart your web server. HTH! Jay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] GD Library
I'm not a windoze user but if that line has a ";" at the beginning of it like you have it in your message then it is commented out! LOL. :-) Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Ryan Moore" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 1:44 PM Subject: [PHP] GD Library > I am trying to use GD Library on a windows 2000 installation of PHP. > php_gd.dll is in the extensions folder and the line: ";extension=php_gd.dll" > is in my php.ini file, but I recieve the error: "Fatal error: Call to > undefined function: imagecreate()" when I try to use the > imagecreate(100,100) function. Any ideas? > > Thanks! > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] printing results from mysql fetch array
Well you could do something like this: while ($row = mysql_fetch_array) { echo "$row[data1]" } This will print out a table row for every record.. Now if you just want to print specific records then you might as well do that in the select statement to your database and then use the above... Cheers! Rick "The glory of friendship is not the outstretched hand, nor the kindly smile, nor the joy of companionship; it is the spiritual inspiration that comes to one when he discovers that someone else believes in him and is willing to trust him with his friendship." - Ralph Waldo Emerson > From: "Tyler Durdin" <[EMAIL PROTECTED]> > Date: Thu, 25 Jul 2002 19:01:34 + > To: [EMAIL PROTECTED] > Subject: [PHP] printing results from mysql fetch array > > If I select all from my db how can I print the individual results? For > example, say i want to print record number 16 from the firstname column into > a table. How can i accomplish this? I have all of my db access coded and > have it selecting all from the db, but i want to print individual records > into my table. Can I set the records to variables and use something like > I am really lost here please help! > > > > _ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New way to make select boxes auto select
> From: Nathan Cook [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 2:52 PM > Subject: Re: [PHP] New way to make select boxes auto select > How are you able to quickly and painlessly determine which > key gets the > selected value, from form submission data, when building the > initial array? Via the selected name, say, $POST['location']. I usually use the db code table method and something like: echo setupSelect($db,"locations","LocName","LocName",$_POST['location']); If you were using hard coded values like Active, Inactive,etc you can just do a: $status = array('Active','Inactive'); $status[$_POST['status']] = 'selected; echo buildSelect($status); It doesn't handle multi selects and it's resulting arrays, but that should be too hard to do by checking if the selected value is an array & modify the comparison in that case. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] Implement PHP within a string
Sure. You want the eval() function. Can be a little tricky but you'll get it. http://www.php.net/manual/en/function.eval.php -Kevin - Original Message - From: "Joshua E Minnie" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 12:54 PM Subject: [PHP] Implement PHP within a string > Is it possible to run PHP that is embedded within a string? I have a file > that is read into a string and returned to the browser, how can I run that > PHP? > > i.e. > > function something() { > // this is set earlier by other functions > // $str = "some html codegetForm("guest"); ?>some more > html code"; > > return ($str); > } > > echo $obj->something(); > > > -- > Joshua E Minnie/CIO > [EMAIL PROTECTED] > Phone: 616.276.9690 > Fax: 616.342.8750 > Nextel: 616.862.2847 > > "Don't work for recognition, but always do work worthy of recognition." > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mySQL Queries using PHP's SESSION variables
well, you could simply loop through the session vars and build the query as you go. $query = "SELECT * FROM Inventory WHERE"; // I'm assuming you keep your item numbers in a "items" or something similar foreach ($HTTP_SESSION_VARS['items'] as $pid) $subquery .= " ItemNumber = '$pid' OR "; // get rid of last _OR_ $subquery = ereg_replace('[:space:]OR[:space:]$', '', $subquery); // put the query together $query = $query . $subquery; // add more crap to query if you want $query .= " and some_other_column='something_else'"; Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Anup" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 1:51 PM Subject: [PHP] mySQL Queries using PHP's SESSION variables > Hello, I am stuck here. In the name of efficiency I want to lower the number > of callls to the database. So I am trying to give the most stringent query > possible. This is the problem: I have stored the surfers shopping cart, > where each item is stored as a session variable.Now on the database I have > ALL inventory items, but I want to only display the details of what the user > has in his cart. > eg. : I want something like this: > > $result = mysql_query("SELECT * from Inventory where ItemNumber is in > $HTTP_SESSION_VARS"); > // I need proper syntax to replace "is in" > > where Inventory has, ItemNumber (unique), Price, ItemName. > So say the surfer has three items in the Session, then I stored the three > unique ItemNumbers. > Then with the above query I can get the rest of the information to represent > to the user. > I am looking down the avenues of a Set datastyp or maybe Enum, but I don't > know if it will help. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] best way to log bad email address'
Hello, On 07/25/2002 05:27 AM, Justin French wrote: >>You'll need to catch bounces as they come in. To make life easier, assign >>your own unique Message-IDs and remember them, so you can easily >>invalidate addresses. > > > Erm, I'm on a shared server, so I don't *think* it's that easy unfortunately > -- I can't get a message to bounce to the From: or Reply-To: headers I set. > My guess is it goes to an address set in php.ini, or somewhere else, and is > global to the entire server (doesn't help me). > > Unless I can set it was .htaccess or ini_set(). You do not need to set the return-path/envelop sender address in php.ini . There are ways to work around that. It depends on the platform that you use, but in general you can use this class for that purpose. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Fw: [PHP] mySQL Queries using PHP's SESSION variables
You might be making it more difficult than it needs to me. You're not dealing with a huge number of queries here so why not just loop it? I would simply loop through the $_SESSION array and query the dbase for each item. foreach ($_SESSION as $key => $val) { $query = "SELECT * FROM inventory WHERE itemnumber = '$val'"; $result = mysql_query($query, $db); // .. blah blah blah... } -Kevin - Original Message - From: "Anup" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 12:51 PM Subject: [PHP] mySQL Queries using PHP's SESSION variables > Hello, I am stuck here. In the name of efficiency I want to lower the number > of callls to the database. So I am trying to give the most stringent query > possible. This is the problem: I have stored the surfers shopping cart, > where each item is stored as a session variable.Now on the database I have > ALL inventory items, but I want to only display the details of what the user > has in his cart. > eg. : I want something like this: > > $result = mysql_query("SELECT * from Inventory where ItemNumber is in > $HTTP_SESSION_VARS"); > // I need proper syntax to replace "is in" > > where Inventory has, ItemNumber (unique), Price, ItemName. > So say the surfer has three items in the Session, then I stored the three > unique ItemNumbers. > Then with the above query I can get the rest of the information to represent > to the user. > I am looking down the avenues of a Set datastyp or maybe Enum, but I don't > know if it will help. > > > > -- > 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] printing results from mysql fetch array
If I select all from my db how can I print the individual results? For example, say i want to print record number 16 from the firstname column into a table. How can i accomplish this? I have all of my db access coded and have it selecting all from the db, but i want to print individual records into my table. Can I set the records to variables and use something like I am really lost here please help! _ MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help! mysql problem
Hi there, I've got a quick question concerning PHP and mySQL. I've got a fresh server with recent versions of Red Hat Linux, mySQL, PHP and apache. My problem is that when I call mysql_pconnect, my PHP code hangs and doesn't proceed. I can't check mysql_error because it doesn't go beyond this point. I know that mysql is running and the PHP code prior to this statement works just fine. The mysql account is operating correctly from the prompt and I'm using all of the default values for PHP and mysql config. Has anybody had this problem before and can somebody please offer me some suggestions? Thank you!!! - Scott
RE: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble
The apache configure line was a vanilla configure, only turning on mod_rewrite and enabling so. It's really as basic of a configure as I could do.. I don't understand why it failed. :( So I did what someone else suggested, tried the ports.. installed apache2, fine, tried to install mod_php4, selected zlip, mysql, + openldap2.x support. Got the packages, then when installing them and it got to apxs, it was looking for --with-apxs2 since apache 2.x is being used. apparently the script used --with-apxs. I don't see where I can change this. Unreal that this is this difficult to get working. :\ Chad -Original Message- From: Tech Support [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 2:49 PM To: Chad Day Subject: Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble Without seeing exactly what steps you took in building both apache and php it would be next to impossible to guess. Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Chad Day" <[EMAIL PROTECTED]> To: "Tech Support" <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 12:53 PM Subject: RE: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble > Ok, I decided to revert back to 1.3.26. > > PHP builds fine.. > > When I go to start Apache: > > Syntax error on line 205 of /usr/local/www/conf/httpd.conf: > Cannot load /usr/local/www/libexec/libphp4.so into server: > /usr/local/www/libexec/libphp.so: Undefined symbol "core_globals" > > What does that mean? Google turned up 4 results, none relevant, php.net > search turned up 0. > > Thanks, > Chad > > -Original Message- > From: Tech Support [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 1:16 PM > To: Chad Day; [EMAIL PROTECTED] > Subject: Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install > trouble > > > 4.2.2 will not work with apache 2.X from what I've read. However, I have > heard that if you get the latest CVS of both php and apache it will work. I > have not, and probably will not, go down that road just yet :-) > > Jim Grill > Support > Web-1 Hosting > http://www.web-1hosting.net > - Original Message - > From: "Chad Day" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Thursday, July 25, 2002 11:38 AM > Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble > > > > Simple build, no real complicated configure options > > (--with-mysql, --with-apxs2..) .. > > > > During make: > > > > php_functions.c:93: syntax error > > *** Error code 1 > > > > Stop in /usr/local/php-4.2.2/sapi/apache2filter. > > > > etc > > etc > > > > > > Any idea what the problem would be? I googled around for a little and > heard > > there might be problems getting the latest php to work with apache 2.0.39, > > but that was a couple weeks ago.. I thought the new 4.2.2 build might > > address it, but I guess if it's only a security fix like the site says, > > maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something > > else amiss? > > > > Thanks, > > Chad > > > > > > -- > > 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] Implement PHP within a string
Is it possible to run PHP that is embedded within a string? I have a file that is read into a string and returned to the browser, how can I run that PHP? i.e. some html codegetForm("guest"); ?>some more html code"; return ($str); } echo $obj->something(); -- Joshua E Minnie/CIO [EMAIL PROTECTED] Phone: 616.276.9690 Fax: 616.342.8750 Nextel: 616.862.2847 "Don't work for recognition, but always do work worthy of recognition." -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] GD Library
I am trying to use GD Library on a windows 2000 installation of PHP. php_gd.dll is in the extensions folder and the line: ";extension=php_gd.dll" is in my php.ini file, but I recieve the error: "Fatal error: Call to undefined function: imagecreate()" when I try to use the imagecreate(100,100) function. Any ideas? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mySQL Queries using PHP's SESSION variables
Hello, I am stuck here. In the name of efficiency I want to lower the number of callls to the database. So I am trying to give the most stringent query possible. This is the problem: I have stored the surfers shopping cart, where each item is stored as a session variable.Now on the database I have ALL inventory items, but I want to only display the details of what the user has in his cart. eg. : I want something like this: $result = mysql_query("SELECT * from Inventory where ItemNumber is in $HTTP_SESSION_VARS"); // I need proper syntax to replace "is in" where Inventory has, ItemNumber (unique), Price, ItemName. So say the surfer has three items in the Session, then I stored the three unique ItemNumbers. Then with the above query I can get the rest of the information to represent to the user. I am looking down the avenues of a Set datastyp or maybe Enum, but I don't know if it will help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New way to make select boxes auto select
From: "Johnson, Kirk" <[EMAIL PROTECTED]> > Do you know what happens here if the error reporting is set to max? > Are a bunch of "unitialized variables" warnings issued? That would be my assumption. I suppose you could initialize the variables first to circumvent that. I was more or less looking for a quick and dirty way to accomplish the task. However, it looks like some good functions have been submitted to the list which would solve the error reporting. Something along the lines of building an array and then calling a function to loop through the array pieces and build a select menu. In my case, I wasn't looking to create another function, just a quick statement. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New way to make select boxes auto select
> // buildSelect -- return a Select box named $selectName based on key value array $selectArray > ... > // $arr = array('MD'=>'selected','DC'=>'','VA'=>''); How are you able to quickly and painlessly determine which key gets the selected value, from form submission data, when building the initial array? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] [GURU] PHP w/ Informix DB ISQL 7.20 and Dynamic server 7.30
Yes sure, You need to install the Informix-CSDK or I-Connect in the machine with the server (download from www.informix.com/evaluate) . Configure the files /etc/services and $INFORMIXDIR/sqlhosts. Also add the informix libraries to the LD_LIBRARY_PATH. Then configure and make PHP with the --with-informix=$INFORMIXDIR option. HTH > -Original Message- > From: Emile Bosch [mailto:[EMAIL PROTECTED]] > Sent: Saturday, June 29, 2002 3:08 AM > To: [EMAIL PROTECTED] > Subject: [PHP] [GURU] PHP w/ Informix DB ISQL 7.20 and Dynamic server > 7.30 > > Hi group, > > I have to automate (read: Put there internal informix db online) an > company > and they are using this configuration: > > ISQL 7.20 > Embedded sql for C. 9.14 > 4GL 7.30 > 4GL runtime 7.20 > Dynamic server 7.30 > Java API1.05 > > Now i was wondering wheter it is possible to make an PHP connection to > this > DB so that i can query it and use it in PHP. Does someone knows how to > do > this? Or is it maybe possible to make an ODBC connection or anything > like > that/ > > Warm regards > Emile Bosch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I didnt understand the how work pathtovars, a php gpl script
> would look like this: > http://www.domain.com/script.php?var1=value1&var2=value2 > there would be a document name << script.php >> > followed by the << ? >> > then variable and value pairs << var1=value1 >> > separate each variable/value pair with an ampersand << & >> > > Hope this helps > > Bret I know how get var are mapped in php script... But I would like to know how to use : http://www.phpclasses.org/browse.html/package/561.html ? with that : http://www.domain.com/var1_value1/var2_value2/ +pathtovars making in the script : $var1 = value1 $var2 = value2 Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] I didnt understand the how work pathtovars, a php gpl script
>http://www.domain.com/var1_value1/var2_value2/ would look like this: http://www.domain.com/script.php?var1=value1&var2=value2 there would be a document name << script.php >> followed by the << ? >> then variable and value pairs << var1=value1 >> separate each variable/value pair with an ampersand << & >> Hope this helps Bret Find a contractor or find a contract at Tech-Temp.com - Original Message - From: "David D" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 2:24 PM Subject: [PHP] I didnt understand the how work pathtovars, a php gpl script > Hello, > > I was looking for a query_string wrapper for web crawlers > I found pathtovars : > http://www.phpclasses.org/browse.html/package/561.html > > English is not my native language. > I didnt manage to use efficently this script ! > Even with the sample ! > > I don't know how to map url ? > How to generate an url ? > How to retrieve variables values in the current url ? > > I found this script with a very little doc. > > Is there someone that can have a look and try to explain me simply ? > > For eg : > How to retieve : > $var1 = value1 > $var2 = value2 > with that on that script > http://www.domain.com/var1_value1/var2_value2/ > > > Thanks. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble
Try building apache2 and modphp4 using the FreeBSD ports system - that's how I compiled and it works fine here. HTH Danny. Apache2.0.39/PHP4.2.2/FreeBSD4.6 - Original Message - From: "Chad Day" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 5:38 PM Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble > Simple build, no real complicated configure options > (--with-mysql, --with-apxs2..) .. > > During make: > > php_functions.c:93: syntax error > *** Error code 1 > > Stop in /usr/local/php-4.2.2/sapi/apache2filter. > > etc > etc > > > Any idea what the problem would be? I googled around for a little and heard > there might be problems getting the latest php to work with apache 2.0.39, > but that was a couple weeks ago.. I thought the new 4.2.2 build might > address it, but I guess if it's only a security fix like the site says, > maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something > else amiss? > > Thanks, > Chad > > > -- > 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] Download not available
Downloads for the Windows binaries are broken. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I didnt understand the how work pathtovars, a php gpl script
Hello, I was looking for a query_string wrapper for web crawlers I found pathtovars : http://www.phpclasses.org/browse.html/package/561.html English is not my native language. I didnt manage to use efficently this script ! Even with the sample ! I don't know how to map url ? How to generate an url ? How to retrieve variables values in the current url ? I found this script with a very little doc. Is there someone that can have a look and try to explain me simply ? For eg : How to retieve : $var1 = value1 $var2 = value2 with that on that script http://www.domain.com/var1_value1/var2_value2/ Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] patch of php
Hi, I download patch of php-4.2.0-to-4.2.2.patch.gz from http://www.php.net and try to update our PHP 4.2.0 to 4.2.2. But I can't find instructions how to update PHP by using this patch of php-4.2.0-to-4.2.2.patch.gz. Could anyone tell me how to patch it or where can I find this information to update PHP by this patch? Thanks, Hong -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New way to make select boxes auto select
> From: Nathan Cook [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 12:34 PM > Subject: [PHP] New way to make select boxes auto select > > > You may already be doing it like this, but I think I found a > new way to > make select boxes auto-select (what data they put in) a lot > easier. All you > have to do is put a variable in each select tag that is equal > to the value > of the select option i.e.: -- > then all you > have to do is base the variable on that name=interest> $$interest = > "selected"; quick and easy with out having to loop through an > if elseif > statement. Let me know if you like that method or have any > objections. I use these functions which do something similar. The first function accepts an array of names for the option, and returns a string of all of the but not the tags. The ones to be selected have a value of 'selected'. The second function accepts a code table, of say states or provinces, and a value that is to be selected, and returns the . Both are only for single selected values, but could be easily extended. Usage: // --- // buildSelect -- return a Select box named $selectName based on key value array $selectArray // // 'selected','DC'=>'','VA'=>''); // echo buildSelect($arr); // ?> // // --- function buildSelect($selectArray) { $str = ''; $count = count($selectArray); for ($i=0;$i<$count;++$i) { list($key,$selected) = each($selectArray[$i]); $selectValue = htmlspecialchars($key); $str .= "$key\n"; } return($str); } // --- // setupSelect -- Read table $table from database $db, load all values of $field, and build //a select box from this list named $selName // // // // --- function setupSelect($db,$table,$field,$orderBy,$value) { $sql = "SELECT " . $field . " from " . $table; if (empty($orderBy)) { $orderBy = $field; } $sql .= " order by " . $orderBy; $result = mysql_query($sql,$db) or die(log_mysql_error($sql,__FILE__,__LINE__)); while ($row = mysql_fetch_array($result)) { $columnData = $row[$field]; if (!empty($columnData)) { $selected = ($columnData == $value ? "selected" : ""); $selArray[] = array($columnData => $selected); } } if (count($selArray) != 0) { return(buildSelect($selArray)); } } // - // logs to syslog define the constant DISPLAY_MYSQL_ERRORS as 1 // if you want to see errors in browser too // usage: $result = mysql_query($sql,$db) // or die(log_mysql_error($sql,__FILE__,__LINE__)); // - function log_mysql_error($sql='',$file='',$line=0) { $msg="{$_SERVER['PHP_SELF']}: (FILE=$file) (LINE=$line)\n"; $msg .= "MySQL Says: " . mysql_error() . "\n"; if (!empty($sql)) { $msg .= "SQL Statement was: $sql"; } error_log($msg,0); if (1 == DISPLAY_MYSQL_ERRORS) { $msg=nl2br($msg); echo "$msg\n"; } exit; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] New way to make select boxes auto select
Nathan, this is a new idea to me and very interesting. Do you know what happens here if the error reporting is set to max? Are a bunch of "unitialized variables" warnings issued? Thanks for contributing this to the list. Kirk > -Original Message- > From: Nathan Cook [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 25, 2002 10:34 AM > To: Php List > Cc: David Chase > Subject: [PHP] New way to make select boxes auto select > > > You may already be doing it like this, but I think I found a > new way to > make select boxes auto-select (what data they put in) a lot > easier. All you > have to do is put a variable in each select tag that is equal > to the value > of the select option i.e.: -- > then all you > have to do is base the variable on that name=interest> $$interest = > "selected"; quick and easy with out having to loop through an > if elseif > statement. Let me know if you like that method or have any > objections. > > Full example below. > > print("\n"); > // creates a variable with a name based on > // the value of interest with a value of "selected" > $$interest = "selected"; > print("- Select One -\n"); > print("Teacher\n"); > print("Lego Enthusiast\n"); > print("YMCA\n"); > print(" \n"); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] New way to make select boxes auto select
Interesting technique. Depending on your error_reporting levels, you may get a bunch of undefined variable warnings, though. I usually use a config file with arrays for my select boxes. Something like $_CONF['Something'] = array("This","That","And","Something"); Then just create a function like conf_select($key,$selected); where you pass the $_CONF variable key that you want the select box to be made of and the default value. ---John Holmes... - Original Message - From: "Nathan Cook" <[EMAIL PROTECTED]> To: "Php List" <[EMAIL PROTECTED]> Cc: "David Chase" <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 12:33 PM Subject: [PHP] New way to make select boxes auto select > You may already be doing it like this, but I think I found a new way to > make select boxes auto-select (what data they put in) a lot easier. All you > have to do is put a variable in each select tag that is equal to the value > of the select option i.e.: -- then all you > have to do is base the variable on that $$interest = > "selected"; quick and easy with out having to loop through an if elseif > statement. Let me know if you like that method or have any objections. > > Full example below. > > print("\n"); > // creates a variable with a name based on > // the value of interest with a value of "selected" > $$interest = "selected"; > print("- Select One -\n"); > print("Teacher\n"); > print("Lego Enthusiast\n"); > print("Student\n"); > print("Homeschool Parent\n"); > print("Browsing\n"); > print("Afterschool\n"); > print("Boys & Girls Club\n"); > print("YMCA\n"); > print(" \n"); > > [ Nathan Cook | [EMAIL PROTECTED] ] > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Where do I specify a DSN? v0.2
David, The error probably has to do with your PHP environment being unable to locate your odbc.ini file. You will need to set your odbc.ini location as well as the location of the driver manager. Check out this HOWTO http://www.iodbc.org/odbc-phpHOWTO.html to get an idea of how it all works - the instructions should be similar for UnixODBC. Hint - look at the "putenv()" calls. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: David Busby [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 2:55 PM To: php-general Subject: [PHP] Where do I specify a DSN? v0.2 List, Guess I should be more specific: Heres line four: $db = odbc_connect("somedsn","sa", ""); My System: RedHat 7.3/Apache/PHP 4.1.2-7 I'm getting this error message...I think I just need to define the DSN...is that done in /etc/odbc.ini? Or what? /B Warning: SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/html/index.php on line 4@ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] ODBC Failures
How does it fail? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: David Busby [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 4:29 PM To: php-general Subject: [PHP] ODBC Failures List, My ODBC connection is failing it seems...I can run this code just fine...odbc_connect and odbc_pconnect seem to work...the odbc_prepare even works just fine...but as soon as I execute (with odbc_execute, odbc_exec, or odbc_do it fails...any ideas? "; $sql = odbc_prepare($db, "execute spGetItems"); echo "Prepared SQL id:".$sql.""; // This line will fail $rs = odbc_execute($sql); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] [GURU] PHP w/ Informix DB ISQL 7.20 and Dynamic server 7.30
Hi Emile, Sure, ODBC should work just fine. Let me know if you need info on setting it up. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: Emile Bosch [mailto:[EMAIL PROTECTED]] Sent: Saturday, June 29, 2002 3:08 AM To: [EMAIL PROTECTED] Subject: [PHP] [GURU] PHP w/ Informix DB ISQL 7.20 and Dynamic server 7.30 Hi group, I have to automate (read: Put there internal informix db online) an company and they are using this configuration: ISQL 7.20 Embedded sql for C. 9.14 4GL 7.30 4GL runtime 7.20 Dynamic server 7.30 Java API1.05 Now i was wondering wheter it is possible to make an PHP connection to this DB so that i can query it and use it in PHP. Does someone knows how to do this? Or is it maybe possible to make an ODBC connection or anything like that/ Warm regards Emile Bosch -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Using PHP to access a Microsoft SQL server
ODBC can do this directly - no root privs needed. http://www.php.net/odbc Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: Lazor, Ed [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 5:12 PM To: php-general Subject: RE: [PHP] Using PHP to access a Microsoft SQL server It sounds like you need to give your apache account access to the database. You can test this by logging in as root and running "su - apache". You'll be logged in as Apache; try running the commands you used to test everything when logged in as root. You'll probably get errors that will hopefully lead you to an answer. -Original Message- From: David Busby [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 3:01 PM To: php-general Subject: [PHP] Using PHP to access a Microsoft SQL server List, Has anyone done this before? I got it to work for my root account on my computer but I cannot get access from my PHP scripts when I run under the "apache" user? What the dilly yo? Setup: RH7.3 PHP4 unixODBC freeTDS -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php This message is intended for the sole use of the individual and entity to whom it is addressed, and may contain information that is privileged, confidential and exempt from disclosure under applicable law. If you are not the intended addressee, nor authorized to receive for the intended addressee, you are hereby notified that you may not use, copy, disclose or distribute to anyone the message or any information contained in the message. If you have received this message in error, please immediately advise the sender by reply email and delete the message. Thank you very much. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: Where do I specify a DSN?
Naw, this is Linux :) But for anyone searching the archives, the "Data source name not found, and no default driver specified" means one of four things: 1. you don't have a DSN with the name you are using 2. you don't have a driver where the DSN expects to find it 3. on Windows, you are trying to use a File/User DSN instead of a System DSN. 4. on *nix - you haven't specified your ODBCINI environment variable like: putenv("ODBCINI=/path/to/odbc.ini"); (note LD_LIBRARY_PATH and ODBCINSTINI may have to be defined as well!) Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Virtuoso Universal Server -Original Message- From: Tracker 1 [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 03, 2002 8:28 AM To: [EMAIL PROTECTED] Subject: [PHP] Re: Where do I specify a DSN? "Richard Lynch" <[EMAIL PROTECTED]> wrote in message... > > I'm getting this error message...where does it come from? > > > >Warning: SQL error: [unixODBC][Driver Manager]Data source name not > >found, and no default driver specified, SQL state IM002 in SQLConnect in > >/var/www/html/index.php on line 4@ > > Microsoft. :-) > > Microsoft defines possible database connections as "DSN" in the ODBC Control > Panel. > > Open up the ODBC Control Panel, and make a DSN named "foo" and point it to > the database you want to access. it said unixODBC, not sure what he was trying to connect to though, may be best to use the native connection drivers? -- === Michael J. Ryan - tracker1[*at*]theroughnecks.com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net === Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] datetime field - still a newbie
Thanks bunches "John Holmes" <[EMAIL PROTECTED]> wrote in message 001101c233ba$3de3d430$b402a8c0@mango">news:001101c233ba$3de3d430$b402a8c0@mango... > > I have a datetime field in one of my mysql tables...when displaying > some > > of > > my records I want to display the date in the aforementioned datetime > > field, > > but if the date is today I want to display "today" instead. If the > date > > is > > yesterday I want it to display that so I how do I compare the > date in > > my record to todays date? Thanks > > I posted this response earlier...did you get it? Are you looking for a > MySQL solution or a PHP solution?? > > SELECT IF(TO_DAYS(CURDATE()) = > TO_DAYS(date_column),'Today',IF(TO_DAYS(CURDATE())-1 = > TO_DAYS(date_column),'Yesterday',date_column)) FROM your_table; > > If you want a PHP solution, then just select the regular MySQL date > format MMDD and use something like this when looping through your > results. > > switch($your_row['Date_Column']) > { > case date("Ymd"): > echo "Today"; > break; > case date("Ymd",strtotime("-1 day")): > echo "Yesterday"; > break; > default: > echo $your_row['Date_Column']; > } > > Untested code, of course... > > ---John Holmes... > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] an array_key_exists() substitute for php 4.0> <4.1 ?
http://www.php.net/manual/en/function.array-key-exists.php The name of this function is key_exists() in PHP version 4.0.6. Damn those elusive manual pages :-/ Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "David D" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 11:53 AM Subject: [PHP] an array_key_exists() substitute for php 4.0> <4.1 ? > hello all, > > I download a gni script path2vars that manipulate query_string for web > crawlers. > But I have php 4.06 that doesnt support function : > uses array_key_exists() (PHP >= 4.1.0). > Is there a way to substitude it ? > Is there a way to detect php version and incluse the functions or it > substitute ? > > > Thanks. > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] pdf to html
I can think of many reasons why displaying the pdf in the browser is a last resort and not a first resort. Especially in situations where the reader is not installed. Like Tyler, I would be quite interested to see if anyone has any ideas on how to convert from pdf to html. -Original Message- From: Miles Thompson [mailto:[EMAIL PROTECTED]] Sent: Thursday, July 25, 2002 10:06 AM To: Tyler Longren; php-general Subject: Re: [PHP] pdf to html Why not just display the pdf's in the browser? The only caveat is that IE has to be properly patched if 5.5, and there is the minor inconvenience of users having to install the Acrobat Reader. Most people have already done that, so it's practically a non-issue. The manual shows how to feed a pdf stored on disk to a browser. I'd imagine extracting and displaying a PDF from a database would be similar to doing the same thing for a .jpg. Miles Thompson At 10:03 AM 7/25/2002 -0500, Tyler Longren wrote: >Hi, > >I've been searching around for ways to convert pdf to html. I haven't >had much luck. > >I have a client that has a bunch of pdf's stored in a mysql table. They >don't want their users to have to download the pdf file, they want the >pdf to be displayed in the web browser all the time. Google has >something that allows them to convert pdf to html, so, is it possible >for me to do the same? > >These pdf's are graphic intensive...there's not much plain text. > >Thanks everyone, >Tyler > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble
4.2.2 will not work with apache 2.X from what I've read. However, I have heard that if you get the latest CVS of both php and apache it will work. I have not, and probably will not, go down that road just yet :-) Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Chad Day" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 11:38 AM Subject: [PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble > Simple build, no real complicated configure options > (--with-mysql, --with-apxs2..) .. > > During make: > > php_functions.c:93: syntax error > *** Error code 1 > > Stop in /usr/local/php-4.2.2/sapi/apache2filter. > > etc > etc > > > Any idea what the problem would be? I googled around for a little and heard > there might be problems getting the latest php to work with apache 2.0.39, > but that was a couple weeks ago.. I thought the new 4.2.2 build might > address it, but I guess if it's only a security fix like the site says, > maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something > else amiss? > > Thanks, > Chad > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Paying Job...
SNIP// So that leaves hourly or by the project (not mentioned). Personally, I like to do it by the project, although I am probably a minority in my preference. By the project gives the client a nice set price. However, the scope has to be extremely well defined. It should be anyway, but more so if charging by the project. I then charge by the hour for requests outside the original scope, which happens all the time. It also keeps them in check on their requests. Depending on the client, I require a third or half up front for a project. //snip Ditto, Ditto and Ditto Bret Find a contractor or find a contract at Tech-Temp.com - Original Message - From: "Chris Wesley" <[EMAIL PROTECTED]> To: "php-gen" <[EMAIL PROTECTED]> Cc: "Gerard Samuel" <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 12:45 PM Subject: Re: [PHP] Paying Job... > On Thu, 25 Jul 2002, Gerard Samuel wrote: > > > Do you charge by the page, script or by the hour (that would be nice). > > It's a tough thing to do, but consider charging by the project. You'll > find a most equitable payment/compensation when you establish up front how > valuable the project is to the client, and how valuable your time and > services are. I find this is the best way to put a client at ease [(s)he > knows what (s)he's paying ... no surprises, unless they're > client-inspired], and you can concentrate on the project instead of how to > make the site fit into X pages or how to justify or fit the project into Y > hours. > > Get a couple small projects under your belt, just for the learning > experience, and you'll get a good feel for a process that suits your > needs. > > Things I did to get become acquainted with a good process: > - did small projects for free, just to prove (to the client and myself) > that my code and I can survive > - did small projects for an undervalued price to get my foot in the door > of potential future paying clients, to build a decent portfolio, and to > assemble a good list references > - did projects just because I love to code and solve problems, not for the > cash. (YMMV. There are a myriad of reasons I employ this philosophy, > that I won't preach about here.) > > Typically what I try to establish up front: > - the total project specs > - terms on deliverable(s) (how many stages a project is divided into) > - a reasonable estimated time of delivery for each stage, and the project > as a whole > - documentation requirements > - feature-creep clauses (it's such a pain to have the project change > in mid-development ... you have to watch your own back for this.) > - maintenance requirements (to fix bugs for X number of days/months after > delivery ... NOT FOR ADDING FEATURES: do that in separate projects) > - compensation/fees > - payment terms (25% upon delivery of stage1, 100% by stage3, etc.) > > For FREE projects ... just leave off the last two points. Even though a > project may be done pro bono, it should still be relatively chaos-free. > A chaotic project done for free will probably just end up being a waste of > time for your client, and mostly for you. > > g.luck, > ~Chris > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] an array_key_exists() substitute for php 4.0> <4.1 ?
http://www.php.net/manual/en/function.array-key-exists.php: Note: The name of this function is key_exists() in PHP version 4.0.6. Op donderdag 25 juli 2002 18:53, schreef David D: > hello all, > > I download a gni script path2vars that manipulate query_string for web > crawlers. > But I have php 4.06 that doesnt support function : > uses array_key_exists() (PHP >= 4.1.0). > Is there a way to substitude it ? > Is there a way to detect php version and incluse the functions or it > substitute ? > > > Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pdf to html
Why not just display the pdf's in the browser? The only caveat is that IE has to be properly patched if 5.5, and there is the minor inconvenience of users having to install the Acrobat Reader. Most people have already done that, so it's practically a non-issue. The manual shows how to feed a pdf stored on disk to a browser. I'd imagine extracting and displaying a PDF from a database would be similar to doing the same thing for a .jpg. Miles Thompson At 10:03 AM 7/25/2002 -0500, Tyler Longren wrote: >Hi, > >I've been searching around for ways to convert pdf to html. I haven't >had much luck. > >I have a client that has a bunch of pdf's stored in a mysql table. >They don't want their users to have to download the pdf file, they want >the pdf to be displayed in the web browser all the time. Google has >something that allows them to convert pdf to html, so, is it possible >for me to do the same? > >These pdf's are graphic intensive...there's not much plain text. > >Thanks everyone, >Tyler > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: secure sockets
Richard Lynch wrote: > > $hostname = 'ssl://155.246.211.23'; > > You have to be running PHP 4.3.0 (IE, CVS or snapshot) to use 'ssl://' with > fsockopen, according to the manual. > > You may have to use cURL for now, or develop in 4.3.0 and deploy when it's > ready, or... I tried mucking around with cURL for a bit, but couldn't figure out a way to use encryption with telnet (not to mention that documentation/example code for the telnet feature is non-existant). So, I tried building the the latest snapshot of 4.3.0. Now when I try to use fsockopen(); with ssl:// I receive this message: Warning: fsockopen(): no SSL support in this build in /usr/home/research/htdocs/tests/secure2.php4 on line 6 I did include OpenSSL support...is there something else I need to include? --Josh Levine -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] an array_key_exists() substitute for php 4.0> <4.1 ?
hello all, I download a gni script path2vars that manipulate query_string for web crawlers. But I have php 4.06 that doesnt support function : uses array_key_exists() (PHP >= 4.1.0). Is there a way to substitude it ? Is there a way to detect php version and incluse the functions or it substitute ? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] pulling records from mysql
Yes, that will indeed return the rows specified, but the result is very unstable. By it's nature, MySQL does not have to conform to any sorting method unless you specify it. So it's very good practice when retrieving multiple rows to ALWAYS order them. Just my thoughts :o) Martin >>> "Tech Support" <[EMAIL PROTECTED]> 07/25/02 12:09PM >>> This query will return only the 16th row SELECT firstname FROM table_name LIMIT 16, 1 This query will give you all rows up to 15 SELECT firstname FROM table_name LIMIT 1, 15 Jim Grill Support Web-1 Hosting http://www.web-1hosting.net - Original Message - From: "Tyler Durdin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, July 25, 2002 10:18 AM Subject: [PHP] pulling records from mysql > I have a column in my table named firstname with twenty records in it. How > can i use php to pull out individual records (say for ex. record 16)? Also, > how could i pull out all records upto number 15? Thanks in advance. > > > > _ > Send and receive Hotmail on your mobile device: http://mobile.msn.com > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Paying Job...
On Thu, 25 Jul 2002, Gerard Samuel wrote: > Do you charge by the page, script or by the hour (that would be nice). It's a tough thing to do, but consider charging by the project. You'll find a most equitable payment/compensation when you establish up front how valuable the project is to the client, and how valuable your time and services are. I find this is the best way to put a client at ease [(s)he knows what (s)he's paying ... no surprises, unless they're client-inspired], and you can concentrate on the project instead of how to make the site fit into X pages or how to justify or fit the project into Y hours. Get a couple small projects under your belt, just for the learning experience, and you'll get a good feel for a process that suits your needs. Things I did to get become acquainted with a good process: - did small projects for free, just to prove (to the client and myself) that my code and I can survive - did small projects for an undervalued price to get my foot in the door of potential future paying clients, to build a decent portfolio, and to assemble a good list references - did projects just because I love to code and solve problems, not for the cash. (YMMV. There are a myriad of reasons I employ this philosophy, that I won't preach about here.) Typically what I try to establish up front: - the total project specs - terms on deliverable(s) (how many stages a project is divided into) - a reasonable estimated time of delivery for each stage, and the project as a whole - documentation requirements - feature-creep clauses (it's such a pain to have the project change in mid-development ... you have to watch your own back for this.) - maintenance requirements (to fix bugs for X number of days/months after delivery ... NOT FOR ADDING FEATURES: do that in separate projects) - compensation/fees - payment terms (25% upon delivery of stage1, 100% by stage3, etc.) For FREE projects ... just leave off the last two points. Even though a project may be done pro bono, it should still be relatively chaos-free. A chaotic project done for free will probably just end up being a waste of time for your client, and mostly for you. g.luck, ~Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] FreeBSD 4.6 / PHP 4.2.2 / Apache 2.0.39 install trouble
Simple build, no real complicated configure options (--with-mysql, --with-apxs2..) .. During make: php_functions.c:93: syntax error *** Error code 1 Stop in /usr/local/php-4.2.2/sapi/apache2filter. etc etc Any idea what the problem would be? I googled around for a little and heard there might be problems getting the latest php to work with apache 2.0.39, but that was a couple weeks ago.. I thought the new 4.2.2 build might address it, but I guess if it's only a security fix like the site says, maybe not.. does 4.2.* just not work with Apache 2.0.39, or is something else amiss? Thanks, Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Traversing an appendable file
On Sun, Jul 21, 2002 at 08:50:15PM -0400, Chris Earle wrote: > Is there any way to fseek (or something to the exact same effect) a file > opened with "a" or "a+"? > > I've tried rewinding and fseeking appendable files, but neither work. > > Opening up in "r+" gives me part of the desired result, but if where I want > to write is not at the end, it writes over things, which I obviously do not > want. Go to the archives, http://groups.google.com/ and look up the thread on the php-general list entitled "Editing files by line" --Dan -- PHP classes that make web design easier SQL Solution | Layout Solution | Form Solution sqlsolution.info | layoutsolution.info | formsolution.info T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php