Jump to content

lucasl

Members
  • Posts

    21
  • Joined

  • Last visited

    Never

Everything posted by lucasl

  1. Hi! You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1 I'm getting this error. I think it says line one because the code is being eval'd (using wordpress). I looked through and didn't find any problems with my querys. [code]<?php $do = true; $e_id = $_POST["ed_id"]; $e_name = $_POST["ed_name"]; $e_url = $_POST["ed_url"]; $e_description = $_POST["ed_description"]; if (empty($e_name)||empty($e_url)||empty($e_description)) { echo 'You didn\'t fill in all the fields, and the site was not edited. Please go back and try again.'; $do = false; } if ($do) { if (!get_magic_quotes_gpc()) { $e_name = stripslashes($e_name); $e_url = stripslashes($e_url); $e_description = stripslashes($e_description); $e_name = addslashes($e_name); $e_url = addslashes($e_url); $e_description = addslashes($e_description); } $dbhost = "localhost"; $dbusername = "freesoft_admin"; $dbuserpassword = ""; $dbname = "freesoft_freesearch"; $link = mysql_connect($dbhost, $dbusername, $dbuserpassword); if (!link) { echo mysql_error(); } else { if (!mysql_select_db($dbname)) { echo mysql_error(); } } $query = "UPDATE sites SET name = '$e_name', url = '$e_url', description = '$e_description' WHERE id = $e_id;"; $res = mysql_query($query); if (!$res) { echo mysql_error(); } mysql_close(); echo "The site was successfully edited."; $dbname = "freesoft_wordpress"; $link = mysql_connect($dbhost, $dbusername, $dbuserpassword); if (!link) { echo mysql_error(); } else { if (!mysql_select_db($dbname)) { echo mysql_error(); } } } ?>[/code] I'm using $do because it I exit or die, the rest of the wordpress page will stop.
  2. Hi! [code]<?php $error = 0; $backupFile = 'freesearch' . date("Y-m-d") . '.sql'; $command = "mysqldump --opt -h $dbhost -u $dbusername -p $dbpassword $dbname > $backupFile"; system($command, $error); echo "$error"; ?>[/code] This script should work fine, and $error returns 1, but for some reason, I can't find the sql file. (I looked in the folder the script is in, public_html and the root) Any ideas?
  3. lucasl

    Why Linux?

    Thats like saying, "Why is eating so popular?" Go here: [url=http://www.ubuntu.com/]http://www.ubuntu.com/[/url]
  4. I'm self taught at PHP, but originally I got a book on Blitz Basic for game programming. If you think about it, all languages are really the same at the core, with variables, ifs, whiles, etc. PS. Now I know Basic, C++(sorta), PHP, [url=http://www.gamemaker.nl]GML[/url], Actionscript, Python, (X)HTML, CSS. I think that's it...
  5. Post and get, I don't really know why. Its just the way I learn't.
  6. This probably won't work, but it can't hurt to try. Try using $_SERVER['PHP_SELF'] instead of its own filename. Also, don't use tables if you can help it. :)
  7. Sounds like you aren't putting "\n" between sections. EG. [code=php:0] //Instead of: <$php echo "$section1 $section2"; ?> Consider: <$php echo "$section1\n $section2"; ?>
  8. I used number_format, and it worked fine. Or did it? It keeps saying it loaded in 0.00005 or less seconds! Can somebody test it [url=http://www.freesoft.logical-host.com/]here[/url] (its at the bottom of the page)?
  9. Here's an interesting note, look at this: [code]Starttime Raw: 0.43816100, 1166334795 Fintime Raw: 0.43820800, 1166334795Page loaded in 5E-05 secs. fin: 1166334795.44 start: 1166334795.44[/code] Thats all the variables. Raw is the array result of millisecs seperated by a comma. I think something is wrong with my millisecs command EDIT: And by millisecs I mean microtime():)
  10. Mine is as well PS. I can't post for 20-50 mins
  11. I got 0 if I rounded it to 4 or less, and 3E-05 for 5. I haven't tried 6.
  12. Well, I don't know about the images, but I would of thought the easiest way would be to put the names/links in a mysql and write an html file with php fwrite().
  13. That didn't work, and I didn't think it would. The computer doesn't care what order I add things in, or what my variables are called. PS. Thanks for the <?php tip.
  14. Hi, I'm doing a page load time on my website, but for some reason its not working. When I round the final time result to 4 or less, it just displays zero. When its five, it shows '3E-05'. Also, echo 'Page loaded in $fintime secs.' doesn't display the variable, it just displays $fintime. Here's my code. [code] //At the top: <?   $mtime = explode(' ', microtime());   $starttime = $mtime[0] + $mtime[1]; ?> //At the bottom:   <?     $mtime = explode(' ', microtime());     $fintime = $mtime[0] + $mtime[1];     $loadtime = $fintime - $starttime;     $loadtime = round($loadtime, 5);     echo 'Page loaded in '.$loadtime.' secs.';   ?> [/code] If you want to see my html as well, view the page source source [url=http://www.freesoft.logical-host.com]here[/url].
  15. Hi, I want my pages to show how long they took to load. I know how to do this, but I don't want to show it at the end of the page (I don't have a footer). Is there a way to do this (I want it in my second out of three divs). There are three work-arounds, but I don't know how to do either of them. (Are they even possible?) 1. I'll be happy if it goes on the bottom of the last div, but vertical-align won't work 2. Is there a way to put something in a div after it has been called? 3. Can php sort of [i]send[/i] the echo to part of the document? Thanks for the help.
  16. Well, yes, but for something automated like a website directory, its much easier.
  17. Thanks for the advice. With the appearance, I can't do much about the right sidebar, because I need it in the blog and not the site. With the navigation, even though I set the text to x-large and xx-large, in the blog and the site, it is different. Do you know why? With the request page, you are completely right, and I fixed it all up. And by the way, I hate Windows too, and for this reason I'm not only doing windows. Notepad++ and Firefox are for Linux (hooray!), Mac, Windows and I think FreeBSD. This said, since Windows users make up something like 80+% of all computer users, much of the stuff on the site will be for Windows. I will try to keep it non platform dependent though.
  18. [img]http://www.m-software.de/screenshot/Screenshot.png?url=http%3A%2F%2Fgoogle.com.au&scale=3&width=225&height=150[/img] That's an example of this cool thing I found. The image url is http://www.m-software.de/screenshot/Screenshot.png?url=<?siteurl?>&scale=<?Idontknowwhatthisdoes?>&width=<?width?>&height=<?height?> There is more info at the site below, but... It is in German or Deutch. [url=http://www.m-software.de/thumbshots/]http://www.m-software.de/thumbshots/[/url]
  19. Hi everyone! Freesoft is a freeware site which reviews freeware. Also, if you want some freeware that you can't or can't be bothered finding, go to the request page and we will find it for you! [url=http://www.freesoft.logical-host.com]http://www.freesoft.logical-host.com[/url] Well, what do you think? Don't go easy on me, but don't be mean. If you don't like something, say why. Also, .com is pending. Does anyone know of a good short free domain in the meantime? Co.nr is taken. Thanks!
×
×
  • 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.