
per1os
New Members-
Posts
3,095 -
Joined
-
Last visited
Everything posted by per1os
-
set www.php.net/error_reporting at the top of the page to E_ALL and make sure display_errors is on, if not set it on with ini_set at the top of the php page.
-
Are you sha1 the user input to check against the database? <?php $dbpassword = sha1("testtext"); $password = "testtext"; $sha1_pass = sha1($password); if ($password == $dbpassword) { echo 'This should never happen as regular text is being tested against sha1 encrypted text'; }elseif ($sha1_pass == $dbpassword) { echo 'This should work as you are testing an sha1 hashed password vs another sha1 hashed password'; } ?> As an example.
-
You would need to use regular expressions (www.php.net/ereg) to grab all the text data in between parans, than from there filter each of those into an array and do the above code on them to get the one word, put each word in an array and use either str_replace to replace the entire (word,word) with the new word. This takes into account that the text will never have parans as part of the actual text. Shouldn't be too hard to do.
-
www.php.net/file_get_contents or www.php.net/file Did you try using those functions instead of fopen ? Also is fopen producing an error message?
-
[SOLVED] Merging two different types of arrays
per1os replied to goosebriar's topic in PHP Coding Help
<?php foreach ($first_array as $key => $array) { $new_array[$key] = $array; } print_r($new_array); ?> or www.php.net/array_merge -
They actually offer PHP classes in school....lol thats messed up. I never thought to see the day. All I was able to do was PERL and Java and C++.. Oh well PHP really was better learnt without a teacher, teachers really are dumb for the most part when it comes to the webbased programmed as most of them grew up with C and Cobalt. Fun stuff. But agreed, this stuff could of been easily read or figured out with a little attention in class....but then again I never paid attention in any programming class...actually I never even want to class...come to think of it I still got a 4.0....weird stuff.
-
www.php.net/fopen allow_url_fopen I believe has to be set to on in the php.ini file or an .htaccess file or with www.php.net/ini_set inside the php file.
-
Nope your not. http://www.phpfreaks.com/forums/index.php/topic,143952.html
-
create table tablE_name( id int(11) NOT NULL auto_increment, .....etc ); Same as on a linux server.
-
Yea, someone was just stating that you were trying to get it to a different domain, my bad.
-
New to PHP. Need help with structure on existing site
per1os replied to RDavis's topic in PHP Coding Help
This is a help site, but we cannot help people who are not willing to read. OSCommerce is a massive system, that most people here do not know how to do the thing you are asking. Chances are this question is best directed to the OSCommerece forum, where people are fluent with the software. It is really not much of a PHP question as a "can you customize this for me" statement. Really we are all just about as blind as you are with OSCommerece here unless someone dealt directly with it. I am not going to spend 2 days trying to search for what you need to do with the OSCommerece site and give you the answer and not get anything out of it. I suggest going to the correct forum, or doing as Thorpe suggest and read up on PHP Programming. Its not that we do not want to help you, but your request is pretty unreasonable. You are assuming that everyone who is fluent at PHP has worked with your OSCommerece software. Its not nice to assume. -
<?php function real_escape($string) { return get_magic_quotes_gpc()?mysql_real_escape_string(stripslashes($string)):mysql_real_escape_string($string); } ?> Thats my variation of it.
-
[SOLVED] query help - select distinct and sort
per1os replied to sandrob57's topic in PHP Coding Help
Why are you summing the IP, that will essentially add up the ips together... $result = dbquery("SELECT ip, COUNT(ip) AS ip_count FROM fusion_ip GROUP BY ip ORDER BY ip_count DESC LIMIT $rowstart,20"); Not sure if my sql is correct, but that is the idea, you want to use the GROUP BY Expression with the COUNT expression -
You either have to post the data using www.php.net/cURL OR you have to attach the data via GET or POST (post with curl) as cookies and sessions will not work across domains as someone else pointed out.
-
Mysql <= 3.x cannot do Subquerys. You have to branch it off into 2 seperate queries. $record = mysql_query("SELECT order_id FROM nHeal_printed WHERE order_id = '" . $order_id . "'"); if (mysql_num_rows($record) > 1) { echo 'Duplicate record'; }else { $sql = "INSERT INTO nHeal_printed(printed_id, order_id, gift_type, gift_first, gift_last, gift_email, first_name, last_name, phone, amount) VALUES ('', '$order_id', '$gift_type', '$gift_first', '$gift_last', '$gift_email', '$first_name', '$last_name', '$phone', '$amount')"; }
-
You do know that you have to set the cookie right? www.php.net/setcookie Or use sessions www.php.net/session_start
-
if (isset($_COOKIE['visit'])) { needed an extra ) and I encapsulated the visit in single quotes to later avoid a notice of undefined constant.
-
[SOLVED] [solved] quick question: undefined index
per1os replied to andr923's topic in PHP Coding Help
if (!isset($_REQUEST['view'])) www.php.net/isset will solve that issue. -
$rater_info = $rater_rating . '|' . $rater_ip . $rater_end_of_line_char; $query="UPDATE something SET whatever='$rater_info' WHERE id='$id'"; Give that a go.
-
[SOLVED] make a http request behind the scenes - query an API
per1os replied to fwd4's topic in PHP Coding Help
www.php.net/file_get_contents www.php.net/curl either should work. -
It may not be able to be decrypted by that function but it will definitely increase your MySQL performance not making MySQL hash up the password. That was the goal. As for decrypting it, I am sure that PHP or MySQL has something setup (or maybe apache?) that adds their own seeds to the hash. If the md5 function or sha1 function have been seeded in a way than that md5encryption site is useless as it can only decrypt hashes that have not been seeded.
-
You have a small problem with your syntax <?php $query="UPDATE something SET whatever='$rater_rating" . "|" . "$rater_ip" . "$rater_end_of_line_char' WHERE id='$id'"; ?> Probably not the cleanest but should work.
-
www.php.net/empty or <?php if ($string == "") { echo 'the string is blank!'; } or www.php.net/is_null if you are looking for null values.
-
can you please elaborate on this? im not sure what yuo mean? I though I was using php functions but I was stoiring it in mySQL in a table in a hash form. Unless you mean dont store it in the table in a hash form but only when using the passwords in the php script. Is this what you mean?? If so wouldn't that be insecure?? Umm no. www.php.net/md5 www.php.net/sha1 PHP has built in functions. Instead of: <?php mysql_query("INSERT INTO user (`pass`) VALUES (sha1('$password'));"); ?> It would be : <?php mysql_query("INSERT INTO user (`pass`) VALUES ('" . sha1($password) . "');"); ?> That way you use PHP to do the dirty work and not MySQL.