Jump to content

SharkBait

Members
  • Posts

    845
  • Joined

  • Last visited

    Never

Everything posted by SharkBait

  1. This is the site: www.mrcb.ca It is for a non-profit organization and is a local Concert Band. I need some design/graphic suggestions because I just don't like it very much and unfortunately I am not the greatest when it comes to design. Backend stuff I'm good at, but well ya you get the point! They want to keep the header, yea it's not the best but I can't convince them otherwise, one of the members came up with the text. Thanks
  2. Check for newer version of stored pages: Automatically. Unforturnately its on an intranet so you won't be able to see it.
  3. IE gives me nothing in the way of errors. It doesn't seem to refresh like Firefox does. You can highlight the text in firefox and it removes the highlight when it refreshes. IE just stands and acts dumb :)  Could it be a caching issue with IE? When I manuall update the page is doesn't update the table either....if that helps at all
  4. Most sites I see just use the MD5 hash of the password. [code] <?php if(isset($_GET['key'])) {   $key = $_GET['key'];   // check key against md5 hash that is store in the database (or whereever)   if($key == $users['password']) {     // Activate the account   } else {     // Keys don't match, go mental!   } } ?> [/code]
  5. That is what someone told me to do :P I'm not sure where I put the bit of code then. I'm trying to update a table query on the fly so the user doesn't have to refresh the page. No need to click a button or anything just have the page do it.
  6. I load it on my header.html page in the <body onload="javascript:counterTable();"> Or is that incorrect?
  7. I assume the information is stored in a Database of sorts? Like MySQL?
  8. I think this will only work with Virutal Host with Apache's configuration.  It's easier anyway. It's what I do, and I am sure alot of other web hosts do it as well.  I have 1 machine and multiple domains that point to it. So I do something similar to this in Apache's httpd.conf file: [code] <VirtualHost *:80>   Server www.blah.com   Alias blah.com   DocRoot /home/blah/public_html </VirtualHost> [/code] Now the above isn't totally correct but you get the idea ;)
  9. Ok I followed the tutorial on the aJaxFreaks with updating live content or somehting (this one? http://www.ajaxfreaks.com/tutorials/2/0.php) Anyway I have my code updating on Firefox, but IE doesn't seem to want to update. Unless I close the browser and open the browser.... even with a shift-refresh it doesn't want to update. This is my ajaxFuncs.js file: [code] function createRequestObject() { var req; if (window.XMLHttpRequest) { // Firefox, Safari, Opera req = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE 5+ req = new ActiveXObject("Microsoft.XMLHTTP"); } else { // Cannot create object alert("There was a problem creating the XMLHttpRequest object"); } return req; } var http = createRequestObject(); function sendRequest(act) { // Open PHP script for requests http.open('get', 'show_daily_count.php'); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if (http.readyState == 4 && http.status == 200) { // Text returned FROM PHP script var response = 0; var response = http.responseText; if (response) { // UPDATE content document.getElementById("counterTable").innerHTML = response; // Refresh every 10 secs setTimeout(counterTable, 1000); } } } function counterTable() { sendRequest('counterTable'); } [/code] I call the counterTable() function on the body's onload().  the show_daily_count.php just echo's a table that has been filled by MySQL data. Is there something special I need to do to my headers for IE to get this to work?  Not have it read from the cache or something?
  10. Also a good thing to practice is striping things from $_POST variables if they are going into a query string. [code] <?php $user_name = mysql_real_escape_string(trim($_POST['user_name'])); ?> [/code] That will strip things that might interfer with your MySQL queries that can be harmful to your database. It will also trim any excess white-space as well.
  11. You could probably put it in the [code=php:0]else[/code] section below the [code=php:0] if($_FILES['file']['error'] > 0) [/code] So if there were no file errors, then you look through the files that were uploaded and check to see if any were invalid extension. If they were all the correct extention, then you can do you [code=php:0]move_uploaded_file()[/code] to move the tempoary file to the correct location.
  12. Mine of course is from Finding Nemo! WHoo Haha!
  13. Now is it a good thing that I'm in the top 10 of Topic Starters? Though I just squeak in there at 10th place. :) Was hoping to see my Birthday displayed in pretty lights here too ;) 
  14. I would take a look at why you want to use PHP. Then see if there are any tutorials here on phpFreaks.com that can help you learn. If you have questions we are all willing to help :)
  15. Upon the submitting of the form's button just check to see if they person submitting it is logged in. either by a session or a cookie that has been set when the user logged in.
  16. I like it. The background trips my eyes out a little bit, and when it loaded it loaded the background and then the site on top (think that is why it tripped me out). You pre-load your quicktime movies, which is okie, but it makes the load time on the page a little longer than I personally like. In the freelance section. You use both I and we. Is it just you, or do you have more people working along side you? More of a grammar thing than rating the site ;) On a side note, perhaps offer a PDF or DOC version of your resume as well. There are some CSS validation errors: http://jigsaw.w3.org/css-validator/validator?uri=http%3A%2F%2Fwww.evaluationsite.com&warning=1&profile=css21&usermedium=all Though your XHTML is valid - yay
  17. In the apache config files, it will show/tell you where the 404 page as well as other pages are. I think they're just straight HTML pages. It's been a while since I looked at them.
  18. If you want, can you post the code for the show.php? I can then take a look and see where I can insert the code for you. The above code was more of a guideline. Sorry about that :)
  19. I personally hate entrance pages, especially ones that are flash based. I want to see your site, the content, not some. Welcome, click ENTER to enter kind of thing
  20. On the show.php script you still pass the id of the image.  You can modify the show.php script to use [code=php:0] $_GET['id'][/code] to pull the value from it and then query for how many downloads have been done: [code] SELECT downloads FROM myImages WHERE id = '{$_GET['id']}' [/code] Increment the value it returns and update the database [code] UPDATE myImages SET downloads = '{$newDownloadValue}' WHERE id = '{$_GET['id']}' [/code] :)
  21. I posted my little download script on this thread: http://www.phpfreaks.com/forums/index.php/topic,119653.0.html It too should give you an idea on how to serve files to a client :)
  22. You might need to write a function to display the image when someone clicks on it. So that PHP (javascript i guess could do it too) pass a variable to the database to increment the counter. I have not really done one for images but I have done one similar for downloads.  I created a download.php script that would take the file's id as an argument. [code] <a href="downloadFile.php&id=234">Download File</a> [/code] Then I would need to set up a function for presenting the file to the user and handle the header and database items [code] <?php if(isset($_GET['uid'])) { // Filename are stored by their file_id in the fw/ directory $uid = $_GET['uid']; } $message = ""; $qry = "SELECT file_name, file_type, file_size, downloads FROM support_files WHERE file_id = '{$uid}'"; $result = mysql_query($qry) or die ("MySQL Error: <br />{$qry} <br />". mysql_error()); list($fn, $ft, $fs, $dl) = mysql_fetch_array($result); $extension = explode('.', $fn); $the_file = "fw/{$uid}.{$extension[1]}"; //echo "<p>{$the_file}</p>"; if(file_exists($the_file)) { if(filesize($the_file) == $fs) { $dl++;  // This is what I use to increment the number of downloads $qry = "UPDATE support_files SET downloads = '{$dl}' WHERE file_id = '{$uid}'"; $query = mysql_query($qry) or die ("MySQL Error: <br />{$qry}<br />". mysql_error());                         // Need to pass the proper header to serve the file to the client header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: {$ft}"); header("Content-disposition: attachment; filename={$fn}"); header("Content-Length: {$fs}"); header("Content-Transfer-Encoding: binary");                         // Send the file to the user! readfile($the_file);                         // Exit the rest of script exit(); } else { $message .= "<p>The file size is incorrect. Please notify the <a href=\"mailto:support@.com\">Support</a> team about this.</p>\n"; } } else { $message .= "<p>That file could not be located.  Please notify the <a href=\"mailto:support@.com\">Support</a> team about this.</p>"; } ?> [/code] Not a great explaination but I can try and explain aspects of if for you. It should give you a bit of an idea though :)
  23. Yea I figured that was why mine wasnt working ;)  Thanks agian!
  24. I love the photos! I did a bit of astrophotgraphy but definately not to the distance you can achieve.
×
×
  • 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.