-
Posts
16,734 -
Joined
-
Last visited
-
Days Won
9
Everything posted by PFMaBiSmAd
-
So, the code you posted is inside of a loop of some kind?
-
One of the suggestions in the SMF forum to help was to switch the login to use the email address instead of the username (I don't know if that is just a configuration option), under the assumption that most people have their email hidden in their profile and the bot script would not have access to it, while the username is a part of everyone's profile, appears in the posts, and appears in the list of recently active users. I personally just hid my on-line status to see if removing my username from the list of recently active users will help with the problem.
-
To start with, the html you are outputting is missing quotes around all the attribute values. A link is - <a href='a_url'>some content/image here</a> An image is - <img src='a_url' alt='some alt text' width='133' height='86'> I recommend validating your resulting pages at validator.w3.org
-
Simply do a global search/replace through all the files in the project (using Notepad++ for example) - 1) Change all <? to <?php 2) Change all <?phpphp to <?php 3) Change all <?php= to <?php echo
-
Issue connecting to multiple databases
PFMaBiSmAd replied to wwfc_barmy_army's topic in PHP Coding Help
I also suggest setting error_reporting to E_ALL (or to a -1) and display_errors to ON (it apparently is already set to this value) so that all the php detected errors will be reported and displayed. You would have been getting a undefined notice message concerning the non-existent $conn_local variable inside of the function. You will save a TON of time. -
Issue connecting to multiple databases
PFMaBiSmAd replied to wwfc_barmy_army's topic in PHP Coding Help
You do know that every function has an isolated local variable scope so that you can write whatever code, using whatever variables you need inside that function without needing to worry about interfering with the operation of the code that is calling that function? You need to pass the connection link into the function when you call the function - your_function($conn_local){ .... $result = mysql_query($sql,$conn_local); .... } -
Issue connecting to multiple databases
PFMaBiSmAd replied to wwfc_barmy_army's topic in PHP Coding Help
For the exact code snippets you posted, using the same username/password to make the connection(s), and the stated symptom (query works without the $conn_local variable in the mysql_query() statement), the most likely reason why your query is failing with an error is if the $conn_local variable doesn't exist in the same scope where the mysql_query() statement is at. Your code should (but doesn't) have error checking and error reporting logic in it to tell you/log why the query is failing, both now during development and later on the live server. -
Issue connecting to multiple databases
PFMaBiSmAd replied to wwfc_barmy_army's topic in PHP Coding Help
I'm going to guess that in your actual code, you have a variable scope problem. -
ALL external data ($_POST, $_GET, $_COOKIE, $_FILES, and some $_SERVER/$_ENV values) can be anything anyone wants to submit, cannot be trusted, and must be validated to insure it has an expected value. You must validate that the forum and/or thread exists before you do ANYTHING with the submitted data.
-
Doesn't the information in that message suggest to you that you should contact the administrator of that receiving mail server to find out why it considers the email that you sent to it to be spam? Best guess is, if this worked from your previous mail server to that specific receiving mail server, but not from your current mail server, it is likely due to missing or incorrect dns zone records (A, MX, SPF) for your sending mail server.
-
^^^ That's a sure sign that you don't have a proper reason to do something that multiple people have told you is not done in database designs. Computers only do exactly what their programming tells them to do. If you don't have a definable and clearly stated reason for doing something, then you are wasting your time trying to do it because it has nothing to do with the problem you are trying to solve. Frankly, we see this all the time in the Forum, things being overcomplicated due to a lack of definition - OP: I'm trying to do the following (small part of the overall design) ______________. People trying to help: What you stated is not done for the following reasons ____________. Rather than telling us one small part of what you think you want to do, what overall goal are you trying to accomplish? OP: My overall goal is to do the following ______________. People trying to help: Why didn't you say that in the first place. What you stated you are trying to make work has nothing to do with achieving that goal. Here is the simple way you can do ______________.
-
You are sending output to the browser at line 10 in your file. I'll guess it is the blank line inbetween your ?> and <?php tags - ?> <----------- this is a line that is outside of your php code and will be sent to the browser. <?php You also need an exit; statement after your header() redirect, because anyone who wanted to view your page can just ignore the header() redirect that is being sent to the browser.
-
You would use a $_SESSION variable to 'remember' the last correct question/page and then test that session variable on the next page to determine what happens on that page (redirect back to the previous page or display the expected content for the page.)
-
The range of an unsigned integer, which is the minimum you should be using for your ID column, is 0 to 4,294,967,295 Don't worry about some deleted IDs out of 35,000 rows. Your database doesn't care about this and neither should you or your code. Imagine the inefficiency and wasted time, if every time someone died, your government moved up everyone's assigned ID number
-
Concatenation of php variables usually results in typos and resulting syntax errors. Much simpler to just put the php variables inside of a double-quoted string - echo "$admin_pass - $admin_login x {$row['mempass']} - {$row['username']}<br />";
-
And judging from the posts on the SMF forum about this ( http://www.simplemachines.org/community/index.php?topic=422543.0 ) , this might also be due to bot scripts trying to log on and are locking out the legitimate members when they visit the forum. There should log entries concerning using up the alloted login attempts if this is what is occurring.
-
Because not everyone is affected, I suspect that a failed log in causes the Current list of active users to be cleared/logged out... The only thing I can see client side is that the 'phpfreaks_session' or the 'smfcookie913' cookie is being removed on the page request where you get logged out. Actually, manually deleting both of those cookies doesn't log you out.
-
From the SMF change log for fixes in the latest 2.0 RC5 version -
-
The 550 error generally means that relaying is not permitted (despite what the actual 'text' part of the error states) and that you are not satisfying the relaying restrictions setup on your sending mail server. A) You should check what requirements your new host has concerning relaying (generally either the To: email address must be hosted on the sending mail server or the From: email address must be hosted on the sending mail server to satisfy relaying restrictions) and/or using SMTP authentication, B) For us to be able to help, we would need to know what requirements your host has and what your script is doing.
-
You would need to restore the backup copy of your database that you made before you attempted to do this. If you don't have a backup of your database, for the query you executed, you would need to go through all the data values and put back in the zero's where they belong.
-
MySql returns integers as strings - how to return as integers?
PFMaBiSmAd replied to fbwb's topic in MySQL Help
<?php $row['id'] = '3'; $row['desc'] = 'text'; function make_int($val){ return is_numeric($val) ? (int)$val : $val ; } $row = array_map('make_int',$row); echo json_encode($row); ?> -
The $ is not used to reference an object of the class. Your code should be - $Themes["root"]->Title = $Title; Using $Title means you have a php variable named $Title that holds the actual name of the object that you want reference.
-
MySql returns integers as strings - how to return as integers?
PFMaBiSmAd replied to fbwb's topic in MySQL Help
What exact problem are you having? By definition ALL data that is fetched from a result set is an array of strings, but if the contents of a string happens to be a number, it will be treated as a number by php - -
A) Have you tried a basic .html file? Most WAMP packages have a default index.htm or index.html file that should display something. B) Have you tried a basic .php file, such as - <?php phpinfo(); ?> C) What does a 'view source' in your browser of the blank pages show? D) Have you checked the web server and operating system log files to see if there are any relevant error messages?