Jump to content

per1os

New Members
  • Posts

    3,095
  • Joined

  • Last visited

Everything posted by per1os

  1. Yep it is how it should be done. It is in the php install manual.
  2. Post the code for do_addtopic.php We need to see code to help.
  3. What you stated there really makes no sense to me. are you sure the query is right ???? look how you join is that the right way ???? cheers I am pretty sure it works because it didn't produce an error. The only query that produced an error was when he tried to query a mysql resource id.
  4. $id=$_GET['id']; $result=mysql_query("SELECT * FROM message_msg INNER JOIN forums ON idtop_msg='$id'") or die('Error: ' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . ' ';} That should work for ya.
  5. I never said you would have a MySQL error, rather PHP Notice Errors. turn error_reporting to E_ALL www.php.net/error_reporting See how many notice errors you can come up with on each of your pages.
  6. Come on now, let's not teach bad coding practice. You always put quotes around variable definitions for literal values. If you don't it takes it as a constant which causes a notice error which slows down processing time. The quotes around the variable definitions have nothing to do with it. <?php $dbhost= "localhost"; $dbuser= "root"; $dbname= "database"; $connect=mysql_connect($dbhost,$dbuser)or die(mysql_error()); $mysqldb=mysql_select_db($dbname); ?> Let's not try and teach him an inefficient way of coding, and on that note if for some reason his username was ROOT and he had a constant defined as ROOT, well the ROOT constant definition would be assigned to $dbuser. Create a user for the MySQL database and don't use the root with blank password. You should have a user for each database anyway for security purposes.
  7. Needs to be posted in the Javascript Section.
  8. <?php if(isset($_POST['create_employee'])){ echo "Employee Data Posted"; $xmlfileName = $_POST['xmlfileName']; $empName = $_POST['empName']; $empAddress = $_POST['empAddress']; $empSSN = $_POST['empSSN']; $empCompany = $_POST['empCompany']; $xml_dec = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; $rootELementStart = "<employee>"; $rootElementEnd = "</employee>"; $xml_doc= $xml_dec; $xml_doc .= $rootELementStart; $xml_doc .= "<employeename>"; $xml_doc .= $empName; $xml_doc .= "</employeename>"; $xml_doc .= "<employeeaddress>"; $xml_doc .= $empAddress; $xml_doc .= "</employeeaddress>"; $xml_doc .= "<SSN>"; $xml_doc .= $empSSN; $xml_doc .= "</SSN>"; $xml_doc .= "<company>"; $xml_doc .= $empCompany; $xml_doc .= "</company>"; $xml_doc .= $rootElementEnd; $default_dir = "xml_files/"; $default_dir .= $xmlfileName .".xml"; $fp = fopen($default_dir,'w'); $write = fwrite($fp,$xml_doc); } ?>
  9. Umm yea what was the error message, you notice my code is different than the other guys. Mine actually spits out the actual error.
  10. http://forums.devarticles.com/general-programming-help-4/how-can-i-find-out-the-user-mac-address-1846.html I doubt it is possible, not a very good banning system. I can easily spoof my mac address. That and any computer inside a hub like a school, will be banned because they all filter through a router which is the Mac address you would receive.
  11. <?php if(isset($_POST['create_employee'])){ echo "Employee Data Posted"; $xmlfileName = $_POST['xmlfileName']; $empName = $_POST['empName']; $empAddress = $_POST['empAddress']; $empSSN = $_POST['empSSN']; $empCompany = $_POST['empCompany']; $xml_dec = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; $rootELementStart = "<employee>"; $rootElementEnd = "</employee>"; $xml_doc= $xml_dec; $xml_doc .= $rootELementStart; $xml_doc .= "<employeename>"; $xml_doc .= $empName; $xml_doc .= "</employeename>"; $xml_doc .= "<employeeaddress>"; $xml_doc .= $empAddress; $xml_doc .= "</employeeaddress>"; $xml_doc .= "<SSN>"; $xml_doc .= $empSSN; $xml_doc .= "</SSN>"; $xml_doc .= "<company>"; $xml_doc .= $empCompany; $xml_doc .= "</company>"; $xml_doc .= $rootElementEnd; $default_dir = "xml_files/"; $default_dir .= $xmlfileName .".xml"; $fp = fopen($default_dir,'w'); $write = fwrite($fp,$xml_doc); ?> Should work.
  12. $id=$_GET['id']; $data_p=mysql_query("SELECT * FROM message_msg INNER JOIN forums ON idtop_msg='$id'") or die('Error: ' . mysql_error()); $result=mysql_query($data_p)or die('Error, query failed<br />' . mysql_error()); while($row = mysql_fetch_array($result)){ echo $row['subject_msg'] . ' ';} Report the error message.
  13. Not really. Just need to use www.php.net/file_get_contents The tricky part is you have to grab all the links from the site and than open them up too, and parse them etc. I created something similar in C# but that was a pain in the ass. To be honest with php timeouts etc you are better off coding in a desktop application such as C++, Java etc. But either way have fun.
  14. Are you by change using <? or <?php If you are using <? I would suggest switching to <?php for some reason there tends to be conflicts with the two.
  15. For some reason mysql_connect doesn't like that root stuff without a password. I would edit mysql via command line and create a user. Google MySQL Create User to find out how to do that and give him access to the database.
  16. I like using a mixture of both classes and functions. I have a database class created. Which has my own special functions like query etc. Then I have a db functions page, which I create functions that access the class functions, this way I do not have to pass the DB Class to other classes I just have to call the functions. But I get my error handling and logging features that the class has to offer, such as "how many queries ran" etc.
  17. After the 5th retry call a function to store the IP etc in a database with the timestamp that is either 5 minutes etc ahead or the exact time of the 5th retry. After a certain amount of time that entry should be deleted. But if the IP is in that db you should not allow them to try it.
  18. http://www.phpfreaks.com/tutorials/43/0.php
  19. Yes it will.
  20. Google freelance php work and post at other places.
  21. Post in the freelance section.
  22. Don't use mysql_close. www.php.net/mysql_close The connection automatically closes when the script is done running.
  23. Did you try copying the php.ini and putting it in the C:\Windows directory and restarting the server?
  24. Closing the mysql connection is unnecessary and you are doing it before you call mysql_result. Chances are that is what is screwing you up. Also be wary of SQL Injection.
  25. UPDATE news_news SET `spam` = (spam + 1) WHERE `id` = '$id'
×
×
  • 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.