Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Printing Out Info From A Form


I have this php function that reads a text file for input to create a form. I am trying to get the form to print out the data on a separate page, but all I get is a blank page. Am I calling the page correctly, or is this even possible to do? Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Form Variables Not Printing In E-mail
This is my first attempt at a php-based form at work in order to personalize the form response with the submitter's name. When I submit the form, all that's returned to me via e-mail is the header information. I've been searching google but can't figure out what I've done wrong. The php to process the form is this:

Printing Mysql Auto-increment Key Value On A Form
i need to print off the auto increment key value on a form. How does the syntax go to accompish this. Field name is rrn. Output only.

Printing Form My Host To A Remote Location
Just wondering if anyone knows if it is possible to print direct from a php script on my host to a remote location ie at my house. Also if this is possible is it possible to hold a que until my computer is on.

Php Form Info...
have a form, with a text input "fieldname".
method POST

$var = $_POST["fieldname"]

$var is then used to search in mysql

select * from table where jobtype like '$var%'
OR jobtype like '%$var%'
OR jobtype like '%$var'
OR jobtype like '$var' order by date asc;

basically i'm doing a search for any string that matches the searched
input, being at the beginning, middle or end of the jobtype column.

query works great, except when the string contains the 4-letter word
'info' such as information or informative
then the mysql query breaks down and give the usual:

Error performing query: You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'ORDER BY date ASC' at line 1

Now after much debugging, i found out that the php _POST variable
treats anything with info as a numner of 0 value.
inf is treated as text, nformation is treated as text, but anything
with info gets a 0 value.

Searched php.net and couldn't find anything related to this feature,
looked under security to see if it was related to that, but nothing.

Php Form Info...
have a form, with a text input "fieldname".
method POST

$var = $_POST["fieldname"]

$var is then used to search in mysql

select * from table where jobtype like '$var%'
OR jobtype like '%$var%'
OR jobtype like '%$var'
OR jobtype like '$var' order by date asc;

basically i'm doing a search for any string that matches the searched
input, being at the beginning, middle or end of the jobtype column.

query works great, except when the string contains the 4-letter word
'info' such as information or informative
then the mysql query breaks down and give the usual:

Error performing query: You have an error in your SQL syntax. Check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'ORDER BY date ASC' at line 1

Now after much debugging, i found out that the php _POST variable
treats anything with info as a numner of 0 value.
inf is treated as text, nformation is treated as text, but anything
with info gets a 0 value.

Searched php.net and couldn't find anything related to this feature,
looked under security to see if it was related to that, but nothing.

Can anyone look into it and elaborate?
create a form, then echo the value of the $_POST variable
and try words that contain info in them.

Getting Info Out Of Dynamic Form
I am using the following code to produce a dynamic form.

