Jump to content

Nakor

Members
  • Posts

    127
  • Joined

  • Last visited

Posts posted by Nakor

  1. I don't think the advertisers are bots. They may be, but if that was the case then all you would need to implement was a visual confirmation code on registration. Email confirmation won't stop people who are paid to advertise on forums.

  2. Oh...well then this would be better for you

    <?$filename = $_POST[pagename].".html";$filedata = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><html><head><title>Page 1</title></head><body>Content</body></html>";$file = fopen($filename, "w+") or die("Couldn't open file.");fwrite($file, $filedata) or die("Couldn't write to file.");fclose($myfile);?>

    In the page content you can use the $_POST feature to insert dynamic content based upon the form you used to create the page. Let me know if you need any more help with this.

  3. I can't think of a way straight off that you can upload to a remote server without FTP. If you figure a way out, I have a script you can use.

    <?if ((!$_POST[post_author]) || (!$_POST[post_title]) || (!$_POST[post_content])) {	header("location:show_makepost.php");	exit;}// set the date, check the post authorputenv("TZ=America/Denver");$created = date("l, F jS, Y - g:i A"); $today = date("Y-m-d");$author = $_POST[post_author];$title = $_POST[post_title];$content = $_POST[post_content];// start putting it into the database$connection = @mysql_connect("localhost", "username", "password") or die(mysql_error());$db_name = "database";$db = @mysql_select_db($db_name, $connection) or die(mysql_error());$sql = 'INSERT INTO `posts` (`title`, `day`, `date`, `author`, `content`) VALUES (\''.$title.'\', \''.$today.'\', \''.$created.'\', \''.$author.'\', \''.$content.'\')';$query = mysql_query($sql, $connection) or die(mysql_error());?>

  4. First, I must tell you. If you are doing this to prevent stealing of your images it won't work. They can hold down left click and drag it off of the page and it will save it. If you are doing it to prevent viewing of the source code you can still click view source in the menu. There is nothing that disabling the right click will do except make people angry. However, since you asked

    <script language=JavaScript>var message="Function Disabled!";function clickIE4(){if (event.button==2){alert(message);return false;}}function clickNS4(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){alert(message);return false;}}}if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}document.oncontextmenu=new Function("alert(message);return false") </script>

  5. A file might have it's advantages if you want to think of it that way, however, you could put them all into an SQL database and then create a script to display your logs in a more appealing way. It just depends on what you want.

  6. I actually had a script to create a file to import into excel and so I figured I would put it on here for you. I am sure you can modify it to your needs. Right now it goes into a PHP database, retrieves some fields and then places them into a file that can be imported directly into excel.

    <?phpmysql_connect("localhost", "user", "passoword");mysql_select_db("users"0;$fp = fopen("./data.csv", "wb");// MySQL Queries$query = "SELECT * FROM Users ordered by Name";$result = mysql_query($query);// Columns$columns = "Name,E-mail,Phone\n";$fwrite($fp, $columns);// MySql Arrayif ($result) {  while ($r = mysql_fetch_array($result)) {    $Name = $r['Name'];    $Email = $r['Email'];    $Phone = $r['Phone'];    // Rows    $data = "$Name,$Email,$Phone\n";    fwrite($fp, $data);  }  echo "A CSV file has been created.";} else {  echo "No data. There may be an error in the database.";}fclose($fp);mysql_free_result($result);?>

  7. You have to create a XSPF file, which is really just an XML file with a list of the songs. There are some things on the page abot how you embed the player into your page with the selected playlist. The XSPF file should look something like this

    <?xml version="1.0" encoding="UTF-8" ?><playlist version="0" xmlns="http://xspf.org/ns/0/">  <title>My Playlist</title>  <annotation>Name of the playlist</annotation>  <creator>Author</creator>  <info>Website</info>  <location>A link to this file</location>  <license>http://creativecommons.org/licenses/by-sa/1.0/</license>  <trackList>        <track>      <location>First MP3 link</location>      <image>MP3 Art link</image>      <annotation>Name of the MP3</annotation>      <info>Link to info about the artist</info>    </track>  </trackList></playlist>

  8. About getting the data into excel:All you have to do is format the data you want in this formfield1, field2, field3, etc.And then you can import that directly into excel where field1 will go into column 1, field2 will go to column2, and so on.

  9. I suppose this would be a good idea but a problem arises in that I don't know how many people you are going to find that are going to want to devote that much time to simply answering questions. If you do find that person, there is a good chance that they are already some sort of a teacher at a school. Also, I don't know how good of an idea this would be. I think when you are learning the opinions of a wide variety of people would be good. If you learn from one person then you will inherit their coding practices when there may be a better way to do it. I believe that right now a very good way to learn is to just read the tutorials and then ask questions on the board whenever you get stuck.

  10. First you have to download PHPZip. Then do the following

    <?PHP    set_time_limit(3000); //for big archives    require("../ss_zip.class.php");     // new empty archive with compression level 6    $zip= new ss_zip('',6);    //add file from disc and store to the archive under its own name and path    $zip->add_file('testdata/folder1/file1.html');    //add file from disc and store to the archive under our/path/ourfile2.html    $zip->add_file('testdata/folder1/file1.html','our/path/ourfile2.html');    //add file generated by the script and store it as testphp/thefile.html    $myfiledata="This content was generated by PHP script and stored to ZIP as a file";    $zip->add_data('testphp/thefile.html', $myfiledata);    //Saving the archive to server under name 'myzip1.zip'    $zip->save('myzip1.zip');?>

    There are more functions here.

  11. I've never seen a query look like this before. Perhaps try

    $query2 = "INSERT INTO `users` VALUES ('$_POST[username]', '$password', '$_POST[admin]')";

    It probably won't make a difference, but you can try anyways. That's the only thing I can think of first off.

    XAMPP

    The root folder being the place where you put the documents to display on the server? If so it's probably C:\Program Files\xampp\htdocs or whatever your install directory is.

  12. They said there were quite a lot of extensions. I plan to thoroughly explore it later tonight, so I will let you know. The downloadabe extensions on the site were for Perl and Tomcat, of which I was interested in both. They came as installers, and were also instantly configured. As I said, I didn't get a really in depth look at it, but from what I saw there wasn't much I saw room to improve on.

×
×
  • Create New...