Jump to content

Alex

Staff Alumni
  • Posts

    2,467
  • Joined

  • Last visited

Everything posted by Alex

  1. http://en.wikipedia.org/wiki/Backlink
  2. That's not PHP. That's what you should be running in phpmyadmin to create the table and insert the records.
  3. AFAIK there isn't any software that can do that. I guess it depends on how large and complicated the project is, but you can't you do that yourself fairly easily?
  4. You need to use urlencode and urldecode. echo '<td><a href="data.php?symbol= ' . urlencode($symbol) . '" >' . $symbol . '</td>'; And when getting the data from $_GET: echo urldecode($symbol);
  5. As corbin touched upon, I would avoid using JavaScript in scenarios where the same effects can be reached with other means. There are many basic tasks like image pre-loading, changing images onhover, etc.. that are often done in JavaScript that can all be done through CSS. In those cases it's not necessary to use JavaScript and definitely a better idea to use CSS. Even though the user base that doesn't support JavaScript is fairly small at the time why risk the chance of losing even a single visitor if it's not necessary. But in the more likely case that you're using more involved JavaScript whose effects can't be achieved by other means, it's always a good idea to adhere to the ideas of Graceful Degradation and provide and alternate route to those users who may not support JavaScript.
  6. According to this website the median hourly pay for a fast food worker in Australia is $10 AUD. According to the same website in the US it's $7.53 USD per hour, or approximately $8.65 AUD.
  7. Check out this topic: http://www.phpfreaks.com/forums/index.php/topic,295366.0.html
  8. The problem with the first method is that you're using eval. The standard is "Eval is evil", just Google it and you'll find plenty of articles explaining exactly why you shouldn't use eval. With your second method there are a few things I'd do a bit differently. My first issue is with this line: $variables=$variables ? $variables : $GLOBALS; Although null does evaluate to false you should use a function like isset instead. My other issue with the code is that there's no need to check to see if the variable exists in the string before you attempt to replace it. If it does not exist and you try to replace it simply won't be replaced (obviously). $variables = isset($variables) ? $variables : $GLOBALS;
  9. In the code I provided that's what $password is.
  10. echo hash('sha512', 'somesalt' . $password); hash
  11. We can't help you without seeing relevant code.
  12. That's the output of the image. If you want to view it as an image then you need to send the appropriate headers. header('Content-type: image/png');
  13. Yes, it's possible. As long as there's no transparency within the part of the image you want to keep it would be pretty easy. You'll need to go over the image and find out the coordinates for where it starts, and where it ends. Some functions you should look into: imagecolorat imagecolorsforindex You can use those to determine if a particular point is transparent or not. (For transparent pixels the alpha will be 127.) Once you determine those 2 points you can easily crop the image to what you want.
  14. Well then it's a good thing there is so much information available about it online, isn't it?
  15. To get the data from the MySQL result returned by mysql_query you need to use a function like mysql_fetch_assoc, like so: function get_Name(){ $sql="SELECT * FROM sec_code WHERE code=". get_Data() .""; $result=mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); echo $row['Name']; }
  16. Aside from the fact that you should be performing nl2br after htmlentities so you don't remove the html line breaks you just inserted, it does worked as expected, I just tested. $msg = nl2br(htmlentities(get_magic_quotes_gpc() ? strip_tags(stripslashes($_POST['status'])) : strip_tags($_POST['status']))); When you enter into the form you see (&nbsp; in the html) not a space.
  17. The key is a string, so you need to place quotes around it in the query. Because you haven't it was thinking that you were comparing it against another column. $sql="SELECT * FROM sec_code WHERE code=". get_Data() .""; should be: $sql="SELECT * FROM sec_code WHERE code='". get_Data() ."'";
  18. Did you try fixing what I said initially? If that's fixed it should work: $msg = htmlentities(get_magic_quotes_gpc() ? nl2br(strip_tags(stripslashes($_POST['status']))) : nl2br(strip_tags($_POST['status'])));
  19. This isn't making much sense. You're trying to fade the comments in and getting the data via AJAX? Your code is getting $msg from whatever you sent to the file via AJAX, that's not getting it from the database at all. You need to explain better because this really isn't making any sense.
  20. Instead of having your get_Data() function echo the data have it return it like so: function get_Data() { $License = "license.txt"; $File = fopen($License, 'r'); $Read = fread($File, 35); fclose($File); return $Read; } You can then use the return value in context like so: function get_Name(){ $sql="SELECT * FROM sec_code WHERE code=". get_Data() .""; $result=mysql_query($sql) or die(mysql_error()); echo $result['Name']; }
  21. Why are you reading from the $_POST array when you're getting the data from the database? Shouldn't you be doing something like this?: $msg = nl2br(stripslashes($r['status']));
  22. Post your code for inserting it into and displaying it from the database.
  23. I think it's possible, but depending on your location it might not be that easy, as you're experiencing. Personally I think it would be cool if I could find a similar opportunity in my vicinity. I've been teaching myself PHP and MySQL, among many other languages and fields, for a few years now and seeing as I'm young and have no experience with programming in a professional environment I think I could benefit tremendously from such an experience.
  24. You shouldn't be performing htmlentities when you're inserting the data into and when displaying it from the database. You also have a problem with this line: $msg = htmlentities(get_magic_quotes_gpc())?nl2br(strip_tags(stripslashes($_POST['status']))):nl2br(strip_tags($_POST['status'])); You're messing up the parenthesis. Your conditional is [m]htmlentities(get_magic_quotes_gpc())[tt].
  25. Using htmlentities will solve this problem. Ex: will be converted to &nbsp;
×
×
  • 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.