premiso
Members-
Posts
6,951 -
Joined
-
Last visited
-
Days Won
2
Everything posted by premiso
-
Do validation first with strlen. If it is not within those confines then do not waste the time checking it with regex.
-
You do realize that RTFM can help you immensely, especially the user comments. I didn't just post that link for you to ignore it. http://www.php.net/manual/en/function.ftp-rawlist.php#86780 Is something along the lines of what you want, a recursive directory list. If that is not what you want look at modifying it or look through other user comments to see if someone setup something you want. You may also want to check at ftp_nlist and look at those comments as well.
-
You mean more than one column: SELECT * FROM users WHERE (username LIKE '%$search_user%' OR firstname LIKE '%$search_user%' OR lastname LIKE '%$search_user%') Should be what you are after.
-
ftp Lots of functions there!
-
Right, lets randomly color your posts so no one wants (or namely it makes it extremely hard) to read the shit and help you. Good plan!
-
You have invalid HTML, if you notice in mine and Mr. Adam's post we fixed that: <iframe src= <?php echo "../SystemDirectory/280610/1.svg"; ?>" Should be: <iframe src="<?php echo "../SystemDirectory/280610/1.svg"; ?>" Notice the removal of the extra space and the addition of the quote. But either way you "fixed" it apparently. But from that snippet, it seems as though you ignored our suggestions, at least for the html side of things which we both fixed, which is what I was referring to.
-
Why should we bother to help, if you cannot take proper solutions and try to implement them and see how / why we did it the way we did?
-
echo constant(EX_ . $_REQUEST['show']); The constant function is what you are going to need to use. You may also want to check if the variable is_defined before accessing it, given that show could be any number (either that or default show to something if it is not set / out of the range of valid values).
-
Would love to help, but unfortunately no account and I am not willing to get a membership. The main thing that concerns me is what does confirm_query() do? If it does not return the variable as reference then your flaw is that $subject_set is never being set to a value. If it returns an item from the query / updates the subject, then you need to return it. But this is a fair bit of guess work and I do not know what confirm_query does.
-
<?php echo '<iframe src="' . $e . $f . '" width="400" height="250" frameborder="0" scrolling="no"></iframe>";?> A bit cleaner then what you had and should work properly, given that the url is correct.
-
That really is upto you. It depends on your determination to learn Flash (or Java) and how flash connects to a database with registration systems. So the real question is, do you have the proper determination to learn HOW to do it on your own? If not, then you probably cannot do it.
-
Why not just setup an htaccess file that redirects a 301 redirect any page that ends with .htm (via request) to .php. If it was a transparent .htm -> .php that should be fine. The other option would be to revert it back to .htm and add that as a type that is parsed by php.
-
Use Output Buffering (ob_start, ob_get_clean) then do a preg_match or strpos for the string, if that is there then repeat.
-
I am sure you can use array_uintersect to create your own function for comparing the arrays and removing items that are duplicated.
-
You will change it in the php.ini file, which the location should be shown inside of the phpinfo();
-
Need help recording clicks by yearly quarters (newbie)
premiso replied to Primal Hurt Pr1m0's topic in PHP Coding Help
If you cannot figure that out, I would say you should hire someone to do the code for you, or take the time to learn. Good luck. -
You could also probably (not knowing how your server is setup) get away with using: $_SERVER['DOCUMENT_ROOT'] to get to your server document root instead of having to manually define it. This will also make the code a bit more portable.
-
Need help recording clicks by yearly quarters (newbie)
premiso replied to Primal Hurt Pr1m0's topic in PHP Coding Help
$months = array('jan-mar' => array('January', 'February', 'March'), 'apr-jun' => array('April', 'May', 'June'), 'jul-sep' => array('July', 'August', 'September'), 'oct-dec' => array('October', 'November', 'December')); $currentMonth = date('F'); foreach ($months as $file => $month) { if (in_array($currentMonth, $month)) { $fileName = $file . ".txt"; break; } } // file code below Not the best way, but one way to do it. -
Change this line to get the mysql error: $query = mysql_query("select username from users where Username = '$username' and Password = '$md5_password' LIMIT 1") or trigger_error("Username Password Query Failed: " . mysql_error()); Should tell you where the problem lies within the query.
-
Well part of the problem could be that you are using "file" in the second part of the if / or statement instead of "image". To make sure the value is what it should be echo it out for debugging, as PHP is case sensitive and that could be a potential issue too.
-
Need help recording clicks by yearly quarters (newbie)
premiso replied to Primal Hurt Pr1m0's topic in PHP Coding Help
Well why not just save the text file by month using date to get the current month. On a new month it writes to a new text file. Then to get the stats you just have to open the 3 months and count that way. Simple and easy. -
You have a Syntax error (look at the code you posted where it all starts to go red) your syntax error is above that. $query = mysql_query("select * from users where Username = $username and Password = $md5_password"') A few things wrong with this. A. the ' at the very end, this is a syntax error. B. There is no ; at the very end, another syntax error. C. MySQL requires single quotes around text / string data. Here is that line corrected: $query = mysql_query("select username from users where Username = '$username' and Password = '$md5_password' LIMIT 1"); Just an anal part of me, you only return data you need. Since you do not use any data received from the query just pull one record and one column, this will improve efficiency of the query. I have not looked anywhere else, but that should take care of your syntaxual error for that part at least.
-
Need help recording clicks by yearly quarters (newbie)
premiso replied to Primal Hurt Pr1m0's topic in PHP Coding Help
You will be much better off learning SQL and using a MySQL database for handling this. A flat file will be overly slow to parse and if you are trying to read back statistics another person cannot actively write to that file while it is open. After you stopped wanted to just track "clicks" is about when you need to goto a MySQL DB. -
The only way you can do this, is if the scanner is connected to the server and then the server would have to call some program via commandline . exec to receive the scan. If those are your circumstances, sure it is possible. If you are wanting a user from somewhere else to scan in something from their scanner, you cannot do that with PHP and you will have to look into an ActiveX solution.