$result = mysql_query("SELECT id,weight,date FROM weekly_data WHERE
weight IS NULL AND subscr_id = '$toss' AND date <= now()");
if (!$result) {
die('Invalid query: ' . mysql_error());
}
print"<table width=ï`%' id='catchup' border=&#390;' cellspacing=&#390;'
cellpadding=&#390;'>";
print "<form name='form1' id='form1' method='post'
action='catchupprocess.php'>";
print"<tr>";
print"<td></td>";
print"<td>Weight</td>";
print"<td>Date</td>";
print"<td>Waist</td>";
print"<td>Measure</td>";
print"<td></td>";
print"</tr>";
while ($row = mysql_fetch_array ($result)){
//echo $result;
print"<tr>";
print"<td>";
print"<input name='".$row['id']."' size=&#394;' type='text'
value='".$row['id']."'/>";
print"</td><td>";
print"<input type='text' size=&#396;' name='weight".$row['id']."'
value=''/>";
print"</td><td>";
print"<input type='text' size=&#3910;' value='".$row['date']."'/>";
print"</td><td>";
print"<input type='text' size=&#393;' name='waist".$row['id']."'
value=''/>";
print"</td><td>";
print"<input type='text' size=&#396;' value='$measure'/>";
print"</td><td>";
print"<input type='hidden' size=&#3910;' value=''/>";
print"</td>";
print"</tr>";
}
print"<tr>";
print"<td>&nbsp;</td>";
print"<td><input name='Reset' type='reset' value='Reset'></td>";
print"<td>&nbsp;</td>";
print"<td><input name='submitcatchup' type='submit'
value='Submit'></td>";
print"<td>&nbsp;</td>";
print"</tr>";
print"</form>";
print"</table>";
?>

Persistent Form Info
I have some forms that have different parts, and it decides which parts to display through the url ie form.php?showpart=1, showpart=2, etc. If I want to show another part and change the url all the form info goes away.  I'm a self taught PHP guy, I'm decent but not amazing.  My current solution is to use AJAX to write/modify a cookie everytime the user writes something and bring that in when they change the page. Is there an easier way?

Referer And Keyword Info Sent Via Form?
I've learned that HTTP_REFERRER, at least in my tests, returns the page visted on the current domain before the form page, not the domain visited before the current domain, so that hasn't been useful. I don't know how I would get keywords in this case. I've searched around for scripts or tutorials and have been surprised to find nothing helpful

The site in question has a separate stats package, but it doesn't track converting keywords and that's really what I'm after. There isn't high volume traffic, so getting them individually via a form (rather than input into a database) isn't a problem.

My question is really whether what I'm trying to do is possible with a few lines of code, or have I underestimated the complexity of the task?

Populating A Form Wth Database Info
I've coded a piece of code which populates a form with data read from the database:

$connection=mysql_connec ("localhost", "f2821842", "f2821842");
$result=mysql_select_db("QUERIES");
$query=mysql_query("Select * from Emp_Details where emp_num = '$employnum'");
while($row=mysql_fetch_array($query))
{$empname=$row['emp_name'];}

<form name="webregform" action="webadmin2.php" method="post">
<input name="requiredname" type="text" size="30" value="<?php echo "$empname"; ?>">
</form>

When I echo the $requiredname, I get spaces and no data, and I know that $empname is not a space-it does read a value in a database. 1. How can I get $requiredname to print a value?

Insert Form Info Into Database
i am trying to enter info from a form into a mysql database. when i submit the form, a new row is created, but the information isn't contained in it? any thoughts? PHP Code:

Filling Form With Database Info
I have a table with 5 fields for a tour business activity list
: (1) id -table key (2) name (3)description (4)picture -text link not
binary(5) country. I would like to create a form that takes all the
activitys an puts it neatly down on site in checkboxes so user can
select activtys.this will be linked to form mail.i would like the
activitys to be seperated by the country they r in?

Some Users Can't Enter Info Through My Form To My DB
I set up a comment page on my site and most users can enter comments.  the page refreshes and shows the comments below.  however, some users can't enter comments.  what should I be looking for to resolve this?

Validating Form Info Before Inserting It Into Database
I have been trying to create a PHP application where you can add customer contacts to a MySQL database.

Now, my problem began when I created a form where the user can add in a customer's name and info to the database. In an effort to alert the user that they may be adding a customer that is already setup in the database, knowing that some of the customers may have the same names, e.g. there is more than one Bobby Ray Brown, I decided to add a script that queries the "customers" table in the database and searches for all results that match the input from the user. Code:

PHP Displaying Info Input On HTML Form
I'm in an exercise where I've created an order form in HTML. The form displays properly and allows me to input certain test order info just fine. The relevant lines in the HTML form are: Code:

Getting Form Info Into A Mysql Select Statement
I'd like to get user input from an html form into a mysql select
statement. Here's where I'm stumped:

$result = mysql_query("SELECT * FROM dept WHERE notes LIKE
'%search-string%'",$db);

I need to get the user's input into the '%search-string%' section, but I
do not understand how to do this. I can hard-code a specific search
string and it will work, but I want the users to be able to dynamically
define the search-string. So, I created a basic html form and used the
post method to grab their input, but now I can't insert that input into
the mysql select statement. Any ideas? I think it should be easy, I just
don't know how to do it. I've tried this:

$result = mysql_query("SELECT * FROM dept WHERE notes LIKE
'%$_POST["search"]%'",$db);

But it doesn't work. Below is the form in html and the php file:

<html>
<title>Search Test</title>
<head>
</head>
<body>
<form action="search-db.php" method="POST">
<p>Enter Your Search: <input type=text name=search></p>
<input type="submit">
</form>
</body>
</html>
-----------------------------------------------------------
<html>
<body>
<?php
$db = mysql_connect("localhost", "Anonymous");
mysql_select_db("computers",$db);
$result = mysql_query("SELECT * FROM dept WHERE notes LIKE
'%surplus%'",$db);
echo "<table border=1>
";
while ($myrow = mysql_fetch_array($result)) {
printf("<tr><td><b>%s</b></td></tr>
", $myrow[notes]);
}
echo "</table>
";
?>
</body>
</html>

Upload And Email Form Info At The Same Time
I need to upload something and also have an email sent at the same time after filling out a form. So they will fill out a form, decide what they want to upload and then hit the submit button and it will upload the file to my directory, where I can get to it, and then it will also email me the information I had them fill out in the form at the same time. Is that possible? What code would I use?

Taking Info From A Form, Saving It In A DB And Writing It To A .css
What I need to do is take "site info" from a form, save it to a database table called siteinfo, and then write style information based on the variables. Code:

File Form - Keep Local Path Info On Reload
Is there a way to retain the local path info for a file form when the page reloads?

Using Form To Post Info And Pic's (Warning: Unable To Fork)
I have created an admin form which allows the admin to update info and pic's to his site but I am having trouble with the update_pic script. When I pass along the form to the php script it gives me the following error message:

"Warning: Unable to fork [C:WINDOWSTEMPphp30.tmp /full/path/to/joesauto/images/anime_dvd_icongif.gif] in c:inetpubwwwrootadd_data.php on line 39"

This is line 39: exec("cp $picture /full/path/to/joesauto/images/$picture_name");
This is the form I used which was taken from this site. Code:

Putting Info Into A DB / Passing Info Between Pages
I have run into an issue...I have posted previously, but my scenario has changed.

Here is the situation...

If a user clicks on a link ('abc123' for example) I want to insert into my database some predefined information about 'abc123' - I have assigned a value that is echoed in future pages for 'abc123'.

So, what I need is some mechanism to, when a user clicks 'abc123', have a pre-defined username and password be entered into the database. I need this so future pages can utilize the session values.

Printing
Perl has a print function that'll allow you to print text without having to comment out Perl interperated characters. For example:

print<<EOF;
Text goes here, blah blah blah blah, """,... $$&$&$,
EOF

Does PHP have a similiar feature?

Printing With Php
is there a php functino tat can use to print instead of using javascript, window.print()??

Printing With Php
I am printing songs titles on the CD jacket with php.
Well,songs are in a directory. I easily list the titles on my brower page. But when I want to send these titles to the printer with:

printer_draw_text($handle,$s,10,10)

the printer prints the last titles on one line and that's all.

$s is the list.

is it a problem of time processing with the printer?
should I format $s?

Printing $
I am writing a php program and I need to print out the $ character. Does anyone know how to do this?

Getting And Printing Last Id From A Table
I'm trying to get the last id from an orders table and increment it by one so the order_id of the new items in a shopping basket will be assigned the order_id suitable

i.e.

current order id is 5 get that number 5 and increment it by one, so that items have order number 6 assigned to them.

Im using this code so far...

Printing A Picture
I have some if statement where I want have a picture show instead of echoing text. The picture will be saved in another area so just doing the regular "picture.gif" will not work I will need to do the entire address.

Printing Source
Is there an easy way to print the source code, i guess saving it into a normal txt file would do but to keep the colours similar to when posting in here with PHP code,

I think i remember seeing a site that had an extension, like file.phps that printed the code in a colour format.

Printing Xml From NuSoap
I'm using the nusoap class to query a webservices server. I'm getting some errors from the web services server and I would like to print out the xml that the soapclient class and call method creates that it sends to the webservices server.

I would like to do this to compare the xml being sent to what the webservices expects. Does anyone know how to print out this xml? I can't seem to track it down.

Printing Under Windows
I'm wondering whether anyone knows of a good tutorial on how to use the PHP Printer Functions under Windows.

I've been dabbling in it a little, but the PHP Manual is kinda flakey on the subject.

I want to be able to print a report, generated in PHP, on the printer connected to the web-server (it's for an Intranet app).

Printing On Demand With Php
I am trying to generate a text file and print it all in one fell swoop with php. I know that VB has a subroutine called printondemand that makes a button in a browser initiate the WinPrint32.dll Does php have any functions that are similar to this, and if not how might one achieve something like this?

Printing Data?
why the following code isn't printing any data from the selected database. PHP Code:

Printing *.php Search To *.htm
I've got a search(search.htm) page that searches(find.php) the database and pulls Player, Pos, and Team. Right now the script runs a prints in find.php. I want this to print to search.htm. I've looked at php.net but haven't been able to find much that clicks in my head....I've got the search script that works fine but the printing is what I would like to change.

Printing Problem
I try to print to a dot matrix printer but when I use the set_option function,I cannot get the printer working correctly. For example I give landscape format but this seems to be ignored.This thing happens also with custom_paper_format. Is there a solution for it?

Printing Directly From PHP
Currently I work in a school and I wish to build a PHP/MySQL portal which allows teachers to enter student exam marks online through the portal.

The same site will provide reporting etc. and prints the result of each student on a separate page, which can then be sent by post.

In order to print the results I wish to create a print button (or something similar) which once pressed, extracts the individual student details from the Database and sends them directly to the printer without outputting anything on the screen. IS this possible with PHP?

Custom Printing
is it possible to print certain details on a fixed area of a paper
using PHP?

here's the scenario:

i'm trying to print labels with names and addresses. the names and
addresses are stored in the database.

after i retrieve the details, i should be able to print as many (or as
less) number of details as many (or as less) number of times at a
specified position.

for example if i have a sheet of paper that can hold 12 addresses with
4 rows and 3 columns, i can have the page marked areas as

a11 a12 a13
a21 a22 a21
a31 a32 a33
a41 a42 a43

each of which denotes a label.

is it possible to print the label say at position a32? or 2 labels
starting at position a33 and a41? (assuming we are printing it in a "Z"
format)

Printing Next Link!
Having trouble printing next / prev links. PHP Code:

Only Printing First Row Of Array
Only the first row of this query is printed. The $Agent variable is gained from a previous query that a sucessfully returns an array of names. Code:

Problem W/ Printing
1) my add works fine, pushing info into mydb
2) select * from mydb where month = 08 works fine, info is good
3) using view form can select only those with month = 08
4) problem is when printing sometimes month prints, sometimes not.

Example: Start Time: 16, 2003
Should be: Start Time: August 16, 2003

Sometimes month is printed, other times not. Using August as an example, it's not just August entries. I'm not seeing what would make some print correctly and others not. The db is fully populated with a month for each entry. I'm not sure how to post code, but I'll try: Code:

PHP Printing Reports
I need to know about your expirience with printing reports on client machine. I usually make printer friendly page, but I need to know how to make page break (how to force it).
I need to print logo on every page, so I need to know how to make a page break.

Print - Not Printing
I am totally new to php
Question:
I am working on a Vista box.
*.php files are displayed OK by the browser,
however,
print("something");
does not lead to "something" being displayed.
What is the cause / what should I do?

-> Printing PDF Files? <-
I'm using fpdf to create a report in PDF.

Now the problem is that I want to print it directly to the
client's default printer, with no intervention from the user.

Is this possible?

The problem of having the PDF file displayed in the browser's
plug-in is that:
- it lets the user change the scaling
- the user may use the browser print button instead of Acrobat
- the user will close the window thinking it's closing Acrobat
but actually closes the application itself.

I'm ready to switch to any other PDF engine/tool, including
commercial ones, if it can ease the printing process.

Printing PDF Files Using PHP
I generated the pdf on the fly using PDFLIB and write the PDF files in virtual directory.I want to print the PDF file in the virutal directory using PHP. I used printer_write function, but it prints the text not a file....

Printing Reports
I 've developed an application for secretaries in universities so as to
save the student's data, grades, etc.

One last thing I have to do is print some reports. For example all the
grades of a studentin his 4 year studies.

I think I shouldn't stick to html, because I want to manipulate the
pages as I please. I thought of making a pdf but it's not that easy.

I have seen HTML_2_PDF which uses html2ps but since the web app will be
located in a window server I leave it out.



Printing Every Week
im trying to print a list of every Friday since a date defined. Let me try and explain. I want to define a date such as 2007-07-06 (which is a Friday) and then let php print each Friday since that date until today. For example, if the date defined was 2007-07-06 then it would print

2007-07-06
2007-07-13
2007-07-20
2007-07-27
2007-08-03
2007-09-14

But I want to also be able to format the date it outputs, so it might look like

Friday 06 July 2007
Friday 13 July 2007
Friday 20 July 2007
and so on.

Printing A Pdf File From Php
printing pdf files through php. I have a
script that will create many pdf files but I want them printed. I
found this program to print pdf from the command line from
http://forum.planetpdf.com/webboard.../read?142106,52
and it works fine when I do the command

C:pdfp -p "computerLaserJet" "C:Program
Filesxampphtdocsweeklyhomebuyers empinvoice4. pdf"

through start->run but when I try to do it through php using

function print_file($filename) {
$adobe_path='C:pdfp -p "computerLaserJet"'
$output = shell_exec($adobe_path.' "'.$filename.'"');
echo $output;
}

print_file("C:Program
Filesxampphtdocsweeklyhomebuyers empinvoice 4.pdf");

Printing Documents
I have a web page that displays CVs submitted by users (in DOC, PDF or RTF format). CVs are stored in a folder for e.g. user_cv Admin can select the CVs to be printed and then click on Print button. This should send all documents to printer for printing. How do I do that in PHP?

Report & Printing (using PDF)
I've a lot of problems with print management of commercial reports.

I tried two alternatives:
1. Generation of HTML code formatted using CSS
2. Generation of PDF file

I left the first because it isn't possible to define a Footer and a Header for each page (sure?) About the second, i created a PHP class that takes a sql-query and generates a PDF file. Code:

Barcode Printing
I need to print barcode labels on a Birch BP-744 label printer So far I have managed to

1. create the barcode image as a jpg file
2. install MagickWand to create a bmp version of this image
3. successfully printed this on a laser printer, via parallel port, using the PHP printer_open, printer_draw_bmp, printer_close functions
4. successfully printed on a laser printer connected via USB port (found out I had to set Apache permissions)

But when I print to this barcode printer it just spits out a few rows of labels, ALL BLANK!

Printing To Rtf File
I am trying to print some results from an array to a rtf file using a template:

so in my template I have:
<<num1>>:<<val1>>.....


Copyright © 2005-08 www.BigResource.com, All rights reserved