How can I encode strings on UTF-16BE format in PHP? For "Demo Message!!!" the encoded string should be '00440065006D006F0020004D00650073007300610067006'. Also, I need to encode Arabic characters to this format.
I have a very strange problems in a PHP Soap implementation.
I have a private variable in the Server class which contains the DB name for further reference. The private variable name is "fromdb". I have a public function on the soap server where I can set this variable. $client-setFromdb. When I call it form my client works perfectly and the fromdb private variable can be set. But a second soap client call this private variable loses its value... Here is my soap server setup:
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('session.auto_start', 0);
ini_set('always_populate_raw_post_data', 1);
global $config_dir;
session_start();
/*if(!$HTTP_RAW_POST_DATA){
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
}*/
$server = new SoapServer("{$config_dir['template']}import.wsdl");
$server-setClass('import');
$server-setPersistence(SOAP_PERSISTENCE_SESSION);
$server-handle();
Problem is that I passed this to the server:
$client = new SoapClient('http://import.ingatlan.net/wsdl', array('trace' = 1));
$xml='';
$xml.='';
$xml.='';
$xml.='';
$xml.='Valaki';
$xml.='';
$xml.='';
$xml.='';
$xml.='';
$tarray = array("type" = 1, "xml" = $xml);
try{
$s = $client-sendXml( $tarray );
print "$s";
}
catch( SOAPFault $exception){
print "--- SOAP exception :{$exception}---";
print "LAST REQUEST :";
var_dump($client-_getLastRequest());
print "---";
print "LAST RESPONSE :".$client-_getLastResponse();
}
So passed an Array of informations to the server. Then I got this exception:
LAST REQUEST :
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><type>Array</type><xml/></SOAP-ENV:Body></SOAP-ENV:Envelope>
Can you see the Array word between the type tag? Seems that the client only passed a reference or something like this. So I totaly missed :(
I want to create my own RSS/XML feed. I fetch data from the database to display, but keep getting invalid character errors. If the string has an ampersand or other strange characters in it, the XML will be invalid.
I tried using urlencode and htmlentities, but these don't capture all possible characters which need to be escaped. Does anyone know of a PHP function which will prepare a string for XML output?
Hi there just wondering;
How do i deny direct access to files in a specific folder. I have an upload script that uploads to /uploadedFiles and currently i just have an index.php which redirects the user to the login page however how do i stop users from accessing a file directly such as;
www.myurl.com/uploadedFiles/thisFile.jpeg
Thanks in advance :)
Hello people,
I made a theme in WordPress which hit the mod_security rule on HostGator and gave 403 error.
I contacted people there(at HostGator) and they fixed it for me. But I don't want my theme to work like this.
I just wanted to know if there are any guides/blog post/tutorials telling about writing PHP code which is mod_security friendly?
I tried Google, but didn't find anything helpful.
Hi,
I am looking for an obfucator for my PHP code, the code which I am trying to obfucate uses the codeigniter framework. The obfuscators that I have tried, don't seem to be able to do it.
Any suggestions greatly appreciated!
Hi all,
I have to implement chat application to mywebsite using php.
Chat has the features like audio, video, and file transefer.
so please give reply for this,
Thanks,
Hi every body I am uploading file with php
every thing is fine but move_uploded_file is not working
every variable displayed record and all permission for file is set
function uploadfile($filename)
{
$filetype=$filename["type"];
$filename=$filename['name'];
$filetempname=$filename['tmp_name'];
if($filetype=="application/msword")
{
move_uploaded_file($filetempname,"resume/".$filename);
}
}
Hey,
The PHP SOAP client is constructing a soap request that uses "href" to reference other parts of the message. The web service i'm trying to consume does not like this. Is there a way to force it to construct the soap envelope without references?
Thanks in advance
I have two Fedora-based apache webservers making the same SSL PUT/POST calls with php/cURL. One works fine, but with the other the call succeeds but takes a VERY long time to return a response (~10 min). (GETs don't seem affected)
The working server's cURL uses OpenSSL for SSL, while the non-working version uses a later version of cURL that uses NSS for SSL
I know nothing about SSL implementations or their effect on cURL. What would cause such a significant delay in SSL PUT/POST responses?
Any suggestions appreciated- Thanks--
hi
is there any php classes or functions, which will gives us all the days from specific duration? for example, if i want a list of dates from 25/03/2010 (25th march 2010) to 15/05/2010 (15th May 2010), it will give me:
25/03/2010
26/03/2010
26/03/2010
....
....
....
14/05/2010
15/05/2010
thanks a lot for any help!
Hi All,
I am using mysql_real_escape_string($_REQUEST['page']) in my code. Is it able to prevent SQL Injection in my php code else i will have to do more protection ?
Thanks
Hi,
It's possible to know if a MySQL server is overloaded (with PHP), and if it's overloaded show a static page (something like Twitter's fail whale)? How can I do it?
Thanks!
Yo. I'm trying to make a simple login system in PHP and my problem is this: I don't really understand sessions.
Now, when I log a user in, I run session_register("user"); but I don't really understand what I'm up to. Does that session variable contain any identifiable information, so that I for example can get it out via $_SESSION["user"] or will I have to store the username in a separate variable? Thanks.
i'm developing an iPhone app which communicates with a remote DB.
for that purpose I'm looking for a web hosting service which inclues the following specs:
latest PHP
cUrl
SSL support
mySql
cron
live support
Max uptime
great money per value ratio
The main functionality is communication with the DB and displaying some info on the app.
It is important that the web hosting provider will be highly reliable.
Are there any providers who give some free usage before starting to pay?
Thanks
Hello,
Does anyone know how to retrieve a piece of data and display the results in php file?
A similar query that I would enter is something like this:
SELECT 'email' FROM 'users' WHERE 'username' = 'bob'
Thus, the result would be just the email.
Thanks,
Kevin
we are going to develop proxy and sock4 and sock5 servers they will provide the list of proxy servers.in the site we need to maintain that list and when user want select particular proxy there will be one pop up window open in that have proxy and socks server field. how to atomization.link text
click on proxy shop & socks watch vedio. can you help us how to develop in php.
I have always been confused that .e,g in php i have sql statement
$qry = "select * from table where id = $id";
now can i insert "$" directly inside the quotes or i have to use
$qry = "select * from table where id =".$id." ";
or
$qry = 'select * from table where id = $id';
or
$qry = 'select * from table where id = '$id'';
Which is correct
Just a little confused here...
I have a function in postgres, and when I'm at the pg prompt, I just do:
SELECT zp('zc',10,20,90);
FETCH ALL FROM zc;
I'm wondering how to do this from php?
I thought I could just do:
$q = pg_query("SELECT zp('zc',10,20,90)");
But, how do I "fetch" from that query?
Hello,
I have:
$page_file_temp = $_SERVER["PHP_SELF"];
which will output: /templates/somename/index.php
I want to extract from that path only "/templates/somename/"
How can I do it?
Thanks!
I can't seem to get the correct Unix epoch time out of this PHP DateTime object.
$startingDateTime = "2005/08/15 1:52:01 am";
$foo = new DateTime($startingDateTime, new DateTimeZone("America/New_York"));
echo $foo-format('U');
which gives
1124085121
Which is Mon, 15 Aug 2005 00:52:01 GMT -500 (according to http://www.epochconverter.com/) but that's incorrect by an hour.
It SHOULD be 1124088721 and spit back at me as Mon, 15 Aug 2005 01:52:01 GMT -500
Any help would be appreciated.
Hello there!
If I have a code like this:
$file = basename($filename);
How do i get the file extension of $file? The variabel file could contain any kind of file, like index.php or test.jpeg.
I'm looking for a PHP CMS which can let me to:
1-Uploade and manage files ( pdf, words..) between users by allowing to view, to print or to download.
2-Know who accessed what and when, who download what and when... who do what and when.