Jump to content

bratsmasher

Members
  • Posts

    15
  • Joined

  • Last visited

Everything posted by bratsmasher

  1. Thanks for the help.
  2. Thanks man! You just solved my problem. It seems like it is a combination of issues that made this one up. The other thing I just realized is that the file path starts from the web site folder, not C:. Just one more quick question: is there a simple way to convert a file name with spaces into a name without them? I would assume you would have to pull the name into an array and then search for the spaces character by character. Am I on the right track?
  3. Thank you to all of you who have responded to this plea for help. Every one of my folder/files are a single word with no spaces (website,php, image, etc). The browser is also adding random things to the link. It should look like this: C:/php/website/Files/CFRH.png Instead, I get this: http://localhost:8000/php/website%0Ciles/%7BCFRH.png%7D It changes the word files to Ciles, and encapsulates the file name with 7B and 7D. Does anyone know why this is occuring?
  4. I am not running WAMP or any sort of web server. Due to certain restrictions, I can only use the PHP 5.4 development server for this project. The idea is to create a filing system using a web GUI to organize images, be able to run a search for specific records, and then create a link to send them to the image on the local machine. I am all ears If you have another method to do so.
  5. @computermax2328: I tried taking out the C:. I am still getting the % signs in my hyperlink. Is there anything else I can do to fix it? Also, I am not sure what I am doing is even possible. By creating a link to a file on my local computer, can a person remoting into the machine click on those links to open the specific image/file?
  6. Hello: I am having a problem with making hyperlinks to link to the right location. What I want it to do is just add the filename to the end of the first part (C:\php\website\files\insertfilenamehere.jpg). instead, I get something like this: file:///C:/php/website%0Ciles/%7Bwin2010filebutton.png%7D. Why are % signs and more slashes showing up in my file path? Could anyone point me in the right direction as to why they are not showing up correctly? I would appreciate any help that can be given. while($row = mysql_fetch_array( $result )) { // Print out the contents of each row into a table echo $row['file']; $inf= $row['file']; echo "<tr><td>"; echo $row['tfid']; echo "</td><td>"; echo $row['lname']; echo "</td><td>"; echo $row['fname']; echo "</td><td>"; echo "<a href=\"C:\php\website\files\{$inf}\">Link</a>"; echo "</td></tr>"; } echo "</table>"; .
  7. Thanks Jessica. my page now generates with links, but the links do not work. Instead of the link that was supposed to generate, I get this: file:///C:/php/website%0Ciles/%7BCFRH-logo-new.png%7D This is what I get from right clicking on the link and going to properties. Any ideas as to why the link has become convoluted?
  8. Unfortunately, that did not work either. I'm still getting that damn parsing error.
  9. If it is any help, the format that I have the file names saved are filename.pdf . I am only storing the direct name.
  10. Unfortunately, I am still getting the same error. "if you right click of the "Link" and inspect element you will see what i mean" - I am not sure what you mean by this. I am not able to get a webpage to generate, so I am not able to right click on a generated link. //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("$database",$dbhandle) or die("Could not select database crfh_db"); echo "connected to DATABASE <br>"; //queries the database tables. Takes data from two tables, staff and pic and joins them together (innerjoin) $query = "SELECT staff.tfid, staff.lname, staff.fname, pic.file ". "FROM staff, pic ". "WHERE staff.tfid = pic.tfid and staff.lname='$lname'"; $data = mysql_query($query) or die(mysql_error()); while($info = mysql_fetch_array( $data )) { // Print out the contents of each row into an array //*********************************************************** $inf = $info['file']; echo "<a href=\"C:\php\website\files\'.$inf.'\">Link</a>"; Echo "<b>Name:</b> ".$info['tfid'] . "<br> "; Echo "<b>Email:</b> ".$info['lname'] . " <br>"; Echo "<b>Phone:</b> ".$info['fname'] . " <tr>"; } ?>
  11. Thank you for the help you have given so far. I appreciate it. I tried breaking the code down like you mentioned. I still get that same parse error. Also, I am not sure that I understand what you mean by letting the browser render its own quotes. Does this mean that my code is not written correctly? Is my method incorrect? Btw, I have tested the remaining code and the rest of it works. It is just this single line which I am not understanding.
  12. It sort of worked. I recieved a different error this time: Parse error: syntax error, unexpected '' (T_ENCAPSED_AND_WHITESPACE), expecting identifier (T_STRING) or variable (T_VARIABLE) or number (T_NUM_STRING) on line 34. Does this mean that I still have an error with quotes or am I doing this totally wrong?
  13. I am getting an error on line 34.
  14. Hello: I am having a bit of a problem with hyperlinks. I am creating a database to store and organize documents. What I am trying to do is to pull the location of the document (which only stores the direct file name) out of the database, concatonate it to the folder location and then turn it into a working hyperlink. Whenever I try to do so, I get a Parse error: syntax error, unexpected 'file' (T_STRING), expecting ',' or ';'. This has to be a simple matter of not putting a comma or dash in the right place, however I have been staring at my code for a long time and I cannot seem to figure out where it is. Could someone help me? //connection to the database $dbhandle = mysql_connect($hostname, $username, $password) or die("Unable to connect to MySQL"); echo "Connected to MySQL<br>"; //select a database to work with $selected = mysql_select_db("$database",$dbhandle) or die("Could not select database crfh_db"); echo "connected to DATABASE <br>"; //queries the database tables. Takes data from two tables, staff and pic and joins them together (innerjoin) $query = "SELECT staff.tfid, staff.lname, staff.fname, pic.file ". "FROM staff, pic ". "WHERE staff.tfid = pic.tfid and staff.lname='$lname'"; $data = mysql_query($query) or die(mysql_error()); while($info = mysql_fetch_array( $data )) { // Print out the contents of each row into an array //*********************************************************** Echo '<a href="C:\php\website\files\'.$info['file'].'">Link</a>'; Echo "<b>Name:</b> ".$info['tfid'] . "<br> "; Echo "<b>Email:</b> ".$info['lname'] . " <br>"; Echo "<b>Phone:</b> ".$info['fname'] . " <tr>"; } ?>
×
×
  • 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.