Jump to content

bsamson

Members
  • Posts

    150
  • Joined

  • Last visited

Everything posted by bsamson

  1. Hello,   Could someone please direct me in the direction of a php download script. Here's my situation. I have many document types on my site including, PDF, DOC, XLS, and many more. With that said if a user clicks a link the document opens in IE. I am trying to figure out a way when a user clicks a link to one of these docs that it prompts them w/ a download dialog box. Again, any assistence would be GREATLY appreciated! Best Regards, Brian Samson
  2. Hey Orio! Thank you for the code! Appreciate it!
  3. Thanks for the help. Here's what I came up w/ for code: [code]<? $pgfile = basename($REQUEST_URL); echo $pgfile; ?>[/code] Now this works in grabbing the [i]about.php[/i] ... But, if I have this url: http://www.mydomainname.com/about.php?var1=blah&var=blah it grabs [i]about.php?var1=blah&var=blah[/i] in $pgfile ... Now the url doesnt always have the variables ... but when it does I would like for it to just grab about.php. Any suggestions how I can get this to work? Thanks again in advance!
  4. Hello ... I have the following URL: http://www.mydomainname.com/about.php I would like to find out how to grab just the [i]about.php[/i] and store it in $pgfile. The only other thing is occasionally there are variables that get passed through the URL, for example: http://www.mydomainname.com/about.php?r=4&yu-8 Even with the above case I would like to be able to grab just the [i]about.php[/i] and store it in $pgfile. Any assistance would be greatly appreciated! Thanks in advance!  
  5. I am ready to start learning another language. I just downloaded all of Visual Studio Express. With that said, I would like to know what I should learn 1st. Visual ... c++ c# Visual Basic J# Based on the info I have read so far C++ seems to be the choice. Anyway, any suggestions would be greatly appreciated. Thanks! Best Regards, Brian Samson
  6. Here's my code: [code]<? $company = $_POST['company']; $discount = $_POST['discount']; $nte = $_POST['nte']; $recid = $_POST['recid']; $lu = date("m/d/Y"); // define connection info include "scripts/mysql/db_connect.php"; //connects to the DB w/ above credentials mysql_connect(localhost,$dbuser,$dbpassword); @mysql_select_db($dbname) or die( "Unable to select database"); $sql = "UPDATE nymob SET business='$company', discount='$discount', add_date= '$lu', notes = '$nte' WHERE id ='$recid'"; $result = mysql_query($sql) or die(mysql_error()); ?>[/code]   HEre's the situation. I have this short script called add_modify.php. Is there one Query I can use to both add new if one doesnt exist or update if does exist. The reason is that I would like to use this script for both functions. Thanks for any assistance
  7. One more quick question ...   How would I store those values in an array? For example ... Let's say I did a search for all companies starting w/ 'A' is there a way to store them as such: $business[1][0] = "ABC Company" $discount[1][1] = "50%" and $business[2][0] = "All Good Corp" $discount[2][1] = "30%" etc ... etc ...   Any Assistance would be greatly appreciated!
  8. The ILIKE one did not work ... however after using LIKE it worked and oddly enough didnt seem to be case sensitive ... hmmm ... Thanks you soo much!
  9. Hello,   Alright, I have the following code: [code]<? // Grab business name from form $biz = $_POST[business]; // define connection info include "db_connect.php"; //connects to the DB w/ above credentials mysql_connect(localhost,$dbuser,$dbpassword); @mysql_select_db($dbname) or die( "Unable to select database"); // Build query string $sql = "SELECT business FROM nymob WHERE business LIKE '$biz'"; $result = mysql_query($sql) or die(mysql_error()); // Creat loop, submit query, and display results while ($row = mysql_fetch_array($result)) { $bizname = $row['business']; $dis = $row['discount']; echo $bizname; echo $dis; } ?> <p>DONE![/code] Sorry if it's not pretty but just testing right now ... here's the thing ... I have a form on another page where you enter a company name. It would be easy enough to do a search for a business and it returns a discount. However, I would like for the end user to have the ability to enter just 3 letters of the biz and it returns all the businesses that begin with that. The above code does not display anything if I do a search for ABC. However, if I do a search for the complete name, ABC Company all is well and it displays it fine. Any suggestions on what to add / take off in order to have it return results on a partial search. Currently I have 1 company in DB, and obviously it is ABC Company. Thanks for any assistance!
  10. I just created a mySQL DB w/ the following fields: ID # Business Discount Date Notes And I have this much code: [code]<? // include db_login which contains login credentials include "db_login.php"; // Connect to database mysql_connect($dblocat,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); ?>[/code] Now the db_login.php page contains the login info ... obviously ... I have a form that is going to submit the business name ... However I would like to offer the end user the ability to only type a few letters of the bus and grab all businesses that begin with that ... For example, I want to do a search for ABC Company I want the end user to only have to type ABC or AB in order to get it and any others the begin with that. Any help would be great appreciated!
  11. Alright ... I have the following code: [code] <form action ="print_upgrade.php"> <input type="hidden" name="fname" value="<? echo $first; ?>"> <input type="hidden" name="lname" value="<? echo $last; ?>"> <input type="hidden" name="num" value="<? echo $num; ?>"> <input type="hidden" name="oneyr" value="<? echo $oneyr; ?>"> <input type="hidden" name="oneyr" value="<? echo $twoyr; ?>"> <input type="hidden" name="elig" value="<? echo $elig; ?>"> <input type="hidden" name="code" value="<? echo $code; ?>"> <input type="hidden" name="elig" value="<? echo $elig; ?>"> <INPUT TYPE="image" SRC="images/printPage.jpg" ALT="Print Page" NAME="Print Page"> [/code]   I need a new window to popup w/ no Toolbars, scrollbars, location bar , status bar, menu bar, and not resizable. How do I achive this w/ javascript? Any suggestions would be greatly appreciated!
  12. Perhaps the could be my problem ...   Man thorpe, your a posting  man! HAHA
  13. Alright ... I thought I had a basic understanding of if statements ... but my current project has proved that wrong ... Let's say that I am calling this page:   index.php After I am calling another page via:   index.php?p=contact Now, I have this code: [code]<?php   // Get page   $rpage = $_GET[p];   // Set Default page & title if p is empty   if (empty($rpage)) {   $page ="index_inc.php";   $title="NY Mobile LLC&nbsp; -&nbsp; Internal Network";   }   if ($rpage="contact") {   $page ="contact_inc.php";   $title="NY Mobile LLC&nbsp; -&nbsp; Internal Network&nbsp; -&nbsp; Contact Information";   } ?>[/code]   When I run this page it displays the contact page ... But $rpage is empty! Any help would be appreciated! Thanks! [b]EDIT By thorpe: Please use the full <?php tags with our [ code ] tags, it adds the benifit of syntax highlighting. You should really be using them in your code anyway.
  14. Orio,   May I PM you a link? Thanks! THANKS!
  15. Here's the situation. I have the following code: [code]<div class="stacked"> <div class="basicBox"> <h2>Customer Information</h2> <br /> <table width="100%" border="1" cellpadding="0" cellspacing="0" class="confirmForm tighter"> <tr> <td class="label">Phone Number:</td>   <td class="data">123-456-7890</td> </tr>           <tr> <td class="label">First Name:</td> <td class="data">GEORGE</td> </tr> <tr> <td class="label">Last Name:</td>   <td class="data">JOHNSON</td> </tr> </table> <div class="hrTight"></div> <h2>Phone Upgrade Program Results</h2> <div class="hrTight"></div>   <div id="rebtable"> <table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr>   <th class="headborder">Savings Amount</th>   <th> Eligibility Date</th> </tr> <tr>   <td class="displaycell">     Up to $75 with a two-year subscriber agreement<br>     (or up to $25 with a one-year agreement)   </td>                <td>06/01/2006</td> </tr> <tr><td colspan="2"><hr width="100%"/></td></tr> <tr>    <td class="displaycell">      Up to $150 with a two-year subscriber agreement<br>     (or up to $75 with a one-year agreement)    </td>                <td>04/01/2007</td> </tr> </table>   </div>[/code] Now, I am attempting to grab some info from this page with this: [code]$result=(THE PAGE W/ THE ABOVE CODE) $regex = "/<td class=\"label\">Phone Number:<\/td>.*?<td class=\"data\">(.*?)<\/td>.*?<td class=\"label\">First Name:<\/td>.*?<td class=\"data\">(.*?)<\/td>.*?<td class=\"label\">Last Name:<\/td>.*?<td class=\"data\">(.*?)<\/td>.*?<td>([0-9]{2}\/[0-9]{2}\/[0-9]{4})<\/td>.*?<td>([0-9]{2}\/[0-9]{2}\/[0-9]{4})<\/td>/is"; preg_match_all($regex, $result, $matches); $phno =  $matches[1][0]; $first = $matches[2][0]; $last = $matches[3][0]; $oneyr = $matches[4][0]; $twoyr = $matches[5][0];[/code] Could I please get some help figuring out why $phno, and $first are not storing the info I need? Thanks for any help!
  16. Thanks. However, keep in mind I did not want to post a real phone # and zip code. With that said the combination I use works on the page ... it's just that my code above doesnt display the info. Any Suggestions, thanks!
  17. Thank you! Sorry I havent written back sooner, but I have been testing ...   Let me show the source of the php script page: [code]<? $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"http://thewebsite.com/info.php?from=index.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "phoneNumber=3956458546&zipCode=78956"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $result = curl_exec ($ch); curl_close ($ch); $regex = "/<td class=\"label\">Phone Number:<\/td>.*?<td class=\"data\">(.*?)<\/td>.*?<td class=\"label\">First Name:<\/td>.*?<td class=\"data\">(.*?)<\/td>.*?<td class=\"label\">Last Name:<\/td>.*?<td class=\"data\">(.*?)<\/td>.*?<td>([0-9]{2}\/[0-9]{2}\/[0-9]{4})<\/td>.*?<td>([0-9]{2}\/[0-9]{2}\/[0-9]{4})<\/td>/is"; preg_match_all($regex, $result, $matches); $no = $matches[1][0]; $first = $matches[2][0]; $last = $matches[3][0]; $oneyr = $matches[4][0]; $twoyr = $matches[5][0]; echo $no; echo $first; echo $last; echo $oneyr; echo $twoyr; ?>[/code] Now, when I run this script it just displays a blank page. Any Ideas?
  18. Sure! And thank you for the reply. [code]<div class="stacked"> <div class="basicBox"> <h2>Customer Information</h2> <br /> <table width="100%" border="1" cellpadding="0" cellspacing="0" class="confirmForm tighter"> <tr> <td class="label">Phone Number:</td> // This line is the phone #  <td class="data">123-456-7890</td> </tr>           <tr> <td class="label">First Name:</td> // This line is the first name  <td class="data">GEORGE</td> </tr> <tr> <td class="label">Last Name:</td>   // This line is the last name  <td class="data">JOHNSON</td> </tr> </table> <div class="hrTight"></div> <h2>Phone Upgrade Program Results</h2> <div class="hrTight"></div>   <div id="rebtable"> <table width="100%" border="1" cellpadding="0" cellspacing="0"> <tr>   <th class="headborder">Savings Amount</th>   <th> Eligibility Date</th> </tr> <tr>   <td class="displaycell">     Up to $75 with a two-year subscriber agreement<br>     (or up to $25 with a one-year agreement)   </td>     // This line is the 1st yr upgrade date          <td>06/01/2006</td> </tr> <tr><td colspan="2"><hr width="100%"/></td></tr> <tr>    <td class="displaycell">      Up to $150 with a two-year subscriber agreement<br>     (or up to $75 with a one-year agreement)    </td>     // This line is the 2nd yr upgrade date           <td>04/01/2007</td> </tr> </table>   </div>[/code] Thank you for any help!
  19. UPDATE.   I finially figured out how to grab the page w/ cURL. Now I have the page stored in [i]$result[/i]. You said above that I would have to use regular expressions to get the info I need. I just need a bit of advice ... I need to pull some info off the page ... I need the customer cell phone #, first name, last name, 1st upgrade date, and 2nd upgrade date. Now after looking at the source this is what I noticed: #1: The Phone #, First Name, and Last time all begin with the <td class="data"> tag and ofcourse end with the </td> tag. #2: The 1st and 2nd upgrade dates begin w/ <td> and both end with </td>. Can I please get some help on the regular expressions I will need to pull this info and put them in a variable? Thanks in advance for all your help!
  20. Thank you. Are their any scripters on this forum that could quote me a price to code this? Please let me know, thanks.
  21. thank you. I did some reading on it. Now, one more question. there are 2 pages on the carriers site. There is index.php which is where the form resides asking for the customers phone # and zip code. Once that data is entered on that page you are sent to the info.php page, which if everything was entered correctly displays that things i listed above. How in the world in php do I submit the info to the info.php, and then use file_get_contents to get the data. Any suggestions would be GREATLY appreciated! Best Regards, Brian
  22. Hello,   I am currently working on an internal site for a wireless dealer. We have an upgrade program in place. The carrier offers a site to check a customers upgrade eligibility. On the page it gives the customers name, phone number, 1 yr upgrade date, and 2 yr upgrade date. Along w/ an "Office Use #" at the bottom.   Now, in order to pull up this page we have to enter the customers phone # and zip code.  I was wondering if their is a way to "grab" those values from that page w/ php? Any help would be greatly appreciated! Thanks!
×
×
  • 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.