Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. That must be something you did. My code could in no possible way make that error. Show us the [i]entire[/i] code from index.php and we will show you how to implement the code correctly.
  2. Try this code: [code]<?php echo <<<EOF <tr> <td><img src="images/cat_left_top.jpg" width="180" height="40"></td> </tr> EOF; $categories = mysql_query("SELECT * FROM store_categories ORDER BY id"); while($c = mysql_fetch_assoc($categories)) { echo <<<EOF <tr> <td class="cat_text"> <a href="?list={$c['id']}"{$c['categorie_name']}</a> EOF; if($_GET['list']) { $_GET['list'] = mysql_real_Escape_string($_GET['list']); $c_list = mysql_query("SELECT * FROM store_categorie_list WHERE list_categorie_id='{$_GET['list']}' ORDER BY id"); while($c_list_item = mysql_fetch_assoc($c_list)) { echo "\t\t\t<br /><br/>--- {$categorie_list_get['list_name']}\n"; } } echo <<<EOF </td> </tr> EOF; } echo <<<EOF <tr> <td height="0"><hr align="center" width="170" size="1" noshade class="cat_bar"></td> </tr> EOF; ?> [/code]
  3. You would count the sessions that have been active for e.g. the last 15 minutes. This post belongs in the PHP Help forum by the way.
  4. Daniel0

    b or strong

    I'd say neither of them should be used. Instead do something like this: [code]<span class='strong'>text</span>[/code] and use this CSS code to format it: [code].strong { font-weight: bold; }[/code]
  5. Put [code]<?php ob_start(); ?>[/code] at the very top and [code]<?php ob_end_flush(); ?>[/code] at the very bottom.
  6. You don't like have a screenshot of your output? For what I can tell from what you posted, it looks ok.
  7. This must be some of the worst websites ever: [list] [*]http://www.rasputin.de/CF/Jugend/ [*]http://www.my-callaloo.com/ [*]http://www.rogerart.com/ (http://digg.com/design/Worst_Web_Page_in_the_World) [/list] [b]EDIT:[/b] More links: [list] [*]http://hosanna1.com [*]http://www.harrold.org/rfhextra/antivirus.html [/list]
  8. It was more like the text on the logo I meant.
  9. Can you post a screenshot or give me a link to the site?
  10. What errors do you get using that code?
  11. That would be a matter of CSS, but I am not sure what you got problems with? Do you create the menu dynamically? Is that the problem?
  12. What do you mean with "show and hide type thing"?
  13. I would prefer making my own framework.
  14. You could use sessions. index.php: [code] <?php session_start(); $_SESSION['path'] = "/home/you/public_html/something"; echo <<<EOF <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <title>Test site</title> <link rel="stylesheet" type="text/css" href="stylesheet.php /> </head> <body> <!-- some html here --> </body> </html> EOF; ?>[/code] stylesheet.php: [code]<?php session_start(); header("Content-type: text/css"); echo <<<EOF #topnav { background:url({$_SESSION['path']}/includes/teal.gif) repeat-x; padding-top:5px; color:#fff; } EOF; ?>[/code]
  15. The database could be built up like this: [tt]------------------------------------ | id | filename | path | downloads | Files table ------------------------------------   |   --------           | ----------------------- | pid | p_fid | p_uid | Permissions table -----------------------                   |   -----------------   | ---------------------------- | id | username | password | Users table ----------------------------[/tt] Then you would store the files in some folder (e.g. /home/you/files/) with a random filename generated like this: [code]uniqid(md5(microtime()))[/code] Then you would run this query to check if the user has permissions to download the file: [code]SELECT p.*,f.* FROM permissions AS p LEFT JOIN files AS f ON p.p_fid=f.id WHERE p.p_uid='{$user_id}' AND f.id='{$file_id}';[/code]
  16. Would the [url=http://pear.php.net]PEAR[/url] [url=http://pear.php.net/package/Text_Wiki]Text_Wiki[/url] package do what you want?
  17. We do not have the source of the ajaxpage function, so we do not know what it does. This belongs in the javascript forum by the way.
  18. You can't check it if people are accessing it directly. Instead you will have to place the files in a directory that is not accessible from a web browser. Then you would have to make a download script that works like this: index.php?act=download&id=1316 The script would then check if the logged in user has permission to download file id 1316 (file data is stored in the database). If they don't, show an error message, else load the file, sent the correct headers and echo the file.
  19. Just use [code]<Directory /images>     Options -Indexes </Directory>[/code] instead then.
  20. To check for numbers: is_int or is_numeric (the latter one is probably the best). To check for strings: is_string
  21. [code]foreach($elements as $val) { foreach($val as $key => $val) { echo "<option>$val</option>"; } }[/code] Then this should do it.
  22. Just do this: [code]foreach($elements as $key => $val) { echo "<option>$val</option>"; }[/code]
  23. Hmm. Apparently fread [i]do[/i] require the length paramenter. Didn't though it did... Well, this should work: [code]function get_file($url) { return file_get_contents($url);[/code]
  24. You could make it not show up: [code]display:none;[/code]
  25. Have a field in the post table called is_validated. Set the default to 0, then on some page you have access too, select all posts where is_validated=0. When displaying posts select all posts where is_validated=1.
×
×
  • 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.