How do I use the sha512 function for PHP?
Can I replace all my md5 funtions with the sha512 function?
Do I have to download something if so what?
Can any one provide examples? Thanks!
I have PHP configured so that magic quotes are on and register globals are off.
I do my best to always call htmlentities() for anything I am outputing that is derived from user input.
I also occasionally seach my database for common things used in xss attached such as...
<script
What else should I be doing and how can I make sure that the things I am trying to do are always done.
Is there some way to detect if a string has been base64_encoded() in PHP?
We're converting some storage from plain text to base64 and part of it lives in a cookie that needs to be updated. I'd like to reset their cookie if the text has not yet been encoded, otherwise leave it alone.
I wrote a PHP shell script which include queuing jobs in centOS with 'at' command.
The queue jobs may vary in time and contents which means the system need to keep quite a large number of jobs.
The application logic will also be a bit difficult to setup with cronjob.
Is there a limit in number of queue jobs in centOS or is there any alternative way of queuing jobs?
Hi, i need to convert a Utf-16BE in ISO-8859-1 in PHP (i'm not an expert in encoding so i don't know if Utf-16 and Utf-16BE are the same thing). I've read somewhere to use the mb_convert_encoding function but i haven't that function because i don't have the multibyte extension installed. So do you know an alternative method to do this?
I've wrote a PHP script to export a Foxpro database to other formats by using ADODB (http://phplens.com/lens/adodb) library to access Foxpro OLE DB provider.
Everything worked fine except the date fields are mangled and become like these:
11/17-/2-00
3/4/-20-08
By comparing to actual data I can guess that it is probably in the format of MM/DD/YYYY or m/d/YYYY.
How can I properly export the date field?
Basically, I want to do some HTML screen scraping, but figuring out if it is possible in PHP.
In Python, I would use
PyQuery.
In Ruby, I would use Nokogiri.
Hello,
I have some CSS style that does not work in IE and that works on ff and chrome. I want to be able to use if else. But can PHP ifelse be included in the .css file for me to achieve?
Thanks
Jean
I want to be able to detect (using regular expressions) if a string contains hebrew characters both utf8 and iso8859-8 in the php programming language. thanks!
Hi,
Rasmus Lerdorf (creator of php) advocates procedural style where as most successful way has turned out to be non-procedural. What is the benefit of procedural over non-procedural approach at last? Why does he advocate that?
gpg = gnupg.GPG(gnupghome="/tmp/foldername", verbose=True)
print "Import the Key :", gpg.import_keys(pub_key).summary()
this two lines of code gives me public key exract which i further used in encryption.
i need to get the equivalent metods in php .
Is there a possibility to create a html or a php page that will count redirects?
I mean, let's say you have a page with a link in it. I want the page to count how many times the link is clicked per ip adress or username. The counting would be reported into a log file or text document.
Hi,
Does anyone know of a PHP open source which can generate forms to be deployed across your website. These forms will collect and aggregate the data with in on database. There should also be the functionality to search across the forms (to generate reports and newsletter mailing lists)
All the services I have found so far have been hosted solutions.
Thanks
Tom
hello,
is it, please, possible to use a regular expression with the php function array_key_exists(); like this for example :
$exp = "my regex";
array_key_exists($exp, $array);
thank you !
Hey all,
I was wondering if there is some variable that will return what $_SERVER['DOCUMENT_ROOT'] returns when I call PHP like this: ./somescript
If not, how do people get around this case? I'm looking to be able to call the same script (a template compiler) in both the web browser and the terminal.
Thanks!
Matt Mueller
I'm looking for a comprehensive and well maintained wiki syntax Parser for PHP, does anybody know of one? I can find some really good parsers for markdown and bbcode but am having trouble with finding a decent wiki parser.
I prefer markdown myself, but I'm writing post functions for a CMS and I'd like to give end-users a choice.
I thought about downloading a copy of MediaWiki and seeing how they do it, thoughts on this as an option?
<Placemark id="p1"></Placemark>
<Placemark id="p2"></Placemark>
<Placemark id="p3"></Placemark>
<Placemark id="p4"></Placemark>
hi,im using SimpleXMLElement in my php,
my question is,how do i get placemark id 3?
is that something like this ?
$xml->Response->Placemark['id=3']->AddressDetails->Country->CountryName;
thanks
I am hacking together a theme for wordpress and I am using the following code to pull out data from a custom field with several values:
<?php $mykey_values = get_post_custom_values('services');
foreach ( $mykey_values as $key => $value ) {
echo "<span>$value, </span>";
} ?>
I use a comma to seperate the results, but I don't want a comma after the last result. How do I get around this?
Alright, PHP is throwing this error at me (in the log) when I run the code mentioned below:
Error
mysql_num_rows() expects parameter 1 to be resource, string given in (place) on line 10
Line 9-11
$queryFP = ("SELECT * FROM db");
$countFP = mysql_num_rows($queryFP);
$aID = rand(1, $countFP);
I think it has something to do with the $queryFP's syntax, but I'm not completely sure how to fix it since $queryFP's syntax is the simplest query I've ever seen.
Hi ,
we're trying to implement new coding style guidelines for our team, the php codesniffer is printing an warning on switch case statements when no "break" is found like:
switch ($foo) {
case 1:
return 1;
case 2:
return 2;
default:
return 3;
}
is there any good reason to use :
switch ($foo) {
case 1:
return 1;
break;
}
?? the break is never reached ?
I use __autoload to load classes, and I keep getting errors that no class is found but file get's loaded ok.
Then if I change something in a file, just something like add a new line and save it, everything works fine and class is then found.
But this is a great problem cause there are thousands of files in this project and I don't want to change them one by one.
I'm using php 5.3.0 on windows.
What could be the problem?
Hi, I am just trying the session_id function in PHP and I thought that it was unique for each machine that used the website? However, my flatmate and I have the same session_id for on two separate machines. I'm just using session_id() to create the session - am I doing it correctly?
Thanks
Tom
Hi,
I am new to OpenID, and want to implement Google OpenID authentication on my website. I could not found any example.
Can anyone suggest me some good tutorials (step by step) or any working example with code to implement Googl OpenID authentication using PHP.
All helps are appreciated.
Thanks,
Navin