
per1os
New Members-
Posts
3,095 -
Joined
-
Last visited
Everything posted by per1os
-
Yep it is how it should be done. It is in the php install manual.
-
Post the code for do_addtopic.php We need to see code to help.
-
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.
-
$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.
-
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.
-
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.
-
Needs to be posted in the Javascript Section.
-
<?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); } ?>
-
Umm yea what was the error message, you notice my code is different than the other guys. Mine actually spits out the actual error.
-
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.
-
<?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.
-
$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.
-
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.
-
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.
-
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.
-
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.
-
[SOLVED] Limit to failed login retries
per1os replied to faulty_by_design's topic in PHP Coding Help
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. -
[SOLVED] MYSQL PHP adding "next page" in current PHP code
per1os replied to $username's topic in PHP Coding Help
http://www.phpfreaks.com/tutorials/43/0.php -
How do i find a developer who can do what i need?
per1os replied to ryandeal's topic in PHP Coding Help
Google freelance php work and post at other places. -
How do i find a developer who can do what i need?
per1os replied to ryandeal's topic in PHP Coding Help
Post in the freelance section. -
Don't use mysql_close. www.php.net/mysql_close The connection automatically closes when the script is done running.
-
Did you try copying the php.ini and putting it in the C:\Windows directory and restarting the server?
-
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.
-
UPDATE news_news SET `spam` = (spam + 1) WHERE `id` = '$id'