473,387 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

PHP is the Delivery Boy

Well...Ok. Maybe NOT the delivery boy but PHP sure seems like one. I mean...the Pizza Place is like the Database Server and my home is like HTML and PHP is who "concatenates" or joins the hot and fresh script to the HTML that sits inside the browser; which is like the kitchen table where we end up eating the pizza.

Next, I would like to know if someone can someone help me answer this question; and if you do I will make you my own kind of pizza. I have created a php script that takes a url file out of the database server ~ phpmyadmin and places the file onto IE ~ browser...but I have to "click" the file in order for it to become activated or open up. What php code do I use so I can automatically open up the retreived file? Here try this and place "lc51" into the textbox and you will see what I mean. http://inks-etc.org/SearchEngine/asif.html For anyone to help me solve this problem I will give you my pizza with is made with 6 months of ink that your printer beholds at a wholesale cost. Hmmm. Delicious...I mean for your printer and lovely for you as it saves you so much. This is what you will receive after a proactive solution is offered http://inks-etc.org/customerconnection/kraft.html you will recieve this but in your name.

Thank You,

Jason Kraft
Inks Etc. LLC
941-993-8943
Nov 10 '10 #1
2 1211
Markus
6,050 Expert 4TB
There are a few ways to read the contents of a file, one of which would be to use file_get_contents.

Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $file = "/path/to/your/file.txt"
  4.  
  5. echo file_get_contents($file);
  6.  
Weird analogy for PHP, BTW ;)
Nov 10 '10 #2
On the bottom of this script how do I input the file_get_contents($file);? Please show me. Thanks Markus...and tell me what printer you have so I can "deliver" a thank you when your response activates my search engine : )

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"  
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/php; charset=utf-8" />
  6. <title>asif</title>
  7. </head>
  8.  
  9. <body>
  10. <?php
  11.  
  12. /*connect to out database*/
  13. include ("../SearchEngine/dbc_site.php");
  14.  
  15. /*get data and trim is a function that removes spaces at the beginning and end of text so they don't become stored*/
  16. $button = $_POST['submit'];
  17. $search = trim($_POST['keyword']);
  18.  
  19. if($search!=" ")
  20. {        
  21.      // explode the keywords; the 1st term "" is the way to explode and the 2nd term is what your exploding; the $search is the $GET
  22.      $search_exploded = explode (" " , $search);
  23.      // looping
  24.      foreach ($search_exploded as $search_each)
  25.      // construct query => x++ shows how many time the loop has been thru
  26.      //$construct .= is the same as $construct = $construct . "$xyz"
  27.      {
  28.       $x++;
  29.      // if ... this is the 1st time we are looping
  30.       if ($x==1)
  31.      // the % are wildcards that stand in for any other char before or afterthe word
  32.        $construct .= "keyword LIKE '%$search_each%'";
  33.      // else...allow more keywords that are looped by the con't phrase OR keywords LIKE that con't over and over again ~ loop
  34.       else
  35.        $construct .= " OR keyword LIKE '%$search_each%'";
  36.      }
  37.      //breaks the reference with the last element http://us.php.net/manual/en/control-...es.foreach.php
  38.     unset ($search_each);
  39.    //echo out with the value construct / this is a $query
  40.    $query = "SELECT * FROM Ink_Engine WHERE $construct";
  41.    //this is a $result
  42.    $run = mysqli_query($dbc, $query);
  43.    $foundnum = mysqli_num_rows($run);
  44.     if ($foundnum==0)
  45.      //this is the webpage that shows up when the keyword is invalid and customer is to try again
  46.       {
  47.         include ("../thinker/backengine.html");
  48.       }
  49.     else
  50.     {
  51.      //echo "$foundnum results found!";
  52.      while ($runrows = mysqli_fetch_assoc($run))
  53.       {
  54.        //get data
  55.        $keyword = $runrows ['keyword'];
  56.        $desc = $runrows ['description'];
  57.        $url = $runrows ['url'];
  58.        echo "<table>
  59.                      <tr><td><b>$keyword</b></td></tr><br />
  60.                     <tr><td>$desc</td></tr><br />
  61.                     <tr><td><a href='$url'>$url</a></td></tr>
  62.                  </table>";
  63.       }
  64.     }    
  65.   die ();
  66. }
  67. else
  68.         {
  69.                 echo "No result found.";
  70.         }
  71. ?>
  72. </body>
  73. </html>
Nov 11 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: postmaster | last post by:
This is an automatically generated Delivery Failure Notification. Delivery to the recipient failed. Status Code: 5.1.1 User Unknown If you are trying to reach Blue, please send email to...
0
by: postmaster | last post by:
This is an automatically generated Delivery Status Notification. Delivery to the following recipients failed. LPOLLARD@Darbylaw.com
3
by: Cliff Wells | last post by:
From: zonk@azet.sk To: Cliff Wells <clifford.wells@comcast.net> Subject: Sprava nebola dorucena (Message was not delivered) Date: 13 Oct 2004 15:26:00 -0000 (08:26
0
by: Mail Delivery Service | last post by:
This multi-part MIME message contains a Delivery Status Notification. If you can see this text, your mail client may not be able to understand MIME formatted messages or DSNs (see RFC 2045 through...
1
by: OC | last post by:
Does anyone know if there is any support for guaranteed delivery of messages such as with MSMQ for .NET (webservices, etc.)? I have a high-speed data-entry application being ported from the...
0
by: Dica | last post by:
i think i've gotten the wrong idea about the differences between a read receipt and delivery status notificaiton. i was assuming that delivery status notificaiton is a response line from the remote...
5
by: Chris Thunell | last post by:
I'm using the system.web.mail in vb.net to send emails out in a vb.net application. The sending of emails works great. Is there a way to have it send me back a delivery receipt or a read receipt?...
0
by: Kostadin Kostov | last post by:
Hi! I'm developing component for sending emails and want to have the ability to request delivery receipt when sending an email. I use the "Return-Receipt-To" header:...
2
by: audiophilechris | last post by:
Can anyway help me write this query? I've created a DB to help me manage delivery logistics for items I rent out. I have a table that i use to record delivery date, delivery time, pickup date,...
0
by: Michael Bell | last post by:
From: Mail Delivery System <Mailer-Daemon@ptb-relay02.plus.net> To: michael@beaverbell.co.uk Subject: Mail delivery failure: returning message to sender Date: Wed, 31 Oct 2007 19:39:57 +0000 ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.