Jump to content

peranha

Members
  • Posts

    878
  • Joined

  • Last visited

Everything posted by peranha

  1. Is this your comment.php page, or is that page somewhere else?
  2. you have echo $sContents, and it the line before it it is sConents
  3. include('functions.php); you missed the closing '
  4. Do you start the page with session_start()? but you could post some code to help out.
  5. Do you track users with sessions or cookies?
  6. The code that is getting added to the top of my pages is the header.php page, which is called before the file is being downloaded. Do you have any suggestions as to how to fix this.
  7. Thanks, The array is what I was looking for.
  8. Can anyone help me to convert to an image such as this website does on the posts? I input the code into my database, and would like to get the image when looking at posts, or do I have to insert img code into the database.
  9. Here is the code that I have for my download page. <?php error_reporting(E_ALL); if(isset($_GET['id'])) { // open connection $connection1 = mysql_connect($server, $user, $pass) or die ("Unable to connect!"); // select database mysql_select_db($db) or die ("Unable to select database!"); $id = $_GET['id']; $query = "SELECT name, type, size, path FROM " . $pre . "upload WHERE id = '$id'"; $result = mysql_query($query) or die('Error, query failed'); list($name, $type, $size, $filePath) = mysql_fetch_array($result); header("Content-Disposition: attachment; filename=$name"); header("Content-length: $size"); header("Content-type: $type"); readfile($filePath); // close connection mysql_close($connection1); exit; } ?> <?php // open connection $connection = mysql_connect($server, $user, $pass) or die ("Unable to connect!"); // select database mysql_select_db($db) or die ("Unable to select database!"); // create query $query = "SELECT id, name FROM " . $pre . "upload"; // execute query $result = mysql_query($query) or die ("Error in query: $query. ".mysql_error()); // see if any rows were returned if (mysql_num_rows($result) > 0) { // yes while($row = mysql_fetch_row($result)) { ?> <a href="download.php?id=<?php echo $row[0];?>"><?php echo $row[1];?></a> <br> <?PHP } } else { // no // print status message echo "<H1>"; echo "No rows found!"; echo "</H1>"; } // close connection mysql_close($connection); ?> I can download the files, but it adds my header information from the website to the file. It also makes files such as EXE, and others to not work. EX. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <HTML> <HEAD> <TITLE>BSCARDEALERS.COM</TITLE> <link href="../includes/style.css" rel="stylesheet" type="text/css" /> <script src="includes/functions.js"></script> </HEAD> <BODY> <H1 align=center>You are logged in as <a href=useredit.php><strong>mike</strong></a> with the IP address of <b class=red><strong>127.0.0.1</strong></b>!</H1><BR> <H1 align=right><a href=admin.php>Admin</a> | <a href=upload.php>Upload Files</a> | <a href=comments.php>Comments</a> | <a href=pmess.php>PM</a> | <a href=home.php>Home</a> | <a href=useredit.php>Personal Info</a> | <a href=logout.php>logout</a></H1> if anyone could help with the script that would be great.
  10. What error do you get on the screen, or in your log file if using apache.
  11. What do you get on the screen when you go to index.php?
  12. Yes it needs to be included on the page you are using it on, and before you need to use it, so at the top of the page is the best place for it.
  13. Where are you including this file on your first post. That page needs to include the file as well.
  14. Where are you actually including the file? I dont see it on the post. it would look like this include ("file.php");
  15. Add php to all the opening php tags. instead of <? change it to <?php. This happens on my server as well.
  16. Do you own a .com domain or something like this? if not dyndns is what you are looking for. you can also have user type in you public ip address and they will get to your PC if you have your router forwarding traffic to that PC. The only problem with the ip is if you dont pay for a static IP, it is constantly changing. That is where dyndns comes in, you install software on your computer, and it refreshes on the server, and you just go to the .dyndns.org address.
  17. # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride All Look for this in your httpd.conf file and change AllowOverride to All, it is defaulted to NONE.
  18. What Web server are you using? is it apache, IIS
  19. Yes you will unless you escape out of PHP and write in HTML.
  20. What I want is to have the header of the page to show the head.JPG pic, and the body to show body.JPG. I tried to set the head.JPG in the head section, but it just showed the body.JPG pic. So I looked up on W3.org, and this is the way that they said to do it, so I tried it, and it didnt work this way either. If you could give me an example that would be great. Thanks in advance.
  21. I am trying to get 2 background images to work on my page, but cannot, the page loads with just one image, but give me white background with 2 images. a:link, a:visited, a:hover { color: RED; } head { background: #C0C0C0; height: 50px; } body { background: url(../pics/header.JPG), url(../pics/body.JPG); } That is what I have, and it doesnt work. Tried with quotes around the path, and that didnt work either.
  22. I am new to this, and I read on another site that this is more secure.
×
×
  • 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.