PHP - Send Job To Print With Php
Hi Guys
I want to knw if its possible to send job to print with php. example, in my database I have a table called Letters which stores letters, while I loop through the table, I want to print each letter off, any examples available? Thank you Similar TutorialsI am working on a phpmailer script that sends an order confirmation email to the customer AND the client at the same time. If I have the customer email and client email set both to the originating domain's email addresses (myname@myserver.com), then it sends fine. However, if I try to send to an outside mail server (eg. someone@gmail.com), I get the following errors: Code: [Select] SMTP -> FROM SERVER:220 myserver.com ESMTP Exim 4.63 Sat, 18 Sep 2010 15:08:21 -0700 SMTP -> FROM SERVER: 250 myserver.com Hello localhost [127.0.0.1] 250-SIZE 52428800 250-PIPELINING 250-AUTH LOGIN PLAIN 250-STARTTLS 250 HELP SMTP -> FROM SERVER:250 OK SMTP -> FROM SERVER:250 Accepted SMTP -> FROM SERVER: SMTP -> ERROR: RCPT not accepted from server: SMTP Error: The following recipients failed: someone@gmail.com Message could not be sent. Mailer Error: SMTP Error: The following recipients failed: someone@gmail.com SMTP server error: I'm not sure what's going on here. Any SMTP or phpmailer geniuses here that can shed some light on what needs to happen here for this to send to any address? Hi, I'm trying to setup a quick PHP script that will grab the email from the url (see below) and after inserting into MySQL db - which is working fine - the script will complete two additional tasks: 1. send that same captured email out to a external db as in shown via http://domain1.com/insert.php?email=$lead (example), but then send to a DIFFERENT source - the originator of the lead - a portback acknowledgement using Header (sending the status and email to http://domain2.com/check.php?e=$lead&s=$status for their records). See the code below: ------------------------- Code: [Select] $lead = $_REQUEST['e_mail']; // will grab email from posted url string and assign to local variable $result = mysql_query($command); // this is just to execute the MySQL insert which works just fine but included here to explain validation below // Create API Call string to insert lead into iContact folder $requestURL = "http://domain1.com/insert.php?email=$lead"; // Execute API Call to CAKE $xml = simplexml_load_file($requestURL) or die("feed not loading"); if ($result) { $status = 1; // mark lead as sucess // send postback on lead status header("Location: http://domain2.com/check.php?e=$lead&s=$status"); } -------- Problem: I'm getting all sorts of errors with the simplexml_load_file() function and can't figure out why it won't work. Any input appreciated as this the only way I know how to pass the lead onward and then inform/update the other party of receipt of information. thanks! Hello.
i am totally new to php and just started to learn now. i just dont understand why the following code is not printing the username that i enter on the page.
Please note that the code itself is saved with the name "basicForm.php".
Thanks.
<html> Code: [Select] $query ="SELECT oneID FROM table WHERE table.PersonID = 'game.PlayerA'" ; $result = mysql_query($query); $row = mysql_fetch_array($result); $oneID = $row[0]; [code] If I then echo "$oneID" why does it not print anything? $result echos resource7 Hello, How to customize print page in php ? I had a page, but I need to print it like an invoice look page. Thanks in advance I have the following code but I cannot get it to print the results of the array into my web page. Help would be so appreciated!! Code: [Select] $sql = "SELECT RegName, SireID, DamID FROM pedigrees WHERE ID="; $DoggieIDQ = $sql . $values["ID"]; $DoggieIDR = db_query($DoggieIDQ,$conn); $DoggieID = $_GET['ID']; $Depth = 1; $DepthLimit=8; function getParents($DoggieID, $Depth, $DepthLimit) { $Sire = getSire($DoggieID); $Dam = getDAM($DoggieID); $Depth++; if ($Depth == $DepthLimit) { return array($Sire, $Dam); } else { # Now get grandparents too $SireParents = getParents($Sire, $Depth, $DepthLimit); $DamParents = getParents($Dam, $Depth, $DepthLimit); return array($Sire, $Dam, $SireParents, $DamParents); } } Is there a way to dynamically print the url of a web page once it loads? If so, how? This is for metadata purposes. Thanks! I am using function to insert into database. But the primary key is automatic and I used Quote $_SESSION['Tes_ID'] = mysql_insert_id(); to retrieve this. But now that I use function method. I am not sure how to retrieve the primary key on to the next page. Code: [Select] $value = modulesql($postVar1, $postVar2, $SessionVar1, $SessionVar2); $_SESSION['Tes_ID'] = mysql_insert_id(); echo $value, $_SESSION['Tes_ID']; Code: [Select] <?php function modulesql($Tes_Name, $Tes_Description, $Use_ID, $Sub_ID){ $con = OpenConnection(); mysql_select_db("examination", $con); $module = ("INSERT INTO test (`Tes_Name`, `Tes_Description`, `Use_ID`, `Sub_ID`) VALUES ($Tes_Name, $Tes_Description, $Use_ID, $Sub_ID)") or die('Cannot Execute:'. mysql_error()); CloseConnection($con); return $module; } ?> Have I lost you with my question?? Hi, What is the best way to print the local date and time, my website have customers from 4 or 5 countries. Saudi - UTC+3 Dubai - UTC+4 India - UTC+5.30 how to print the local time for them Thanks, print("<form name='form1' method='post' action='create-b.php' enctype='application/x-www-form-urlencoded' style='margin:0px'> <input type='hidden' name='time' value='werwRG/443gooa22a04c0c2d46c802cc7e3b262398852$glg/WE?F'> <input name='name' value='Anonymous' type='text' MAXLENGTH='15' style='position:absolute;width:650px;left:67px;top:142px;z-index:11'> <input name='subject' value='(No subject)' MAXLENGTH='15' type='text' style='position:absolute;width:650px;left:67px;top:166px;z-index:11'> <textarea name='body' MAXLENGTH='255' type='text' style='position:absolute;left:67px;top:191px;width:650px;height:98px;z-index:11'></textarea> <input name='submit' type='submit' value='Create thread' style='position:absolute;left:614px;top:291px;z-index:11'> <div id='captcha' style='position:absolute; overflow:hidden; left:10px; top:296px; z-index:10'> require_once('captc/recaptchalib.php'); $publickey = '*******************************************'; echo recaptcha_get_html($publickey); </form> </div>"); How can I make the highlighted text be read as PHP and not just text? It has to be in the form tags... before you reply saying you forgot the php tags, no i didn't. I can't use php tags inside php tags... Im trying to print several image url's and names from an sql database into 3 columns, Aiming to get it to go 1,2,3 4,5,6 7,8,9 etc etc. but for some reason myne is going 1,3,5 2,4,6 etc. Dont bother mentioning that my loops do nothing, i realised that about 10 minutes ago, Any help would be appreciated. <?php include 'config.php'; mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($database) or die(mysql_error()); $result = mysql_query("SELECT * FROM tracks"); echo '<div id="left_wrapper">'; for ($i=0;$i<mysql_num_rows($result);$i+=3) { $row = mysql_fetch_array($result); $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br>"; echo $row['name']. "<br>"; } echo "</div>"; echo '<div id="middle_wrapper">'; for ($i=1;$i<mysql_num_rows($result);$i+=3) { $row = mysql_fetch_array($result); $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br>"; echo $row['name']. "<br>"; } echo "</div>"; echo '<div id="right_wrapper">'; for ($i=2;$i<mysql_num_rows($result);$i+=3) { $row = mysql_fetch_array($result); $id = $row['id'] + 1; echo "<img src='Thumbnails/" . $id .".gif'></img><br>"; echo $row['name']. "<br>"; } echo "</div>"; ?> i know each of those loops does nothing, But you can see where they are meant to do, Each div is aligned to different positions, first loop is left, 2nd is center, 3rd is right. Hi I have this code to echo th econtents of a table, which contains 100 rows. I want to be able to display all 100 rows. The problem is that it displays 99 (it excludes the first). I've tried to backtrack to reconstruct the code to find out where the error is but no joy. Any ideas? Thanks in advance! Code: [Select] .... // get all entries from table $sql = "SELECT * FROM 100words ORDER BY word_id"; $result = mysqli_query($dbc, $sql); $r = mysqli_fetch_row($result); //print table entries to screen in columns echo '<div id="container">'; // results presented in html table 5 columns, 20 rows per page echo '<div id="outerbox">'; echo '<div class="innerbox">'; echo '<table class="centerresults" border="0">' . "\n"; echo '<td>'; $i = 0; $max_columns = 5; while ($list = mysqli_fetch_assoc($result)) { extract($list); // open row if counter is zero if($i == 0) echo '<tr>' . "\n"; echo '<td width="150px"><a href="word.php?w=' . $list['word'] . '">' . $list['word'] . "</a></td> \n "; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo '</td>' . "\n"; $i=0; } // END if(++$i == $max_columns) { } // END while (!empty($myArray)) { //} END while ($list = mysql_fetch_array($result)) { //END if($i < $max_columns) { echo '</tr>' . "\n"; echo '</table>' . "\n"; echo '</div>'; echo '</div>'; can someone please give me some guidance on how to do this please I am wanting to create a status updating type application on my site and i have this idea in my head i want it to retrive and print the last 3 posts (max ids) made by the user if someone could give me some example code please and i can hopefully work from that. Thanks James I'm working on a site where I've implemented a simple back end wysiwyg editor for content on a page. Then on the public page I run a php query to pull that content and display it. But doing this cancels out the css I have been using to split content into two columns. Is there a way to do this in php, or is there a way to circumvent the problem? ( also tried echoing the entire css style along with the query result - that didn't work either) The <p id='container_sub'> is what is split into two columns. I tried it outside of the query, and inside the query around where I echo results. Neither worked. Here's the basic php code, and further down the css that makes two columns: Code: [Select] <?php $pageid = '2'; // Formulate Query // This is the best way to perform an SQL query // For more examples, see mysql_real_escape_string() $query = sprintf("SELECT content FROM tbl_pages WHERE page_id='%s'", mysql_real_escape_string($pageid)); // Perform Query $result = mysql_query($query); // Check result // This shows the actual query sent to MySQL, and the error. Useful for debugging. if (!$result) { $message = 'Invalid query: ' . mysql_error() . "\n"; $message .= 'Whole query: ' . $query; die($message); } // Use result // Attempting to print $result won't allow access to information in the resource // One of the mysql result functions must be used // See also mysql_result(), mysql_fetch_array(), mysql_fetch_row(), etc. while ($row = mysql_fetch_assoc($result)) { echo "<p id='container_sub'>".$row['content']."</p>"; } // Free the resources associated with the result set // This is done automatically at the end of the script mysql_free_result($result); ?> The css.... Code: [Select] #container_sub {-moz-column-count: 2; -moz-column-gap: 25px; -webkit-column-count: 2; -webkit-column-gap: 20px; column-count: 2; column-gap: 20px;} #container_sub2 {-moz-column-count: 2; -moz-column-gap: 25px; -webkit-column-count: 2; -webkit-column-gap: 20px; column-count: 2; column-gap: 20px;} Probably a simple solution, just one I'm not sure how to do it. I need the array to print out like this Code: [Select] array( 'name'=>'Store 1', 'address'=>'LA1' ), Right now, I got it to look like this Thanks in advance Code: [Select] Array ( [name] => 'Albertville Farmers Market', [address] => '116 Main Street Albertville, Alabama 35950' ) , Array ( [name] => 'Alexander City Downtown Market', [address] => 'Braod Street Alexander City, Alabama 35010' ) , How can I go about accomplishing this? Here is my code Code: [Select] $stores = array('name'=>"'$MktName',",'address'=>"'$address'"); echo "<pre>"; print_r($stores); echo "</pre>"; Hi, I am trying to get the form field to echo a php variable. The problem is that the form is 'Printed' via php. print "<td width=\"300\" valign=\"top\"><input type=\"text\" name=\"usr\" value=\"i.e. JBloggs \" onfocus=\"if(!this._haschanged){this.value=''};this._haschanged=true;\" tabindex=\"1\"></td>"; Instead of the value being i.e. JBloggs have it echo the $name variable. Any input would be appreciated. Hello guys and gals, I am pretty green to PHP! I have an empty array that that I am trying to put images into. The thing is I have a certain file name in the folder, I want to exclude that file. This is what I have tried, any advice would be appreciated! Code: [Select] $thumbImg[] = array(); foreach (glob($DImg) as $PImg) { if (!is_file("thumbnail.jpg")) { $thumbImg[] = "<img src=\"pathtoimage\">"; } } Later on the page I am printing it out with this. It is still including the thumbnail.jpg image. Thank you in advance!! Code: [Select] for ($i=0; $i<count($thumbImg); $i++) print $thumbImg[$i]; hihi, so I have the following, except it goes all the way up to server 400. Is there a way to make it print after each echo? As it is right now it will not print the entire list until all 400 servers are done echo "Server 01: " . count($server01->listaccts()) . " / 130" . "<br />" ; echo "Server 02: " . count($server02->listaccts()) . " / 130" . "<br />" ; echo "Server 03: " . count($server03->listaccts()) . " / 130" . "<br />" ; echo "Server 04: " . count($server04->listaccts()) . " / 130" . "<br />" ; echo "Server 05: " . count($server05->listaccts()) . " / 130" . "<br />" ; echo "Server 06: " . count($server06->listaccts()) . " / 130" . "<br />" ; echo "Server 07: " . count($server07->listaccts()) . " / 130" . "<br />" ; echo "Server 08: " . count($server08->listaccts()) . " / 130" . "<br />" ; thanks! I currently have a search page on my site that prints the products but it prints the products more than once if its in more than one category I have tried getting distinct item in my SQL. But this doesnt work so im trying an if statement that if there is more than one specific result then to just print this once. I was wondering if anyone had any ideas of how to do this using an if statement I just dont know how to go about just printing the result just once if its greater than 1. The code is below to make it clearer. $searchterm = $_POST['searchterm']; trim ($searchterm); /*check if search term was entered*/ if (!$searchterm){ echo 'Please enter a search term.'; echo $searchterm; } /*add slashes to search term*/ if (!get_magic_quotes_gpc()) { $searchterm = addslashes($searchterm); } /*query the database*/ $query = "SELECT * from (products LEFT JOIN categories_products_link ON products.prod_id = categories_products_link.prod_id) LEFT JOIN categories ON categories_products_link.cat_id = categories.cat_id WHERE prod_title LIKE '%" . $searchterm . "%' ORDER BY cat_title, prod_title"; $result = mysql_query($query); /*number of rows found*/ $num_results = mysql_num_rows($result); echo '<p><h1>Search Results: '.$num_results.'</h1></p><br />'; /*loops through results*/ for ($i=0; $i <$num_results; $i++) { $num_found = $i + 1; $row = mysql_fetch_assoc($result); echo "$num_found. "?><a href="store-<?php echo $row['cat_id'];?>-<?php echo $row['prod_id']; ?>/<?php echo seo_makeSafeURI($row['prod_title']); ?>.html"><strong><?php echo $row['prod_title']; ?></strong></a> <br /> |