Re: [PHP] update mysql from php web page
Daniel Clark [EMAIL PROTECTED] wrote on 04/06/2004 03:27:34 PM: I think you need a WHERE clause for the UPDATE, otherwise it will update ALL the records. e.g. WHERE OwnerName='$result' Then perhaps a redirect to another page. Thanks for the reminder. I set that, and found the problem that caused the page to not load at all - no closing double-quote on the update statement. Now the page loads properly but when I press the submit button nothing happens, it's a dead button. -- if(isset($submit)): $query1 = update warranty set VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother') where OwnerName = $OwnerName; $result1 = mysql_query($query1); mysql_query($query1); else: $query = select * from warranty WHERE OwnerName='$result'; $results = mysql_query($query); $row = mysql_fetch_array($results); ? ... lots of code ... pcenterinput type=submit name=submit value=Update Data/center/p ... more code ... /table ? endif; ? /body /html - I don't see any reason for the submit button to not work at all. What should I look for now? Thanks for the help, Chip I probably need to use if(isset($submit)): and an update statement, but my attempt just causes the web page to display completely blank. This is what I tried - if(isset($submit)): $query1 = update warranty set VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address', OwnerCity='$city',OwnerState='$state',OwnerZip='$zip', OwnerCountry='$country',DateInstalled='$DateInstalled', DealerName='$Dealer',DealerStreet='$DealerAddress', DealerCity='$DealerCity',DealerState='$DealerState', DealerZip='$DealerZip',DealerCountry='$DealerCountry', Model='$Parts',SN='$PartsSN',VesselType='$vesseltype', VesselLength='$length',InstalledOn='$construction', VesselTypeOther='$vesseltypeother') ; $result1 = mysql_query($query1); mysql_query($query1); else: $query = select * from warranty WHERE OwnerName='$result'; $results = mysql_query($query); $row = mysql_fetch_array($results); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] update mysql from php web page
Daniel Clark [EMAIL PROTECTED] wrote on 04/07/2004 10:17:36 AM: For the submit button to work it has to be in a form. FORM ACTION=blah_blah.php METHOD=post INPUT TYPE=submit /FORM Hope this helps. Daniel Clark Of course, I didn't notice I left that line out of my code, although I did remember to put in the closing form tag. But, unfortumately, the update is not executed. The form button works, and it appears to do what it should, but the data is not changed. I changed the form method to get so I could see what is being passed and everything there is fine, but at the end of the url I see this- url...stuff...submit=Update+Data Is this correct? What else can I do to see what was passed to the database (if anything)? -- Chip pcenterinput type=submit name=submit value=Update Data/center/p ... more code ... /table ? endif; ? /body /html - I don't see any reason for the submit button to not work at all. What should I look for now? Thanks for the help, Chip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] update mysql from php web page
I have an existing web page that pulls some data and displays it in form input fields. I would like to add the ability to edit those fields and submit the changes to the server, but have been unsuccessful. What bit of code do I need to add to the existing code? This is the existing code to display the info -- $query = select * from warranty WHERE OwnerName='$result'; $results = mysql_query($query); $row = mysql_fetch_array($results); I probably need to use if(isset($submit)): and an update statement, but my attempt just causes the web page to display completely blank. This is what I tried - if(isset($submit)): $query1 = update warranty set VesselName='$vessel',OwnerName='$owner',OwnerStreet='$address',OwnerCity='$city',OwnerState='$state',OwnerZip='$zip',OwnerCountry='$country',DateInstalled='$DateInstalled',DealerName='$Dealer',DealerStreet='$DealerAddress',DealerCity='$DealerCity',DealerState='$DealerState',DealerZip='$DealerZip',DealerCountry='$DealerCountry',Model='$Parts',SN='$PartsSN',VesselType='$vesseltype',VesselLength='$length',InstalledOn='$construction',VesselTypeOther='$vesseltypeother') ; $result1 = mysql_query($query1); mysql_query($query1); else: $query = select * from warranty WHERE OwnerName='$result'; $results = mysql_query($query); $row = mysql_fetch_array($results); ? What am I doing wrong? Thanks, -- Chip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] script problem with authorization
I am trying to get a script to work that will protect individual files, not just a directory. The script I am using is this - ? if($auth == yes) { $file = downloads/2004_February_PB_File1.pdf; $len = filesize($file); header(Cache-Control: no-store, no-cache, must-revalidate); // HTTP/1.1 header(Cache-Control: post-check=0, pre-check=0, false); header(Pragma: no-cache); // HTTP/1.0 header(Content-type: application/pdf); header(Content-Length: $len); header(Content-Disposition: inline; filename=2004_February_PB_File1.pdf); header(Content-Transfer-Encoding: binary\n); readfile($file); } else { echo Sorry, you must be logged in to access this page. a href='index.php'lt;lt;Back/a; // this is the end of the script, next lines added for testing purposes only echo br /File size: $len; echo br /File name: $filebr /; echo File size using the filesize() function: . filesize(downloads/2004_February_PB_File1.pdf); echo br /; echo File type using the filetype() function: . filetype(downloads/2004_February_PB_File1.pdf); echo br /; echo File owner using the fileowner() function: . fileowner(downloads/2004_February_PB_File1.pdf); } ? The test lines above do show the expected results. The two echo statements that are supposed to show the variables $len and $file do not result in anything. The problem seems to be with the first line auth == 'yes'. If I change it to 'no' the script still gives the same results as when it is 'yes'. Here's what it's supposed to do - I have a directory of files that is protected by a .htaccess file. I have a password file outside the web root called passwd. The same passwd file is used for other directories for my use only and it works fine. The script is supposed to see the .htaccess file and pass the visitor through without them having to actually log in, and then the file will download automatically. My purpose - is to prevent people from manipulating the url in the location bar and download documents directory without loggin into the site. The .htaccess works by itself, but I don't want to require the users to 'log in' a second time to download a file. They have to log into the site, they should be able to download the docs freely. I hope this is clear (clear as mud probably). Anyway, I found this script on http://www.wazzup.co.nz/tutorials/protect_pdf/index.php. I sent a message to the author and haven't heard back yet, so thought I'd try here. If anyone knows of a better/easier/alternative way to protect individual files, give a logged in user free access to it, but protect it from downloads from people not logged in, I'm certainly open to any and all suggestion. The docs are price lists that we wouldn't want our competitors to get ahold of. Thanks for the help, -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (Then why do I have 8? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] browser identification problem
Ernest E Vogelsinger [EMAIL PROTECTED] wrote on 02/17/2003 11:20:41 PM: At 06:05 18.02.2003, Jason Wong said: [snip] On Tuesday 18 February 2003 01:18, [EMAIL PROTECTED] wrote: then set 'user_agent' in php.ini to match that of one of the compatible browsers. I don't see any user_agent entry in my php.ini file. I did a search on the php.net site and didn't find any info on this. What would be the proper way to set this in php.ini, and in which section of php.ini? Anywhere in php.ini I suppose. Or it can be set at run-time using ini_set(). [snip] http://www.php.net/manual/en/ref.filesystem.php#ini.user-agent Thanks for the link. I added the following to my php.ini - user_agent = Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3a) Gecko/20021212 And it prevents any pages from being displayed. I copied that line from the http_user_agent line in php_info. The php doc mentioned above doesn't provide any info on the format of the user_agent line. Obviously I'm doing it wrong. Suggestions? Thanks -- Chip -- O Ernest E. Vogelsinger (\)ICQ #13394035 ^ http://www.vogelsinger.at/ -- 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] browser identification problem
Jason Wong [EMAIL PROTECTED] wrote on 02/14/2003 10:08:45 PM: On Saturday 15 February 2003 05:01, [EMAIL PROTECTED] wrote: I have an ecommerce app (MAS200 eBusiness Manager) that works. I am updating my web site to php frames. Now when I want to connect to the eBusiness Manager server Presumably you mean connect to that app with some php code? On my web page is a link to another server, just a simple url link. The existing pages are .php pages. I get this error: Unsupported Browser The browser you are using (PHP/4.2.3) is currently unsupported. Please update your browser to the most current level. This happens regardless of the browser I am using. How can I get this to send the actual browser info, not this php info in its place? The error comes from some php code accessing that app and has nothing to do with whatever browser you're using. I have had the existing .php pages accessing the other server for a couple years now with no problems. Only differance is the new page that has the link is frames. I don't know why that would make a differance though. Find out what browsers that app is satisfied with, 5.0 and higher browsers. then set 'user_agent' in php.ini to match that of one of the compatible browsers. I don't see any user_agent entry in my php.ini file. I did a search on the php.net site and didn't find any info on this. What would be the proper way to set this in php.ini, and in which section of php.ini? Thanks, -- Chip -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The Usenet news is out of date */ -- 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] browser identification problem
Chris Shiflett [EMAIL PROTECTED] wrote on 02/14/2003 02:47:43 PM: --- [EMAIL PROTECTED] wrote: I have an ecommerce app (MAS200 eBusiness Manager) that works. I am updating my web site to php frames. There is no such thing. Perhaps you mean HTML frames? Take a look at this web site - http://www.phpbeginner.com/columns/mark/frames -- Chip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] browser identification problem
Here's a bit more info - just for clarity and understanding of what's going on... There are actually 3 server involved - My current web site is hosted on my isp's server. I have another server here in my office which contains about a gigabyte of down- loadable docs. And we have our ecommerce site, which is integrated into MAS200, our ERP system. On the original web site (on the isp's sever) are links to the other two servers. This is all fine. This system works, it's not the most efficient, but it works. I am setting up a new server to host my web site, which will include the downloadable docs (thus I will be removing that extra sever from all this), and will co-locate it at my isp's office. (Rather than have them host my site on their server.) Okay, so the web site on my new server is a mirror of the existing site on my isp's server. That existing site has no problem linking to and logging into the remote ecommerce server. But, my new server is the one with the problem. The isp's server is running php-4.2.2. Mine is running 4.2.3. So, the same web page can access the remote ecommerce server fine on the isp's system, but not on mine. I have a call in to the isp's tech support, I'll try to get a copy of their php.ini and find out what is differant between theirs and mine. -- Chip Jason Wong [EMAIL PROTECTED] wrote on 02/14/2003 10:08:45 PM: On Saturday 15 February 2003 05:01, [EMAIL PROTECTED] wrote: I have an ecommerce app (MAS200 eBusiness Manager) that works. I am updating my web site to php frames. Now when I want to connect to the eBusiness Manager server Presumably you mean connect to that app with some php code? I get this error: Unsupported Browser The browser you are using (PHP/4.2.3) is currently unsupported. Please update your browser to the most current level. This happens regardless of the browser I am using. How can I get this to send the actual browser info, not this php info in its place? The error comes from some php code accessing that app and has nothing to do with whatever browser you're using. Find out what browsers that app is satisfied with, then set 'user_agent' in php.ini to match that of one of the compatible browsers. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* The Usenet news is out of date */ -- 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] browser identification problem
I have an ecommerce app (MAS200 eBusiness Manager) that works. I am updating my web site to php frames. Now when I want to connect to the eBusiness Manager server I get this error: Unsupported Browser The browser you are using (PHP/4.2.3) is currently unsupported. Please update your browser to the most current level. This happens regardless of the browser I am using. How can I get this to send the actual browser info, not this php info in its place? -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (Then why do I have 8? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php pages broken after moving to a newer version
Jason Wong [EMAIL PROTECTED] wrote on 02/05/2003 09:38:48 PM: On Thursday 06 February 2003 07:13, [EMAIL PROTECTED] wrote: 1) Read the changelog/history/release notes of all versions of php between the 4.0.3 and up to 4.2.3 2) Check the php log (turn on full error reporting). The log is 23 pages long and doesn't to all the way back to 4.0.3. Could you perhaps give me a hint as to something else to look for in the log? OK, first you need to see what PHP is choking on. Only way to do that is to do (2) above. So once you know what errors PHP is giving out you do (1) to see whether anything has changed to cause this behaviour. Okay, so I have turned on all the error handling options in /usr/local/etc/php.ini-dist. I have purposely put an error in my phpinfo.php page, it errors out in the browser, but no error log is created. My index.php page does not load and does not provide any errors. I set the error log to go into the /tmp directory, after trying /var/log and also my own home directory, it just will not be created in any of them. NB if PHP doesn't give any errors, then it would suggest to me that your code logic is broken. If the page works fine in php-4.0.3 then I don't see how it can be broken. This is frustrating. You can see the page at the link below. I have pasted my /usr/local/etc/php.ini-dist below. If it would help I can also add my index.php that is having problems... Regards, -- Chip W www.simradusa.com [PHP] ;;; ; WARNING ; ;;; ; This is the default settings file for new PHP installations. ; By default, PHP installs itself with a configuration suitable for ; development purposes, and *NOT* for production purposes. ; For several security-oriented considerations that should be taken ; before going online with your site, please consult php.ini-recommended ; and http://php.net/manual/en/security.php. ;;; ; About this file ; ;;; ; This file controls many aspects of PHP's behavior. In order for PHP to ; read it, it must be named 'php.ini'. PHP looks for it in the current ; working directory, in the path designated by the environment variable ; PHPRC, and in the path that was defined in compile time (in that order). ; Under Windows, the compile-time path is the Windows directory. The ; path in which the php.ini file is looked for can be overridden using ; the -c argument in command line mode. ; ; The syntax of the file is extremely simple. Whitespace and Lines ; beginning with a semicolon are silently ignored (as you probably guessed). ; Section headers (e.g. [Foo]) are also silently ignored, even though ; they might mean something in the future. ; ; Directives are specified using the following syntax: ; directive = value ; Directive names are *case sensitive* - foo=bar is different from FOO=bar. ; ; The value can be a string, a number, a PHP constant (e.g. E_ALL or M_PI), one ; of the INI constants (On, Off, True, False, Yes, No and None) or an expression ; (e.g. E_ALL ~E_NOTICE), or a quoted string (foo). ; ; Expressions in the INI file are limited to bitwise operators and parentheses: ; |bitwise OR ; bitwise AND ; ~bitwise NOT ; !boolean NOT ; ; Boolean flags can be turned on using the values 1, On, True or Yes. ; They can be turned off using the values 0, Off, False or No. ; ; An empty string can be denoted by simply not writing anything after the equal ; sign, or by using the None keyword: ; ; foo = ; sets foo to an empty string ; foo = none; sets foo to an empty string ; foo = none ; sets foo to the string 'none' ; ; If you use constants in your value, and these constants belong to a ; dynamically loaded extension (either a PHP extension or a Zend extension), ; you may only use these constants *after* the line that loads the extension. ; ; All the values in the php.ini-dist file correspond to the builtin ; defaults (that is, if no php.ini is used, or if you delete these lines, ; the builtin defaults will be identical). ; Language Options ; ; Enable the PHP scripting language engine under Apache. engine = On ; Allow the ? tag. Otherwise, only ?php and script tags are recognized. short_open_tag = On ; Allow ASP-style % % tags. asp_tags = Off ; The number of significant digits displayed in floating point numbers. precision= 12 ; Enforce year 2000 compliance (will cause problems with non-compliant browsers) y2k_compliance = Off ; Output buffering allows you to send header lines (including cookies) even ; after you send body content, at the price of slowing PHP's output layer a ; bit. You can enable output buffering during runtime by calling the output ; buffering functions. You can also enable output buffering for all files by ; setting this directive to On. If you wish to limit the size of the buffer ; to a certain size - you can use a maximum number of bytes instead of
Re: [PHP] php pages broken after moving to a newer version
Goetz Lohmann [EMAIL PROTECTED] wrote on 02/06/2003 08:09:19 AM: Chip Wiegand schrieb: Okay, so I have turned on all the error handling options in /usr/local/etc/php.ini-dist. I have purposely put an error in my phpinfo.php page, it errors out in the browser, but no error log is created. My index.php page does not load and does not provide any errors. I set the error log to go into the /tmp directory, after trying /var/log and also my own home directory, it just will not be created in any of them. change php.ini NOT php.ini-dist which not will be loaded !!! Thanks so much. I copied that file to php.ini and now all is well. -- Chip and be sure you change the php.ini which is used (maybe there might be more than one php.ini in your system but only one is use ... find this out with phpinfo !) [phpinfo.php] ?php phpinfo(); ? -- @ Goetz Lohmann, Germany | Web-Developer Sys-Admin \/ -- () He's the fellow that people wonder what he does and || why the company needs him, until he goes on vacation. -- 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] php pages broken after moving to a newer version
I have a web site on a server running freebsd-4.2/mysql-3.23.10/php-4.0.3pl1. I am replacing that machine with a new box running freebsd-4.7/mysql-3.23.52/php-4.2.3. After copying the web site to the new server some pages no longer include the 'include' pages. I am using php frames. I load the index page, it's just blank, white. I can load the included pages manually through the url and they load okay. I am wondering if there is something in the php config file I need to set for the include path, but when I was in that file I didn't see any such setting, like in the earlie versions of php. Any suggestions? Regards, -- Chip Wiegand Computer Services Simrad, Inc www.simradusa.com [EMAIL PROTECTED] There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corporation, 1977 (Then why do I have 8? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php pages broken after moving to a newer version
Jason Wong [EMAIL PROTECTED] wrote on 02/05/2003 12:49:16 PM: On Thursday 06 February 2003 04:41, [EMAIL PROTECTED] wrote: After copying the web site to the new server some pages no longer include the 'include' pages. I am using php frames. I load the index page, it's just blank, white. I can load the included pages manually through the url and they load okay. I am wondering if there is something in the php config file I need to set for the include path, but when I was in that file I didn't see any such setting, like in the earlie versions of php. 1) Read the changelog/history/release notes of all versions of php between the 4.0.3 and up to 4.2.3 2) Check the php log (turn on full error reporting). I checked the change log for all instances of 'include' but found nothing relevant. The log is 23 pages long and doesn't to all the way back to 4.0.3. Could you perhaps give me a hint as to something else to look for in the log? -- Chip -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Woodward's Law: A theory is better than its explanation. */ -- 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] form box question
Just a suggestion - you might want to disable the ability to input html code in the messages, as a precautionary messure. I tested the script and was able to make a mess of the page after submitting. -- Chip Anthony Ritter [EMAIL PROTECTED] 01/13/2003 09:07 AM To [EMAIL PROTECTED] cc bcc Subject [PHP] form box question Hi, I'm testing the following form on: MS Win98 / IE 5.5 / PHP 4.0 / Apache and it works fine. However...when I publish the ..php file and the data.txt file on the ISP's MS IIS server, I get undeclared variables and indexes when the form page loads. The script follows. Any help would be greatly appreciated. Thank you. Tony Ritter .. // form.php html head style body {background-color:beige; body { scrollbar-base-color: #FCF6DC; scrollbar-face-color: #E3DBB5; scrollbar-track-color: #FCF6DC; scrollbar-arrow-color: #000; scrollbar-highlight-color: #fff; scrollbar-3dlight-color: #7B6D29; scrollbar-shadow-color: #7B6D29; scrollbar-darkshadow-color: #E3DBB5; } border:5px solid black; } textarea {border:1pt solid red; background-color:white; color:black; } textarea p{font-size:12px; } table {border:1pt solid black; width:700px; font-size:10px; background-color:#E3DBB5; color:#7B6D29; } input {border:1pt solid solid red; background-color:white; color:black;} ..submit { background-color:#80; color:white;} p {font-family:arial; font-size:12px; } hr { color:#80; } A:link:{text-decoration:none; color:#7B6D29;} A:visited:{text-decoration:none; color:#7B6D29;} A:hover:{text-decoration:underline; color:green} /style /head body ? function WriteToFile ($thecomments,$thename,$theemail) { $TheFile = data.txt; $Open = fopen ($TheFile, a+); if ($Open) { fwrite ($Open, $thecomments\t$thename\t$theemail\n); fclose ($Open); $Worked = TRUE; } else { $Worked = FALSE; } return $Worked; } function ReadTheFile() { $TheFile=data.txt; $Open=fopen($TheFile,r); if ($Open) { print(hr); print(PiSome of the messages have been:/i\n); $Data=file($TheFile); for($n=0; $ncount($Data); $n++) { $getline=explode(\t,$Data[$n]); print(table); print(tr); print(tdP$getline[0]/P/TD\n); print(/tr); print(tr); print(TDP$getline[1]/P/TD\n); print(/tr); print(tr); print(TDa href=mailto:$getline[2]P$getline[2]/P/a\n); print(/tr); print(/P); print(/table); } //end for loop fclose($Open); } //end if else { print(Unable to read data.txt); } } //end function function createform() { print(form action=\form.php\ method=post\n); print(PSo...How did buyou/u/b like EagleFest 2003?:BR textarea name=\comments\ rows=3 cols=85/textarea brbr\n); print(Your name:nbspinput type=text name=\yourname\ size=30\n); print(Your e-mail:nbspinput type=text name=\youremail\ size=30\n); print(input type=hidden name=\beensubmitted\ value=\TRUE\\n); print(input type=submit name=\submit\ span class=\submit\ value=\click to submit\\n); print(/form\n); } function handleform() { global $comments; global $yourname; global $youremail; $comments=stripslashes($comments); $yourname=stripslashes($yourname); $youremail=stripslashes($youremail); $callfunction=WriteToFile($comments,$yourname,$youremail); if($callfunction) { print(p align=\center\nbsp;/p); print(p align=\center\nbsp;/p); print(p align=\center\nbsp;/p); print(p align=\center\nbsp;/p); print(p align=\center\nbsp;/p); print(P align=\center\font size=3 color=\#80\BThank you for your comments about EagleFest 2003./text/B/font/P); }//end if else { print(Your submission was not processed.); } //end else } if($beensubmitted) { handleform(); } else { createform(); ReadTheFile(); } ? /body /html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Simple HTML-Form Question
Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 00:09:58 +0200: register_globals defaults now to off. Use the superglobals instead. ? if (isset($_GET['name'])) { echo Hallo .$GET['name']; } else { echo FORM action='test.php' method=get input type=text name=name input type=submit name=action value=sendit; } ? Sascha The value of name for the submit button is wrong - it should be the same as the value you gave the isset statement, in this case it should be input type=submit name=name value=sendit Better yet is to use isset($submit) and the value for the submit statement is also name=submit - input type=submit name=submit value=sendit of course value is optional. So you end up with this - ? if (isset($_GET['submit'])) { echo Hallo .$GET['name']; } else { echo FORM action='test.php' method=get input type='text' name='name' input type='submit' name='submit' value='sendit'; } ? -- Chip Am Sonntag, 13. Oktober 2002 23:40 schrieb Lars H. Korte: Hi, I've updated to PHP 4.2.3 and wrote this simple Script: ? if (isset($name)) { echo Hallo $name; } else { echo FORM action='test.php' method=get input type=text name=name input type=submit name=action value=sendit; } ? I would expect the following: The site starts with the form, then I enter my name (Lars) and click the send-button. Then the script says Hello Lars. The actual output is: The site starts with the form, I enter my name and click the button, then the form keeps being there, no Hello-message. Has there changed something in PHP-Coding since I've learned it a few years before? There seems to be a diffrence between clicking the send button and pressing Enter. Has this always been so? regards Lars -- 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] Simple HTML-Form Question
Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53 +0200: This beautifies it (even makes it a bit more secure), but one doesn't need it really; should have worked without these changes, too. (Of course, it's better to include these changes) Sascha No it shouldn't have worked the way you had it originally. The isset statement HAS to have the same value as the submit buttom name or it won't work at all. As for the beautify part, that's just the way I write my code, that doesn't matter at all to whether or not the script will work. -- Chip The value of name for the submit button is wrong - it should be the same as the value you gave the isset statement, in this case it should beinput type=submit name=name value=sendit Better yet is to use isset($submit) and the value for the submit statement is also name=submit - input type=submit name=submit value=sendit of course value is optional. So you end up with this - ? if (isset($_GET['submit'])) { echo Hallo .$GET['name']; } else { echo FORM action='test.php' method=get input type='text' name='name' input type='submit' name='submit' value='sendit'; } ? -- 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
Fw: Re: [PHP] Simple HTML-Form Question
Yep, I've been going over this with John off-list, I learned something new tonite. One thing about his script - it doesn't print the text entered in the box, it only prints the work Hallo. To fix that would require adding . $name; to the end of the echo statement. Regards, -- Chip Edwin wrote this stuff back on Mon, 14 Oct 2002 11:55:28 +0900: Hello, Just for the sake of the argument... On Monday, October 14, 2002 10:44 AM Chip Wiegand wrote: Sascha Cunz wrote this stuff back on Mon, 14 Oct 2002 01:13:53 +0200: This beautifies it (even makes it a bit more secure), but one doesn't need it really; should have worked without these changes, too. (Of course, it's better to include these changes) Sascha No it shouldn't have worked the way you had it originally. The isset statement HAS to have the same value as the submit buttom name or it won't work at all. Yes it will. Try it. ;) Of course, I didn't mean to say that it will work the way you want it. I just wanted to say that it would still work even though the isset statement doen't have the same value with the submit button. Remember, isset() is basically a function to check if something is set or not... So, changing this if (isset($_GET['submit'])) to this if (isset($_GET['name'])) will have a similar result (for the short code discussed here). - E PS Typo: (should be $_GET['name']) echo Hallo .$GET['name']; As for the beautify part, that's just the way I write my code, that doesn't matter at all to whether or not the script will work. -- Chip The value of name for the submit button is wrong - it should be the same as the value you gave the isset statement, in this case it should beinput type=submit name=name value=sendit Better yet is to use isset($submit) and the value for the submit statement is also name=submit - input type=submit name=submit value=sendit of course value is optional. So you end up with this - ? if (isset($_GET['submit'])) { echo Hallo .$GET['name']; } else { echo FORM action='test.php' method=get input type='text' name='name' input type='submit' name='submit' value='sendit'; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Looking for a forum
On Wed, 2002-09-25 at 22:26, John Taylor-Johnston wrote: Hi, I'm looking for some forum script, a bit like this: http://www.chevelles.com/cgi-bin/forum/Ultimate.cgi Can anyone post a link to something useful? John I set up phpBB on my company web site. It was easy to set up and has all the features you could want. -- Chip -- 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] Editor
On Sat, 2002-09-21 at 06:15, Bryan McLemore wrote: Hi guys, just wondering if anyone could recomend a good editor that is based on windows. Thanks, Bryan HTML-Kit by Chami software (www.chami.com) - saves in unix format or windoze format, extremely configurable, direct uploads/downloads/editing of files on the remote server, built in Tidy, etc etc. -- Chip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] installing php-4.2.1 fails in make
I am installing from source php-4.2.1 and have apache-2.0.39 installed and working. When I ran make on php I ended with this message: - include/mysql -I/usr/local/php-4.2.1/ext/xml/expat -D_REENTRANT -D_THREAD_SAFE -I/usr/local/php-4.2.1/TSRM -g -O2 -pthread -DZTS -prefer-pic -c php_functions.c php_functions.c:93: syntax error *** Error code 1 Stop in /usr/local/php-4.2.1/sapi/apache2filter. *** Error code 1 Stop in /usr/local/php-4.2.1/sapi/apache2filter. *** Error code 1 Stop in /usr/local/php-4.2.1/sapi. *** Error code 1 Stop in /usr/local/php-4.2.1. --- Is there some issue here between the latest versions of apache and php? -- Chip [EMAIL PROTECTED] www.wiegand.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can php Read contents from MS Word in Exactly same format
On Mon, 04 Feb 2002 01:29:11 -0500 Jason G. [EMAIL PROTECTED] wrote: MS Word is a proprietary, binary (i think), format... Have fun. There may be a solution out there. If you could convince her to save it in Rich Text Format (rtf) and then upload it, your life would be much easier... -Jason Garber Another option - have her save it as html in word. sure the code it creates is ugly and basically unedible rubbish, but it will display correctly. I have a similar situation where the marketing people post a once a month dealer newsletter, just a simple single-column 1 to 2 page affair. I just got in the habbit of having them email me the .doc and then I convert it to html myself. Takes all of 5 minutes or so and it clean code. -- Chip At 01:51 PM 2/4/2002 +0800, Jack wrote: Dear all I had made a news input page for one of the HR Manger to input the news for the whole company to read, she is quick comfort with using MS word as a editor, so is there anyway that the php can read the contents from the MS Word and display as exactly same format to html? If there is so, could any one suggest a book to me? Thx a lot Jack [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Can PHP do what this javascript does...
iTo print/i: a href=javascript:if (window.print != null) { window.print(); } else { alert('Unfortunately, your browser does not support this shortcut. Please select Print from the File menu.'); } bClick here/b/a ior/i Select bFile/b and then bPrint/b from your browser's menu. Is there an equivelant bit of code to do this printer shortcut with php? -- Chip Wiegand Computer Services www.simradusa.com [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Can PHP do what this javascript does...
Thanks for all the reponses. I know that php is server-side only, and that certain things like mouse-overs, are client-side, wasn't sure about the printer function though. I could have assumed it was, but I try not to assume anything, but always ask to make sure. Regards, Chip Mike Eheler [EMAIL PROTECTED] on 10/24/2001 10:31:30 PM Internet mail from: To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: Re: [PHP] Can PHP do what this javascript does... There's a really long method of doing it that would work, but would involve server-side browser detection, and a database containing a list of browsers that support print shortcuts. Stick with the JS. Mike [EMAIL PROTECTED] wrote: iTo print/i: a href=javascript:if (window.print != null) { window.print(); } else { alert('Unfortunately, your browser does not support this shortcut. Please select Print from the File menu.'); } bClick here/b/a ior/i Select bFile/b and then bPrint/b from your browser's menu. Is there an equivelant bit of code to do this printer shortcut with php? -- Chip Wiegand Computer Services www.simradusa.com [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] date/time of current page
I want to put, into a footer include file, the last modified date of the current file being viewed. I have the following code that works when I hard code the file name - ? $dt=date(D, F d, Y g:i:s A, filemtime(index.php)); echo $dt; ? But of course that won't work as a footer for a site with over two hundred pages. What is the parameter for the current page? I tried php_self but that didn't work properly (it returned Dec 31 1969). -- Chip Wiegand Simrad, Inc [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] date/time of current page
Jack Dempsey [EMAIL PROTECTED] on 09/11/2001 11:42:07 PM Internet mail from: To: [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject: RE: [PHP] date/time of current page have you tried parsing out the name from $PHP_SELF? I would think that php wouldn't care if it gets 'index.php' or (some processing) index.php, know what i mean? jack I'm not sure what you mean, but here is what I have tried - ? $dt=date(m/d/y g:i:s A, filemtime($PHP_SELF)); echo $dt; ? I also quoted the string $PHP_SELF with the same results, which look like this - 12/31/69 4:00:00 PM So, just what am I doing wrong? -- Chip -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 11, 2001 1:01 PM To: [EMAIL PROTECTED] Subject: [PHP] date/time of current page I want to put, into a footer include file, the last modified date of the current file being viewed. I have the following code that works when I hard code the file name - ? $dt=date(D, F d, Y g:i:s A, filemtime(index.php)); echo $dt; ? But of course that won't work as a footer for a site with over two hundred pages. What is the parameter for the current page? I tried php_self but that didn't work properly (it returned Dec 31 1969). -- Chip Wiegand Simrad, Inc [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] date/time of current page
Michael Geier, CDM Systems Admin [EMAIL PROTECTED] on 09/11/2001 11:46:50 PM Internet mail from: To: Jack Dempsey [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] cc: Subject: RE: [PHP] date/time of current page script language=javascript document.write('some text ' + document.lastmodified + ' some other text.'); /script Surely it can be done in PHP, which doesn't, of course, depend on whether or not the visitor has some options disabled or enabled in their browser. -- Chip -Original Message- From: Jack Dempsey [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 11, 2001 4:42 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [PHP] date/time of current page have you tried parsing out the name from $PHP_SELF? I would think that php wouldn't care if it gets 'index.php' or (some processing) index.php, know what i mean? jack -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 11, 2001 1:01 PM To: [EMAIL PROTECTED] Subject: [PHP] date/time of current page I want to put, into a footer include file, the last modified date of the current file being viewed. I have the following code that works when I hard code the file name - ? $dt=date(D, F d, Y g:i:s A, filemtime(index.php)); echo $dt; ? But of course that won't work as a footer for a site with over two hundred pages. What is the parameter for the current page? I tried php_self but that didn't work properly (it returned Dec 31 1969). -- Chip Wiegand Simrad, Inc [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] date/time of current page
Thankyou, that works fine. -- Chip Jack Dempsey [EMAIL PROTECTED] on 09/12/2001 12:03:20 AM Internet mail from: To: [EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject: RE: [PHP] date/time of current page I'm not sure what you mean, but here is what I have tried - try this: ? echo date(m/d/y g:i:s A, filemtime(substr($PHP_SELF,strrpos($PHP_SELF,'/')+1))) ? jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] nav buttons not working correctly
/h2); printf(strongDate:/strong %s\n, $row[bulletin_date]); printf(br /\nstrongNumber:/strong %s\n, $row[bulletin_number]); printf(br /\nstrongSubject:/strong %s\n, $row[bulletin_subject]); printf(br /\nstrongFrom:/strong %sbr /%s\n, $row[bulletin_from1], $row[bulletin_from2]); print(/td\ntd valign=\top\ align=\left\\n); print(font face=\Arial Black\ size=\+6\SIMRAD/font\n); print(br /\nfont size=\3\nbsp;nbsp;nbsp;A strongKONGSBERG/strong Company/font\n/center\n); print(br /Simrad Inc.\n); print(br /19210-33suprd/sup Avenue West, Suite A\n); print(br /Lynnwood, WA 98036\n); print(br /U.S.A.\n); print(br /Telephone: 1-425-778-8821\n); print(br /Telefax: 1-425-771-7211\n); print(br /\nbr /\n/td\n/tr); printf(tr\ntd colspan=2%s\n, $row[body]); print(br /\nhr width=\75%\ /\n); } else: printf(trtd* a href='bulletin_out.php?news_id=$row[news_id]'%s/anbsp;nbsp;nbsp;%sbr /nbsp;nbsp;nbsp;%s/td/tr, $row [bulletin_subject], $row[bulletin_date], $row[bulletin_from1]); endif; } function nav($offset=0,$this_script=bulletin_sorter.php) { global $php_self; $page_limit = 5; if (empty($this_script)) { $this_script = $php_self; } if (empty($offset)) { $offset = 0; } $result3 = mysql_query(select count(*) from dbulletins); list($total_rows) = mysql_fetch_array($result3); print p\n; if ($offset 0 ) { print a href=\$this_script?offset=.($offset-page_limit).\lt;lt;Previous/a nbsp; ; } if ($offset+page_limit $total_rows) { print a href=\$this_script?offset=.($offset+page_limit).\Nextgt;gt;/a nbsp; ; } print /p\n; } ? /table ? nav(); ? /body /html -- Thanks for any help you all can provide, Chip Wiegand Computer Services www.simradusa.com [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 There is no reason anyone would want a computer in their home. --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Why doesn't this work? Please trouble-shoot my script.
Hi, Maybe someone can take a look at the script below and tell how to make the bottom part work the same way the top part works. The top part (select box) works where the one item chosen is written to a hidden file and passed on to the next page, then on and on through several more pages and to the last page that emails the chosen items to our marketing dept. Problem is, it only allows one choice at a time. I tried it with the multiple option set but the final form shows only the last item chosen from the list of multiple items. So I tried with the checkboxes, but that doesn't work at all. !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" html head titleSimrad USA Brochures Request Page/title /head body form method = post action = 'form_combos.php' ? $name; $value; while (list($name, $value) = each($HTTP_POST_VARS)) { echo "input type=\"hidden\" value=\"$value\" name=\"$name\"\n"; } ? Please choose the brochures you are interested in receiving. select name = 'listbox1' option selected value = ''Select .../option optionAP11/option optionAP12/AP14/option optionAP20 Series/option optionAP35/option optionAP45/option optionAP9MK3/option optionTiller/Wheel Pilots/option optionWP5000/option /selectbr /br / br / br / input type="checkbox"AP11br / input type="checkbox"AP12/14br / input type="checkbox"AP20 Seriesbr / input type="checkbox"AP35br / input type="checkbox"AP45br / input type="checkbox"AP9MK3br / input type="checkbox"Tiller/Wheelpilotsbr / input type="checkbox"WP5000br / br / br / input type = submit /form /body /html --- On the checkboxes I had at first specified the name and value fields, but that didn't work either. My goal is to have the above list allow multiple choices that are passed to the next page, and so on through about 6 pages to the final page. Even better yet would be a text box where the end-user could specify a quantity of brochures, for multiple choices, that would be my preferred form. Thankyou for your help, Chip Wiegand Computer Services [EMAIL PROTECTED] Simrad, Inc Lynnwood, WA 425-712-1138 "There is no reason anyone would want a computer in their home." --Ken Olson, president, chairman and founder of Digital Equipment Corp., 1977 (-- Then why do I have nine? Somebody help me!) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]