hackalive
Members-
Posts
652 -
Joined
-
Last visited
Everything posted by hackalive
-
Want to integrate with their exisitng LDAP login so they dont have another account to rememebr
-
I did that - but it is not PKCS7 only PKCS1 from what I could read.
-
Hi guys, I am using phpseclib AES, however I need to eenable PKCS7 padding. How can I do this? Cheers
-
Any other suggestions?
-
Hi guys, So I am making a PHP site that I will host and others can make use of (after creating an account), however I want to integrate it with their local LDAP accounts/server. I do not want to distribute copies of the software for them to put on their servers. So I am thinking they would first need to visit myproduct.theircompany.com to login (this code would be on a server able to acces their LDAP server), which when it returns as authenticated (OK) it would then rediret to myproduct.com and have them as logged in. Now my issue is, how do I stop people being able to spoof myproduct.com into thinking someone is logged in, how do I pass the data back from myproduct.theircompany.com to myproduct.com? Any ideas? Or questions? Cheers
-
Hi guys, I saw this in some CSS ages ago and cannot remember where so cannot remember how it goes exactly ... but i'd like to do somehting like this with my css: <htmi id="something"> <style> #something { h1 { } } #other { h1 { } } so if anyone know how it works or how to make it work thatd be great! cheers
-
SOLVED Had to use $.parseJSON first
-
Update: The JSON sting is valid according to http://jsonlint.com/
-
If I changed "$("#add").val(result.add);" to alert(result.add); it would alert: [{ "Manufacturer": "Toyota", "Sold": 1200, "Month": "2012-11" }, { "Manufacturer": "Ford", "Sold": 1100, "Month": "2012-11" }, { "Manufacturer": "BMW", "Sold": 900, "Month": "2012-11" }, { "Manufacturer": "Benz", "Sold": 600, "Month": "2012-11" }, { "Manufacturer": "GMC", "Sold": 500, "Month": "2012-11" }, { "Manufacturer": "HUMMER", "Sold": 120, "Month": "2012-11" }] (minus the nice formatting of course) Hope that makes sense? If not please let me know.
-
Hi Guys, I have an ajax script similar to this: $.ajax({ type: "POST", url: "/z/l.php", data: String, dataType: 'json', cache: false, success: function(result) { if(result == ''){ } else { $("#name").val(result.name); $("#add").val(result.add); } } }) However add is an jsopn array like: [{ "Manufacturer": "Toyota", "Sold": 1200, "Month": "2012-11" }, { "Manufacturer": "Ford", "Sold": 1100, "Month": "2012-11" }, { "Manufacturer": "BMW", "Sold": 900, "Month": "2012-11" }, { "Manufacturer": "Benz", "Sold": 600, "Month": "2012-11" }, { "Manufacturer": "GMC", "Sold": 500, "Month": "2012-11" }, { "Manufacturer": "HUMMER", "Sold": 120, "Month": "2012-11" }] However I can not get $.getJSON to work as it is not coming from a URL as result.add is already a JSON string. (the $.ajax is called based on meething certain conditions during keyUp, everything else is working except the JSON string for add - I want to make it a form drop down <select>). Any advice? Cheers in adavnce.
-
I think this is the solution RewriteEngine On RewriteCond %{REQUEST_FILENAME}.php !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/.]+)/?$ /redirects/$1.php [N] RewriteCond %{DOCUMENT_ROOT}/redirects/%{REQUEST_FILENAME}.php !-f RewriteCond %{DOCUMENT_ROOT}/redirects/%{REQUEST_FILENAME} !-d RewriteRule ^/redirects/([^/.]+)/([^/.]+)/?$ /redirects/$1/$2.php [N] RewriteRule ^([^/.]+)/?$ /$1.php [L] RewriteRule ^([^/.]+)/([^/.]+)/?$ /$1/$2.php [L] Any comments on it?
-
Hi guys, I have this htaccess code: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([^/.]+)/?$ /redirects/$1.php [N] RewriteRule ^([^/.]+)/?$ /$1.php [L] RewriteRule ^([^/.]+)/([^/.]+)/?$ /$1/$2.php [L] It works a treat anything like mydomain.com/xyz that has a file in the folder mydomain.com/redirects/ calls the file in the redirects folder and lets me PHP 301 everyone. I now want it to work for mydomain.com/redirects/anyotherfoler/ so I tried: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([^/.]+)/?$ /redirects/$1.php [N] RewriteRule ^([^/.]+)/([^/.]+)/?$ /redirects/$1/$2.php [N] RewriteRule ^([^/.]+)/?$ /$1.php [L] RewriteRule ^([^/.]+)/([^/.]+)/?$ /$1/$2.php [L] Which does redirect me, but RewriteRule ^([^/.]+)/([^/.]+)/?$ /redirects/$1/$2.php [N] still "powers on" and is called on the new url and I get an error of: So any ideas why this is happening? I tried: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([^/.]+)/?$ /redirects/$1.php [N] RewriteCond /redirects/%{REQUEST_FILENAME} !-f RewriteCond /redirects/%{REQUEST_FILENAME} !-d RewriteCond /redirects/%{REQUEST_FILENAME} !-l RewriteRule ^([^/.]+)/([^/.]+)/?$ /redirects/$1/$2.php [N] RewriteRule ^([^/.]+)/?$ /$1.php [L] RewriteRule ^([^/.]+)/([^/.]+)/?$ /$1/$2.php [L] But it didn't help. So any ideas? Cheers PS This does not work either - same error: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^([^/.]+)/?$ /redirects/$1.php [N] RewriteCond {DOCUMENT_ROOT}/redirects/%{REQUEST_FILENAME} !-f RewriteCond {DOCUMENT_ROOT}/redirects/%{REQUEST_FILENAME} !-d RewriteCond {DOCUMENT_ROOT}/redirects/%{REQUEST_FILENAME}" !-l RewriteRule ^([^/.]+)/([^/.]+)/?$ /redirects/$1/$2.php [N] RewriteRule ^([^/.]+)/?$ /$1.php [L] RewriteRule ^([^/.]+)/([^/.]+)/?$ /$1/$2.php [L]
-
Its so I can place the variables (dynamic content) to the corect place within the HTML email (contents.php) There are some echo in contents.php - but these dont work when sending the email
-
This is the code for getting the message contents $postdata = http_build_query( array( 'name' => 'MEMEME' ) ); $opts = array('http' => array( 'method' => 'POST', 'header' => 'Content-Type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('contents.php', false, $context); $mail->MsgHTML($result);
-
Hi guys, I am using PHPMailer to send emails - however I need to include some ifnromation outpuuted by PHP (i.e, echo etc). Now I know PHP wont work on the email client side - but I need to include this informaiton dynamically. How can I do this? Cheers in advance PS I did try htmlentities around the php output but that didnt work - not did processing the whole message through that (totally broke when doing this).
-
Ive gone for this (seems to work for the moment) $sql = array(); foreach ($arrResult as $result) { $result[3] = '"'.$mysqli->real_escape_string($result[3]).'"'; $result = implode(",",$result); $query = "INSERT INTO `table2` VALUES(NULL,$result)"; $mysqli->query($query); echo '<b>'.$mysqli->error.' </b>'.$query.'<br /><br />'; } Now just how to make on bulk query (using $sql)
-
See edit of post above. Ive tried something in regards to inserting It appears to now come down to the fact it is adding ' to the start and end of the $result when it outputs on the query.
-
Further developed the code: foreach ($arrResult as $result) { $result[3] = '"'.$mysqli->escape_string($result[3]).'"'; $result = implode(",",$result); $result = $mysqli->real_escape_string($result); $query = "INSERT INTO `table2` VALUES(NULL,'$result')"; $mysqli->query($query); echo '<b>'.$mysqli->error.' </b>'.$query.'<br />'; } This is resulting in the same error as old code (Column count doesn't match value count at row 1)
-
I have this code: function importCsv($file) { global $mysqli; $arrResult = array(); $handle = fopen($file, "r"); $fileSzie = filesize($file); if($handle) { while(($data = fgetcsv($handle,$fileSzie,",")) !== FALSE) { // $data[x] manipulations will go here $arrResult[] = $data; } fclose($handle); } // Mass MySQL insert goes here } How do I handle the mass mysql insert? How do I get the PHP to create the insert code nice, clean and easy (like I used to have it rather easy)? Cheers
-
Okay so now if I do an implode to then do an insert it make it all one 'scentence' How can i process the INSERT given I now have $data[0], $data[1] etc all then inside $arrResult again. Using the example from php.net
-
Well 1 - a, I using fgetcsv instead of all the other code? and 2 - when I tried it it only out puted one row (see post #9).
-
Lets stick to fgetcsv() as I need to do some manipulations when we get this working (which as my post above shows I cant). So how do I make fgetcsv(0 do what I want - anyone can tell me?
-
function importCsv($file) { $fileOpen = fopen($file, "r"); $fileSize = filesize($file); $fileContent = fgetcsv($fileOpen,$fileSize); fclose($fileOpen); print_r($fileContent); } returns ONLY
-
$mysqli->real_escape_string() With adding escape_string and real_escape_string after implode - all fail now not just ones with commas in them. $mysqli->escape_string()
-
Okay code now is: function importCsv($file, $table) { $fieldseparator = ","; $lineseparator = "\n"; $fileOpen = fopen($file, "r"); $fileSzie = filesize($file); $fileContent = fread($fileOpen,$fileSize); fclose($fileOpen); $fileLines = 0; $fileQuiries = ""; $fileLineArray = array(); foreach(explode($lineseparator,$fileContent) as $fileLine) { $fileLines++; $fileLine = trim($fileLine," \t"); $fileLine = str_replace("\r","",$fileLine); $fileLine = str_replace("'","\'",$fileLine); $fileLineArray = explode($fieldseparator,$fileLine); $fileLineMySql = implode("','",$fileLineArray); $fileLineMySql = $mysqli->escape_string($fileLineMySql); $query = "INSERT INTO `$table` VALUES(NULL,'$fileLineMySql')"; $mysqli->query($query); } } This still does not work. Sample of two rows (row 1 works - row 2 fails) - what they look like in the actual CSV (Comma) file: and Output from PHP code (of done just before INSERT)