Jump to content

dnienhaus

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

dnienhaus's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. What if i have 6 listboxes and each one has a value i need returned and then the values come together to form one part number? can i do something like "$_POST['select_box_name', 'select_box_name', 'select_box_name']"?
  2. I have some listboxes that a user will select values from and in turn it is supposed to take the selected value and print as strings to form a part number. I have all the boxes made but how can i return the value of an option selected in the list menu? i.e. <option value="L">Clutch Pedal Assy</option> how would i return or print to screen "L"?
  3. test Here are the results: Checking: http://intranet/engineering/drawings/024T-G4203.pdf No File http://intranet/engineering/drawings/024T-G4203.pdf when i copy and paste that the file opens so ahhh! No errors either.
  4. if i copy and paste the url it has it open the file so it does exist just won't say so. returns... test Here are the results: no such file
  5. got rid of the blank page but url still doesn't validate. and it does exist. i have the same problem still nothing has changed. bummer.
  6. Updated code: search.php [code]<?php $username="root"; $password=""; $database="engineering"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); if(!empty($_POST['search'])) { echo '<h1>test</h1>'; $query="SELECT * FROM Assembly WHERE PARTNUMBER LIKE '%" . $_POST['search'] . "%'"; $result=mysql_query($query) or die(mysql_error()); if($result != false) { echo "Here are the results:<br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center bgcolor=#00FFFF><b>Creation Date</b></td> <td align=center bgcolor=#00FFFF><b>Creator</b></td> <td align=center bgcolor=#00FFFF><b>Nomenclature</b></td> <td align=center bgcolor=#00FFFF><b>OBID</b></td> <td align=center bgcolor=#00FFFF><b>Part Number</b></td> <td align=center bgcolor=#00FFFF><b>Part Drawing</b></td> </tr>"; while ($r = mysql_fetch_array($result)) { // Begin while $CREATIONDATE = $r["CREATIONDATE"]; $CREATOR = $r["CREATOR"]; $NOMENCLATURE = $r["NOMENCLATURE"]; $OBID = $r["OBID"]; $PARTNUMBER = $r["PARTNUMBER"]; $PARTNUMBER = str_replace('"','',$PARTNUMBER); $url = 'http://intranet/engineering/drawings/' . $PARTNUMBER '.pdf'; echo "$url"; include ('checkfile.php'); echo "<tr> <td><center>$CREATIONDATE</center></td> <td><center>$CREATOR</center></td> <td><center>$NOMENCLATURE</center></td> <td><center>$OBID</center></td> <td><center><b>$PARTNUMBER</b></center></td> <td><center>$url</center></td></tr><br><br><hr>"; } // end while echo "</table>"; } else { echo "problems...."; } } else { echo "Search string is empty. <br> Go back and type a string to search"; } ?>[/code] checkfile.php [code]<?php $link = $url; echo "Checking: $link<br><br>\n"; flush(); $fp = @fopen($link, "r"); if (!$fp) { echo "No File"; } else { fclose($fp); echo "Yay it's there!"; } ?>[/code]
  7. the problem is not with the file its with using the $PARTNUMBER variable in the url and i can't figure out how to get it to read whats stored in the variable instead of the plaintext $PARTNUMBER.
  8. didn't change anything...
  9. I am trying to validate links before the print on a page. My problem is I am using a variable in the link itself and it does not parse until runtime right? So when my checkfile.php is called to check if the link exists it always says no because it is seeing "http://intranet/engineering/drawings/{$PARTNUMBER}.pdf" instead of the link with the partnumber thats called. I need to know if there is a way to have the link umm get the part number before it validates it. Anybody have a clue? search.php [code]<?php $username="root"; $password=""; $database="engineering"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); if(!empty($_POST['search'])) { echo '<h1>test</h1>'; $query="SELECT * FROM Assembly WHERE PARTNUMBER LIKE '%" . $_POST['search'] . "%'"; $result=mysql_query($query) or die(mysql_error()); if($result != false) { echo "Here are the results:<br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center bgcolor=#00FFFF><b>Creation Date</b></td> <td align=center bgcolor=#00FFFF><b>Creator</b></td> <td align=center bgcolor=#00FFFF><b>Nomenclature</b></td> <td align=center bgcolor=#00FFFF><b>OBID</b></td> <td align=center bgcolor=#00FFFF><b>Part Number</b></td> <td align=center bgcolor=#00FFFF><b>Part Drawing</b></td> </tr>"; while ($r = mysql_fetch_array($result)) { // Begin while $CREATIONDATE = $r["CREATIONDATE"]; $CREATOR = $r["CREATOR"]; $NOMENCLATURE = $r["NOMENCLATURE"]; $OBID = $r["OBID"]; $PARTNUMBER = $r["PARTNUMBER"]; $PARTNUMBER = str_replace('"','',$PARTNUMBER); ////////////////////////////////////////////////////////////////////////////////////////////////////// $url = "http://intranet/engineering/drawings/$PARTNUMBER.pdf"; include ('checkfile.php'); ////////////////////////////////////////////////////////////////////////////////////////////////////// echo "<tr> <td><center>$CREATIONDATE</center></td> <td><center>$CREATOR</center></td> <td><center>$NOMENCLATURE</center></td> <td><center>$OBID</center></td> <td><center><b>$PARTNUMBER</b></center></td> <td><center>$url</center></td></tr><br><br><hr>"; } // end while echo "</table>"; } else { echo "problems...."; } } else { echo "Search string is empty. <br> Go back and type a string to search"; } ?>[/code] checkfile.php [code]<?php $link = $url; echo "Checking: $link<br><br>\n"; flush(); $fp = @fopen($link, "r"); if (!$fp) { echo "No File"; } else { fclose($fp); echo "Yay it's there!"; } ?>[/code]
  10. for some reason when i do that it doesn't parse the variable and the link shows up as "http://intranet/engineering/drawings/$PARTNUMBER.pdf" and not the part #....
  11. here the full page code : [code]<?php $username="root"; $password=""; $database="engineering"; mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); if(!empty($_POST['search'])) { echo '<h1>test</h1>'; $query="SELECT * FROM Assembly WHERE PARTNUMBER LIKE '%" . $_POST['search'] . "%'"; $result=mysql_query($query) or die(mysql_error()); if($result != false) { echo "Here are the results:<br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center bgcolor=#00FFFF><b>Creation Date</b></td> <td align=center bgcolor=#00FFFF><b>Creator</b></td> <td align=center bgcolor=#00FFFF><b>Nomenclature</b></td> <td align=center bgcolor=#00FFFF><b>OBID</b></td> <td align=center bgcolor=#00FFFF><b>Part Number</b></td> <td align=center bgcolor=#00FFFF><b>Part Drawing</b></td> </tr>"; while ($r = mysql_fetch_array($result)) { // Begin while $CREATIONDATE = $r["CREATIONDATE"]; $CREATOR = $r["CREATOR"]; $NOMENCLATURE = $r["NOMENCLATURE"]; $OBID = $r["OBID"]; $PARTNUMBER = $r["PARTNUMBER"]; $PARTNUMBER = str_replace('"','',$PARTNUMBER); $url = "'http://intranet/engineering/drawings/$PARTNUMBER.pdf'"; include ('checkfile.php'); echo "<tr> <td><center>$CREATIONDATE</center></td> <td><center>$CREATOR</center></td> <td><center>$NOMENCLATURE</center></td> <td><center>$OBID</center></td> <td><center><b>$PARTNUMBER</b></center></td> <td><center>$url</center></td></tr><br><br><hr>"; } // end while echo "</table>"; } else { echo "problems...."; } } else { echo "Search string is empty. <br> Go back and type a string to search"; } ?>[/code] its grabbing checkfile.php which is the file_exists function and always returning false. Partnumber is defined PHP is 5+ url is valid i can paste it in my browser and open the file and yes it's on a business network.
  12. Heres my variable i want to validate.. [code]$url = "'http://intranet/engineering/drawings/$PARTNUMBER.pdf'"; include ('checkfile.php');[/code] Heres the file_exists code.. [code]<?php $filename = "$url"; if (file_exists($filename)) {} else {$url = "No Drawing";} ?> [/code]
  13. My file_exists always returns false? I know the file exists so what might be the problem?
×
×
  • 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.