Jump to content

xenLiam

Members
  • Posts

    43
  • Joined

  • Last visited

Everything posted by xenLiam

  1. Line 42, $artistname has a problem (no matching end quote) $register = mysql_query("INSERT INTO artists VALUES('','$artistname,'$location','$genre','$email','$password','','','no')");
  2. Does it give you a PHP error, or does it not simply insert the values into the table?
  3. Hello! First of all, welcome to the forums! I'm sure you'll like it here. I know I do. Anyway, to your problem (although you should really post this in PHP Help, but I'll still try to help you out), you could store the username in a session variable, and make queries to the database to pull information through mysqli_fetch_array() using the username you stored. For example, if the username is "admin", store it in $_SESSION['user'] = "admin"; (given that you already started a session), then use that to fetch data from the database, in which that data would only be visible to the user "admin". Sure, it isn't the safest way to do it, but that would be how the concept would go.
  4. "Step into the future!" If that's the future, well... lol. Honestly I like the design in its simple form, although they could've done better typography-wise (better Web 2.0-ish fonts and stuck to being modern) but that's just my opinion.
  5. When you're inserting a page view count to the database, log its IP address too. That way, you can check if the IP address is already registered and if it is, don't count it anymore. Not the most fool-proof method, but that works.
  6. If you're running it only to show the contents of the zip file, why not make a temporary copy of the zip file with a different file name, you know, with normal alpha-numeric characters, and use that in ZipArchive() and auto-delete it once the contents are shown?
  7. Increase the value of memory_limit in php.ini to something like 128MB or 384MB.
  8. What was the complete error? A line and a variable must be shown after "Notice: Undefined index". I can't follow which one.
  9. Put ob_start() after opening <?php. This is probably due to the whitespace you have. As such: <?php ob_start(); // Output buffering session_start(); // store session data $_SESSION['views']=1; ?> <html> <body> <?php //retrieve session data echo "<br><br>Pageviews=". $_SESSION['views']; if(isset($_SESSION['views'])) $_SESSION['views']=$_SESSION['views']+1; else $_SESSION['views']=1; echo "<br><br>Views=". $_SESSION['views']; ?> </body> </html>
  10. You better wrap "$query = $_GET['query']" inside an if statement to avoid showing errors when search.php is accessed directly. if(!empty($_GET['query'])) { $query = $_GET['query']; } else { die(); } I don't think that type="name" has something to do with it being read or not, although I could be wrong.
  11. Welcome to the forum! I myself started out as a self-taught programmer, and I've advanced through the stages. I hope you enjoy the community as much as I do.
  12. I would agree to what mac_gyver said. Instead of including graph.php, just make a header call for it so that it's marked as an image file and not a PHP file, and use the <img> HTML tag to show it. Although your current method shouldn't be making problems IF the function of graph.php is to produce a graph and once the graph is echoed, it should die.
  13. Edit php.ini and make sure display_errors is on. Restart your web server afterwards.
  14. Same result, it works for me. http://screencloud.net/v/b6lk
  15. Use ffmpeg. I found a FFMPEG PHP class in GitHub. I forked it and I might do my own fixes to it if needed, it hasn't been updated in a long time (the last latest update was from 5 months ago) The original repo is located at https://github.com/swider132/FFmpeg-PHP-Class
  16. Read as in put it in php.ini? Put extension=ext.so in php.ini (replace ext.so with the extension you want to include and make sure it exists in your extension directory).
  17. There are a lot of good hosts out there. MDD Hosting seems to be a good choice. I haven't seen a single negative review about their service. Also, if you host a lot of sites, maybe it's a good choice to go for a VPS rather than shared hosting, although that's just me. Other hosts you can try are KnownHost and WiredTree.
  18. I'm on Ubuntu and I'm using phpStorm. It's available for other platforms a well (Windows, Mac). Best IDE I've ever used. Read up about it on Google and you'll get positive results.
  19. Simply put, require() - Includes a file. If it encountered an error including the file, it will display an error and stop execution. require_once() - Does a require() but if the file is already included, it will no longer include it and won't produce a loop of errors. include() - Includes a file. If it encountered an error including the file, it will display an error and continue executing the rest of the script (unsafe). include_once() - Does an include() but if the file is already included, it will no longer include it and won't produce a loop of errors.
  20. Well, obviously. I was talking about having web 2.0-ish features. Who would be interested in a blank white page with non-CSS bordered tables and an explosion of Times New Roman everywhere?
  21. I use Ubuntu 12.04 myself and I managed to get a LAMP server running by running apt-get install lamp-server^ Include the caret (^) at the end.
  22. ... You change "," to ";" in $data1 and $data2.
  23. You would need to use PHP to put data into a database (I am thinking of MySQL). You could assign a hidden <input> area to have a value of the total and then use that so PHP can insert it to a DB.
  24. That depends on what you are trying to achieve. You need to provide the resource in mysqli_query anyway, so making two separate mysqli_connect resources will probably not conflict each other once they are used in queries.
  25. I am guessing that $username is a string, and therefore it needs to be enclosed in quotation marks. Although I may be wrong. Try: $sql = "SELECT * FROM users WHERE username='{$username}';"; and see if that will work for you. Also, are you sure that $link is a valid resource and does not return a FALSE flag?
×
×
  • 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.