[PHP-DB] Print
Hi, I have a pressing problem with regards to printing. My situation is as follows: 1) I have a form in a table format with the following headers: | No. | Date | Contents | Remarks | 2) the fields under Contents and Remarks are textareas to allow users to type as much as they want. 3) after submitting the form, user will click on a button that will activate window.print() to print the form 4) however, sometimes user types too much and the information spills over to two or more pages. 5) user thus wish to also have the headers of the table repeated on the subsequent pages. So, my problem is, how can I know when the information will be more than a page? is there a way in PHP to calculate the number of lines output and then I can force a page-break? please help me. thank you soo soo much! regards, hwee hwee
[PHP-DB] Re: Subject: Print
This is NOT a PHP question, or even a Javascript question - it's basic HTML and CSS. You must read here http://www.dillonsoftware.com/essays/printing.jsp point #3 And here on A ListApart : http://www.alistapart.com/discuss/goingtoprint/6/ But please do not post basic HTML questions to the PHP lists unless you intend to use PHP/Windows native print functions. A little web research will also help. Cheers - Neil At 08:05 09/09/2004 +, you wrote: From: Ng Hwee Hwee [EMAIL PROTECTED] To: PHP DB List [EMAIL PROTECTED] Date: Thu, 9 Sep 2004 16:05:55 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary==_NextPart_000_021B_01C49686.E3359460 Subject: Print Hi, I have a pressing problem with regards to printing. My situation is as follows: 1) I have a form in a table format with the following headers: | No. | Date | Contents | Remarks | 2) the fields under Contents and Remarks are textareas to allow users to type as much as they want. 3) after submitting the form, user will click on a button that will activate window.print() to print the form 4) however, sometimes user types too much and the information spills over to two or more pages. 5) user thus wish to also have the headers of the table repeated on the subsequent pages. So, my problem is, how can I know when the information will be more than a page? is there a way in PHP to calculate the number of lines output and then I can force a page-break? please help me. thank you soo soo much! regards, hwee hwee CaptionKit http://www.captionkit.com : Production tools for accessible subtitled internet media, transcripts and searchable video. Supports Real Player, Quicktime and Windows Media Player. VideoChat with friends online, get Freshly Toasted every day at http://www.fresh-toast.net : NetMeeting solutions for a connected world. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Newsletter and smtp
Dear friends, While sending newsletter, using mailing list, php script is able to connect to database, retrieve emails, however is unable to send newsletter or email. I am using localhost. I have SMTP installed on local machine. Any guidance Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to send mail from your AOL screen name. http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44 newsletter sent to: [EMAIL PROTECTED] Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to send mail from your AOL screen name. http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44 newsletter sent to: [EMAIL PROTECTED] Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to send mail from your AOL screen name. http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44 newsletter sent to: [EMAIL PROTECTED] -- script to send mail ?php if ($_POST[op] != send) { //haven't seen the form, so show it print HTML HEAD TITLESend a Newsletter/TITLE /HEAD BODY h1Send a Newsletter/h1 form method=\post\ action=\$_SERVER[PHP_SELF]\ PstrongSubject:/strongbr input type=\text\ name=\subject\ size=30/p PstrongMail Body:/strongbr textarea name=\message\ cols=50 rows=10 wrap=virtual/textarea input type=\hidden\ name=\op\ value=\send\ pinput type=\submit\ name=\submit\ value=\Send It\/p /FORM /BODY /HTML; } else if ($_POST[op] == send) { //want to send form, so check for required fields if (($_POST[subject] ==) || ($_POST[message] == )) { header(Location: sendmymail.php); exit; } //connect to database $conn = mysql_connect(localhost, , ) or die(mysql_error()); mysql_select_db(b,$conn) or die(mysql_error()); //get emails from subscribers list $sql = select email from subscribers1; $result = mysql_query($sql,$conn) or die(mysql_error()); //create a From: mailheader $headers = [EMAIL PROTECTED]\n; //loop through results and send mail while ($row = mysql_fetch_array($result)) { set_time_limit(0); $email = $row['email']; mail($email, stripslashes($_POST[subject]), stripslashes($_POST[message]), $headers); print newsletter sent to: $emailbr; } } ?
[PHP-DB] grid unsetting vars
We'll I've got a query based on mysql_fetch_object to show the results of the previous search and print them out in tables. Then I got the the $grid idea for printing an array in a horizontally columned table from the book php cookbook from o'reilly (quite useful) then I print it all insed the grid, but when it is supposed to send the selected objects with a checkbox to the next page. It doesn't while everything works just fine without the grid. #sigh# I've tried to see what's the grid doing to my checkboxes that i the end they don't send anything at all bu i cant see what. Does anyone? ... while ($inb = mysql_fetch_object($resultInfs)) { //trying to put it right --- values --- if (!empty($inb-pix)) $ipix=img src='$inb-pix' width='200'br; } else { $ipix=img src='notaval.gif' width='200'br; } if (!empty($inb-infType)) { $ity=$inb-infType,br; } if (!empty($inb-infName)) { $inm=$inb-infNamebr; } if (!empty($inb-infRef)) { $irf=$inb-infRefbr; } if (!empty($inb-infMeas)) { $ims=$inb-infMeasbr; } if (!empty($inb-infSerial)) { $isr=strongSERIAL N°: $inb-infSerial/strongbr; } if (!empty($inb-infDescription)) { $ids=DETAILS: $inb-infDescription,br; } if (!empty($inb-infArtw)) { $irt=$inb-infArtw,br; } if (!empty($inb-infCover)) { $irc=$inb-infCover,br; } // T.T $value deosn't go as $_POST for orderdata.php!!! $value = $inb-infID; //for function, hope as objects $infs[ ] = $ipix.' '.$ity.' '.$inm.' '.$irf.' '.$ims.' '.$isr.' '.$ids.' '.$irt.' '.$irc.' '.$value; } ///changes to function from phpckbk function grid_horizontal($array, $size) { // compute td width %ages $table_width = 100; $width = intval($table_width / $size); $grid = table width=\$table_width%\ border=\1\ bordercolor=\#FF\form action=\orderdata.php\ method=\POST\ name=\details\$tr; // define how our tr and td tags appear // sprintf() requires us to use %% to get literal % $tr = 'tr align=center'; $td = td width=\$width%%\%sinput name=\$value\ type=\checkbox\ value=\$value\Add to Cart!/td; // open table // loop through entries and display in rows of size $sized // $i keeps track of when we need a new table tow $i = 0; foreach ($array as $e) { $grid .= sprintf($td, $e); $i++; // end of a row // close it up and open a new one if (!($i % $size)) { $grid .= /tr$tr; } } // pad out remaining cells with blanks while ($i % $size) { $grid .= sprintf($td, 'nbsp;'); $i++; } // add /tr, if necessary $end_tr_len = strlen($tr) * -1; if (substr($grid, $end_tr_len) != $tr) { $grid .= '/tr'; } else { $grid = substr($grid, 0, $end_tr_len); } // close table $grid .= 'input name=submit type=submit value=ORDER/form/table'; return $grid; } //final results printing $grid = grid_horizontal($infs, 3); print $grid; If the grid can not work with a sending to another php (that is with my checkboxes, how could i print them ordered then? - Créez gratuitement votre Yahoo! Mail avec 100 Mo de stockage ! Créez votre Yahoo! Mail Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer instantanément avec vos amis.Téléchargez GRATUITEMENT ici !
Re: [PHP-DB] mySQL searching through serialized arrays
On Tuesday 07 September 2004 12:14, rolando g wrote: I am storing array of user IDs as TEXT using the serialize() function on the array, since several users, one or none can be part of each record... and I noticed that the serialized array has the values in double quotes like :21; for example... so since I know that the values will be enclosed, i am using the sql statement, with 21 as the example variable: SELECT FROM table WHERE userarray LIKE '%\21\%' is there a better way or a built-in mySQL function to filter through the serialized array You're not using the database properly. Have a separate table where each record contains a user_id and the record_id to which it is linked. -- 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-db -- /* T-shirt: Life is *not* a Cabaret, and stop calling me chum! */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] grid unsetting vars
From: Sancerni Veronica [EMAIL PROTECTED] when it is supposed to send the selected objects with a checkbox to the next page. It doesn't while everything works just fine without the grid. [snip] $td = td width=\$width%%\%sinput name=\$value\ type=\checkbox\ value=\$value\Add to Cart!/td; While stab in the dark here, since I don't really know what you're after and I'm not reading through all of your code. If you don't name checkboxes as an array, you'll only ge the last checkbox value passed to PHP. You should name them like this: input type=checkbox name=value[] value=1 input type=checkbox name=value[] value=2 etc... Then you'll have $_POST['value'] as an array you can loop through. This may not matter for your code if $value is different each time and doesn't match any other form elements, though. How do you know this doesn't work? If you do a print_r($_REQUEST), do you see any of your checkbox values being passed?? ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Newsletter and smtp
From: [EMAIL PROTECTED] While sending newsletter, using mailing list, php script is able to connect to database, retrieve emails, however is unable to send newsletter or email. I am using localhost. I have SMTP installed on local machine. Any guidance Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to send mail from your AOL screen name. http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44 AOL may not allow you to operate your own SMTP server. You may have to get permission or use special ports like the error message says. Why not set the SMTP value in php.ini to the AOL SMTP server instead of trying to run your own? ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Newsletter and smtp
Dear friends, I have pasted INI file and error its giving, while sending newsletter.Any guidance, please. -- Warning: mail(): SMTP server response: 554 5.7.1 (IPT:OA) Use port 587 to send mail from your AOL screen name. http://postmaster.info.aol.com/errors/554iptoa.html in C:\HOME\doctorbush\sendmymail.php on line 44 newsletter sent to: [EMAIL PROTECTED] Warning: mail(): Failed to connect to mailserver at smtp.aol.com port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\HOME\doctorbush\sendmymail.php on line 44 newsletter sent to: [EMAIL PROTECTED] Warning: mail(): Failed to connect to mailserver at smtp.aol.com port 25, verify your SMTP and smtp_port setting in php.ini or use ini_set() in C:\HOME\doctorbush\sendmymail.php on line 44 newsletter sent to: [EMAIL PROTECTED] --- [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. ; NOTE: Using short tags should be avoided when developing applications or ; libraries that are meant for redistribution, or deployment on PHP ; servers which are not under your control, because short tags may not ; be supported on the target server. For portable, redistributable code, ; be sure not to use short tags. 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 = On ; 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 'On', as ; a value for this directive (e.g., output_buffering=4096). output_buffering = Off ; You can redirect all of the output of your scripts to a function. For ; example, if you set output_handler to
[PHP-DB] ODBC Column Name Truncation
When retrieving ODBC results from Sybase SQL Anywhere 6 and 9, the column names are being truncated to 31 characters. -- ?php $DBN = 'thedbn'; $UID = 'theuid'; $PWD = 'thepws'; $CONN = odbc_connect( $DBN, $UID, $PWD ) or die( Cannot connect to $DBN.); $sql = select * from crap; $result = odbc_exec( $CONN, $sql ); for( $i = 1 ; $i = odbc_num_fields( $result ) ; $i++ ) { $name = odbc_field_name( $result, $i ); ${$name} = odbc_result( $result, $name ); print( $i: $name - ${$name}\n ); } ? Result: 1: key - 4 2: a_really_long_name_that_is_long - 5 3: longer_name - 6 I expected #2 to have the name: a_really_long_name_that_is_longer_than_31_characters -- This happens even if the column name is simply specified using sql 'AS' (i.e. select column as a_really_long_name_that_is_longer_than_31_characters from crap would still return a_really_long_name_that_is_long as the column name). Using PHP 4.3.4 on Windows 2000 Server. Have also tried on SUSE Linux as well as with PHP 5. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC Column Name Truncation
The reason is because the buffer used by the odbc extension to store field names is only 32 bytes. You can try using the sybase or odbtp extension. Otherwise, you will have to submit it as a bug, so that it will be fixed. -- bob On Thu, 9 Sep 2004, Anthony Robins wrote: When retrieving ODBC results from Sybase SQL Anywhere 6 and 9, the column names are being truncated to 31 characters. -- ?php $DBN = 'thedbn'; $UID = 'theuid'; $PWD = 'thepws'; $CONN = odbc_connect( $DBN, $UID, $PWD ) or die( Cannot connect to $DBN.); $sql = select * from crap; $result = odbc_exec( $CONN, $sql ); for( $i = 1 ; $i = odbc_num_fields( $result ) ; $i++ ) { $name = odbc_field_name( $result, $i ); ${$name} = odbc_result( $result, $name ); print( $i: $name - ${$name}\n ); } ? Result: 1: key - 4 2: a_really_long_name_that_is_long - 5 3: longer_name - 6 I expected #2 to have the name: a_really_long_name_that_is_longer_than_31_characters -- This happens even if the column name is simply specified using sql 'AS' (i.e. select column as a_really_long_name_that_is_longer_than_31_characters from crap would still return a_really_long_name_that_is_long as the column name). Using PHP 4.3.4 on Windows 2000 Server. Have also tried on SUSE Linux as well as with PHP 5. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Please help
Just getting back to this thing. There are 3 files involved, search.php, connections.php and functions.php. I searched through all and couldn't find the meaning of the $sql_ext. $sql is just the sql statement I inserted into the code. Great that I can't get a response from the company. If anyone thinks it would be useful to post the code I will. That is if anyone would want to see and look at it. The weird thing is searching on one table is great. The list (all records) works great. The problem starts when I insert all my joins. Now I've tested and retested the query and I know it's fine. Thank you , Stuart --- Steve Davies [EMAIL PROTECTED] wrote: What's contained in $sql and $sql_ext ??? Stuart Felenstein wrote: I'm using a product called dbqwiksite pro. PHP generator for PHP - MySQL The code seems to be working fine except in my search page where I receive an invalid query $result = mysql_query($sql . . $sql_ext . limit 0,1) or die(Invalid query); This is the place I where the code is taking the die path. I'm guessing something belongs between the quotation marks , just not sure. Anyone ? Thank you Stuart -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php