Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. I don't quite agree with "Marlo" that replied on your forum. I wouldn't call it a "kick-ass tutorial". While showing people how to output content and defining variables is important, a tutorial should still contain more than that. In my opinion you should at least have introduced GET/POST, forms and functions.
  2. For development I would setup my own localhost web server. Then install a version control server (such as Subversion (SVN)) on the remote computer, and the client on your local computer. Then when you finish something commit it to the repository. Version control makes you able to roll-back changes and is especially effective when multiple users are developing on the same project. When you have a finished version you need to get it to the remote server. For that you can use FTP (File Transfer Protocol) or if you and the server uses Linux and you have a shell account on the remote server then you could use scp. FTP would probably be easiest though.
  3. Just use the exact code that Ken showed you.
  4. [code]$string = str_replace('/','',$string);[/code] will replace a slash with "nothing".
  5. Witness some big mafia crime and get a new identity :P Or try to [url=http://www.google.com/intl/en/contact/index.html]call them[/url] so you won't get through some appeal system, but rather talk to somebody personally.
  6. I would say you should use the "Report to moderator" link to notify people with sufficient privileges that it should be deleted.
  7. I found this guide for you: http://www.fonerbooks.com/laptop_1.htm I didn't read it, but it seems good.
  8. The Little Guy: It is different what mime-type a browser will send. That might work in some browsers, but maybe not in all.
  9. Try this: [code]<?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>Sample layout</title> <style type="text/css"> #header { display: block; width: 100%; height: 150px; background:url(image/header.jpg) repeat-x top; text-align:center; } #content { display: block; padding: 1px; width: 100%; } #footer { display: block; width: 100%; height:25px; background:url(image/footer.jpg) repeat-x; position: absolute; bottom: 25px; left: 0px; } </style> </head> <body> <div id="header"><img src="images/logo.jpg" width="250" height="50" alt="logo" /></div> <div id="main">page content</div> <div id="footer">footer</div> </body> </html>[/code]
  10. [code]<?php $arr = explode('.',$filename); $ext = $arr[count($arr)-1]; if(in_array(strtolower($ext),array('pdf','pdt')) { // do stuff } else { echo "Invalid filetype"; } ?>[/code] This should work.
  11. Try use divs instead. Table-less layouts often makes IE work.
  12. None of the above snippets will hide any URL at all. This will however: [code]<?php $downloads_path = "/var/www/downloads/"; $file = $downloads_path.$filename; if(preg_match('/(\.\.\/)/',$_GET['file'])) { die("Access denied!"); } if(!file_exists($file) || !is_readable($file) || !is_file($file)) { die("Error: The file do not exist, is not a file or is not readable!"); } header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=".basename($file)); header("Content-Description: File Transfer"); header("Accept-Ranges: bytes"); header("Content-Length: ".filesize($file)); @readfile($file); ?>[/code] Edit: I'm not sure if the filename check (the preg_match) is perfectly safe.
  13. What is in the other files?
  14. Post your code.
  15. You still need correct permissions, but why not use mysql_create_db() instead?
  16. [quote author=Renlok link=topic=115891.msg474703#msg474703 date=1164664067] lol great question :P if the sites in java youll use java for that part the chat will need php and html coding, actuall all of the site will probly need html code. [/quote] Java and javascript is not the same!
  17. Put this in both of your radio buttons: [code]onclick="this.form.submit();"[/code] Example: [code]<form action="other_page"> <label><input type="radio" name="test" value="yes" onclick="this.form.submit();" /> Yes</label> - <label><input type="radio" name="test" value="no" onclick="this.form.submit();" /> No</label> </form>[/code]
  18. Please put your code inside [nobbc][code][/nobbc]-tags
  19. Try change $username to $_SESSION['username']
  20. Cheesier Angel: Imagine this filename: mysql.db.php That would make: $completeName = "mysql.db.php"; $filename = "mysql"; $ext = "db"; [code]<?php $filename = "mysql.db.php"; $array = explode(".",$filename); $ext = $array[count($array)-1]; echo $ext; // outputs: php ?>[/code]
  21. [code]<?php $word = "cabbage"; foreach(str_split($word) as $character) { echo "{$character}"; } ?>[/code] There is a function made to split up strings.
  22. Try this instead: [code]<?php $path = "/var/www/docs/"; $file = $path.$_GET['file']; if(!empty($_GET['file'])) { echo "<html><title>MY DOMAIN - Error</title><body>ERROR: download file NOT SPECIFIED. USE force-download.php?file=filepath</body></html>"; die(); } else if(!file_exists($file)) { echo "<html><title>MY DOMAIN - Error</title><body>ERROR: File not found. USE force-download.php?file=filepath</body></html>"; die(); } @ini_set('zlib.output_compression',false); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private",false); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=\"".basename($file)."\";" ); header("Content-Transfer-Encoding: binary"); header("Content-Length: ".filesize($file)); readfile($file); die(); ?>[/code] (note change it to the correct path)
  23. Add a new field called order. Have the up link something like this: index.php?move_up=*id* Have the down link something like this: index.php?move_down=*id* [code]<?php if(!empty($_GET['move_up'])) { $query1 = mysql_query("SELECT * FROM queue WHERE id='{$_GET['move_up']} LIMIT 1"); $info1 = mysql_fetch_assoc($query); $query2 = mysql_query("SELECT * FROM queue WHERE order='".$info1['order']-(1)." LIMIT 1"); $info12 = mysql_fetch_assoc($query); mysql_query("UPDATE queue SET order=order-1 WHERE id='{$info1['id']}"); mysql_query("UPDATE queue SET order=order+1 WHERE id='{$info2['id']}"); } else if(!empty($_GET['move_down'])) { $query1 = mysql_query("SELECT * FROM queue WHERE id='{$_GET['move_down']} LIMIT 1"); $info1 = mysql_fetch_assoc($query); $query2 = mysql_query("SELECT * FROM queue WHERE order='".$info1['order']+(1)." LIMIT 1"); $info12 = mysql_fetch_assoc($query); mysql_query("UPDATE queue SET order=order+1 WHERE id='{$info1['id']}"); mysql_query("UPDATE queue SET order=order-1 WHERE id='{$info2['id']}"); } // rest of code here ?>[/code] Now order it by order. PS: You should consider using this instead of all those echoes: [code]echo <<<EOF all your stuff here EOF;[/code] (heredoc)
  24. Try to take a look at this: http://howtoforge.net/intrusion_detection_with_ossec_hids http://howtoforge.net/perfect_linux_firewall_ipcop http://howtoforge.net/perfect_linux_firewall_ipcop_p2
  25. Daniel0

    Hi!

    Hi and welcome :)
×
×
  • 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.