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!
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?
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
Could you show me a Proof-Of-Concept for all of these: XSS, CSRF, SQL injection with both the source code and the attack steps for each?
Other attack vectors are welcome. The most complete answer gets accepted.
The configuration is a fairly standard one, as of PHP 5.3.2, core settings:
allow_call_time_pass_reference => Off => Off
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
define_syslog_variables => Off => Off
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => STDOUT => STDOUT
display_startup_errors => On => On
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => Off => Off
error_append_string => no value => no value
error_log => syslog => syslog
error_prepend_string => no value => no value
error_reporting => 32767 => 32767
exit_on_timeout => Off => Off
expose_php => On => On
extension_dir => /usr/lib/php/modules/ => /usr/lib/php/modules/
file_uploads => On => On
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => .:/usr/share/pear => .:/usr/share/pear
log_errors => On => On
log_errors_max_len => 1024 => 1024
magic_quotes_gpc => Off => Off
magic_quotes_runtime => Off => Off
magic_quotes_sybase => Off => Off
mail.add_x_header => On => On
mail.force_extra_parameters => no value => no value
mail.log => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
register_globals => Off => Off
register_long_arrays => Off => Off
report_memleaks => On => On
report_zend_debug => Off => Off
request_order => GP => GP
safe_mode => Off => Off
safe_mode_exec_dir => no value => no value
safe_mode_gid => Off => Off
safe_mode_include_dir => no value => no value
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 100 => 100
short_open_tag => Off => Off
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
variables_order => GPCS => GPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
y2k_compliance => On => On
zend.enable_gc => On => On
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?
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 .
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!
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
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 !
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
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.
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?
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,
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
Hello
when I Try to built Query from another Query in php code I Faced some problem
can you tell me why? :(
code :
$First="SELECT ro.RoomID,ro.RoomName,ro.RoomLogo,jr.RoomID,jr.MemberID,ro.RoomDescription FROM joinroom jr,rooms ro where (ro.RoomID=jr.RoomID)AND jr.MemberID = '1' ";
$sql1 = mysql_query($First);
$constract .= "ro.RoomName LIKE '%$search_each%'";
$constract="SELECT * FROM $sql1 WHERE $constract ";// This statment is Make error
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
What is the best Collation for the column that can allow to store accented letters and parse them out perfectly without any encoding error, because whenever I add an accented letter such as é, å, it shows out with an encoding problem on the PHP side, but in the MySQL side it's fine...
How do I get the accented letters display properly?
<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 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?