Jump to content

Search the Community

Showing results for tags 'print'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 13 results

  1. Howdy folks, Getting this error in console when trying to print the contents of a div. get-directions.php:192 Uncaught ReferenceError: printDiv is not defined at HTMLInputElement.onclick Here is the Button for print and the Div wanting to print from: <div id="rightpanel" class="float-right col-md-4"></div> <input type="button" id="print" onclick="printDiv('rightpanel')" value="Print Directions" /> Here is the Script: function printDiv(rightpanel) { var disp_setting="toolbar=yes,location=no,"; disp_setting+="directories=yes,menubar=yes,"; disp_setting+="scrollbars=yes,width=650, height=600, left=100, top=25"; var content_vlue = document.getElementById(rightpanel).innerHTML; var docprint=window.open("","",disp_setting); docprint.document.open(); docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"'); docprint.document.write('"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'); docprint.document.write('<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'); docprint.document.write('<head><title>My Title</title>'); docprint.document.write('<style type="text/css">body{ margin:0px;'); docprint.document.write('font-family:verdana,Arial;color:#000;'); docprint.document.write('font-family:Verdana, Geneva, sans-serif; font-size:12px;}'); docprint.document.write('a{color:#000;text-decoration:none;} </style>'); docprint.document.write('</head><body onLoad="self.print()"><center>'); docprint.document.write(content_vlue); docprint.document.write('</center></body></html>'); docprint.document.close(); docprint.focus(); } Any help would be appreciated. Cheers
  2. i have proof, hold on. In PHP there are two basic ways to get output: echo and print. meant there was more ways but they werent basic.
  3. I hope that this is a simple fix that I can't for the life of me see. I have a page which selects data from a database for a selected person within a selected month which is used to provide an employee with their current or historic earnings. Up until the end of April you could hit the print button and it would print out the page as per what is on the screen (text only) in the correct layout minus the colours and boxes etc, this sufficed perfectly well. Then in May for no apparent reason the information that was collected from the database still displayed but now also has the url printed out, this is also the case when you use the browser print function. Please see the attached image of both scenarios. Any thoughts or help to solve this problem would be greatly appreciated. Thanks Ian.
  4. Sorry if my wording/terminalogy on the discription is wrong. I'm new to PHP, so i'll do my best to detail what im trying to do. The PHP is doing what i need it to do. But i do not need to print the whole response. I only need the [address] and [pubkey] values as variables. I have read a few tutorials, but they assume i already know the strings to be converted to variables. Please help Code... <?php require_once 'jsonClient.php'; $service = new jsonClient('http://ooples:booples@'); $apple = array ($service->validateaddress("1234567890")); print_r ($apple); ?> Response... Array ( [0] => Array ( [isvalid] => 1 [address] => 1234567890 [ismine] => 1 [isscript] => [pubkey] => hqwiuehf9 [iscompressed] => 1 [account] => foo ) )
  5. Hey guys, No this may very well be a silly question and if it is, I'm certain to have a decent bit of embarrassment, as I'm somewhat of a veteran when it comes to PHP but I've only just started to look for a viable solution to this particular hiccup. Is there a way in the PHP Header file to include "print $_SESSION ['username']", without it causing a syntax error? I'll provide more context by embedding my code! <?php if ((isset($_SESSION['user_id']))&&(!strpos($_SERVER['PHP_SELF'],'logout.php'))) { print '<span> <a href="login/" id="link-login">Log in</a> <span class="pre-login-or">or</span> <a href="register/" id="link-register">Register</a></span>'; } else{ print 'Benvenutti $_SESSION ['username'], al Torneo di Briscola due mila tredici'; }?> That in itself will cause an unexpected T_STRING syntax error... the only option I can see is by employing the use of an iframe and linking the source to a separate PHP document with the "Welcome" text, but I was hoping there was another was to achieve this with the iframe.
  6. Got a question. Hope not worked with PHP too long so, I'm trying to print/echo the date but I don't understand what the hell the date is that it's sourcing. My code is; <!DOCTYPE html> <html> <head></head> <body> <?php $t=date("H"); if ($t<"15") { print "Have a good Morning"; } else if ($t<"17") { print("Have a good Evening"); } else print("Have a good Night"); ?> </body> </html> But it's producing each answer randomly in my browser because I don't know what 'Date' it supposedly is. Any enlightenment to this would be much appreciated. Basically, I've written, if ($t<"15") { print "Have a good Morning"; } So what date is this '15' ? It's not day of the month and it isn't year or time. Help
  7. This is going to seem so easy for all of you. I have created a simple form at: http://medicallakeveterinaryclinic.com/schedule.html. There are two groups in the form: (1) dog, cat, other and (2) email, call. The form sends the info by email just fine until I ask it to print anything from these 2 groups. I do not know PHP well enough to get it to print the one item from each group that was clicked on by the user. Here is the code. It is the "mail" line at the end that I am doing wrong. __________________ <?php /* This first bit sets the email address that you want the form to be submitted to. You will need to change this value to a valid email address that you can access. */ $webmaster_email = "jeannette@medicallakevetclinic.com"; /* This bit sets the URLs of the supporting pages. If you change the names of any of the pages, you will need to change the values here. */ $feedback_page = "schedule.html"; $error_page = "error_message.html"; $thankyou_page = "thank_you.html"; /* This next bit loads the form field data into variables. If you add a form field, you will need to add it here. */ $first_name = $_REQUEST['first_name'] ; $last_name = $_REQUEST['last_name'] ; $pet = $_REQUEST['pet'] ; $dog = $_REQUEST['dog'] ; $cat = $_REQUEST['cat'] ; $other = $_REQUEST['other'] ; $other_text = $_REQUEST['other_text'] ; $date = $_REQUEST['date'] ; $time = $_REQUEST['time'] ; $reason = $_REQUEST['reason'] ; $email = $_REQUEST['email'] ; $email2 = $_REQUEST['email2'] ; $phone = $_REQUEST['phone'] ; $phone2 = $_REQUEST['phone2'] ; // If the user tries to access this script directly, redirect them to the feedback form, if (!isset($_REQUEST['email'])) { header( "Location: $feedback_page" ); } // If the form fields are empty, redirect to the error page. elseif (empty($first_name) || empty($last_name) || empty($pet)||empty($date)|| empty($time)|| empty($reason)) { header( "Location: $error_page" ); } // If we passed all previous tests, send the email then redirect to the thank you page. else { mail( "$webmaster_email", "SCHEDULE AN APPOINTMENT REQUEST", $first_name, $last_name, $cat or $dog or $other, $other_text, $date, $time, $reason, $email or $phone, $email2, $phone2, "From: $first_name, $last_name" ); header( "Location: $thankyou_page" ); } ?> __________________________________ Help!
  8. Hello, I have working on a PHP application which would print journals. The user will type in the content (rich editor with formatting) and select the recipients. Upon submit, my code would need to fetch the address details of the selected recipients from database & use the content typed by the user to print a separate hard copy for each of the selected recipients. Till now, I had been working on static printing using JavaScript. This is new to me. Any idea to design the code in order to get the iterative print is highly appreciated. Many Thanks
  9. Hi guys, i have a db in mysql and a script in php gets data from the db and prints a table. The script is the following $connection = mysql_connect("localhost", "Litsa", "integratorgold"); echo $connection; mysql_select_db("mattrix"); $data = mysql_query("SELECT fNo, FieldA, FieldB FROM matin ORDER BY fNo DESC"); Print "<table border cellpadding=3>"; Print "<tr><th>No</th>"; Print "<th>Field A</th>"; Print "<th>Field B</th>"; Print "</tr>"; while($info = mysql_fetch_array( $data )) { Print "<tr>"; Print "<td>".$info['fNo'] . "</td> "; Print "<td>".$info['FieldA'] . "</td> "; Print "<td>".$info['FieldB'] . "</td> "; Print "</tr>"; } Print "</table>"; Obviously, it's not my invention. The above code appears in many tutorials and although being a rookie i made it work. The file "pict-single.JPG" shows the output of the script. Nothing special, it works as expected. The file "pict-double.JPG" shows what i need to do. The $data variable contains the results of the query. It is an array containing the output records sorted as requested. The while part of the code navigates from the first record of the #data variable to the last.Is it possible to address a specific record in $data?
  10. I'm trying to put some awkward codes into an array for processing, to get useful information from in the code, My problem is trying to get these codes from the database, can anyone Below is my code trying to get the codes from the database once it is outputting correctly I can then get on with the processing, any help getting an output I can then store into an array would be much appreciated! $query = "select * from orderlog where DeliverNote like '%$year%';"; $result = $db2->query($query); $num_results = $result->num_rows; $row = $result->fetch_assoc(); $i=1; while($i<=$num_results){ echo mysql_result($result,$i,"DeliverNote"); $i++; }
  11. Hi Just starting with php... This is the first part of the code: <?php $bestek = array ('vorken' => 5, 'messen' => 6, 'lepels' => 7); $servies = array ('borden' => 5, 'kopjes' => 6, 'schalen' => 2); $keuken = array ('bestek' => $bestek, 'servies' => $servies); echo '<table border=1>'; foreach ($bestek as $key => $value) { echo "<tr>"; echo "<td>". $key."</td>"."<td>".$value."</td>"."<br>\n"; echo "</tr>"; } foreach ($servies as $ke => $valu) { echo "<tr>"; echo "<td>". $ke."</td>"."<td>".$valu."</td>"."<br>\n"; echo "</tr>"; } echo "</table>"; ?> Printing the array's $bestek and $servies is not a problem, but now I want to print the $keuken-array in a table. Can anyone please help me with the code for that? I tried several things, but the result always is: Bestek Array Servies Array Thanks already for your help.
  12. i have created a registration form page with id,name,col,branch,etc Coming to the database ID is primary and auto increment, im trying to print the generated value of from the database after the registration is done. For example: "You have Successfully registered with us n your id is xxxxxx" Please someone helpme out with this
  13. Hi guys. I'm modifying my CometChat to display guest user IP addresses to moderators. I've successfully got ip addresses of guests to save in the database in ip2long format. Now I need to retrieve and print an IP address of a user to a moderator when they click the guest's username The code I need to print the IP address is here: if($owner == 1 || in_array($userid,$moderatorUserIDs)) { $options="<input type=button value='".$chatrooms_language[40]."' onclick=javascript:".$caller."kickUser($uid,0);$close class='invitebutton'> <input type=button value='".$chatrooms_language[41]."' onclick=javascript:".$caller."banUser($uid,0);$close class='invitebutton'>".$options; This shows a KICK & BAN button. Either above or below them I need it to say IP: - the guest's IP- The ip2long IP address is stored in cometchat_guests in the column 'ip' I need to put: SELECT INET_NTOA(ip) FROM 'cometchat_guests' WHERE 1 But I'm not sure what goes after WHERE... WHERE what? WHERE 1 = $uid Or WHERE $uid = 1 echo $ip Would be very grateful and appreciate any help here, thank you so much in advance I'm getting a migraine here
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.