I want to display on screen data send by the user,
remembering it can contain dangerous code, it is the best to clean this data with html entities.
Is there a better way to do html entities, besides this:
$name = clean($name, 40);
$email = clean($email, 40);
$comment = clean($comment, 40);
and this:
$data = array("name", "email," "...
I'm trying to escape regex-reserved characters with a backslash (don't ask -- suffice it to say I'm NOT trying to parse HTML :) ) And I'm getting something odd.
$regex_chars = array('[' , '\\' , '^', '$' , '.' , '|' ,
'?' , '*' , '+' , '(' , ')');
$regex_chars_escaped = array('\[ ' , '\\\\ ' , '\^ ', '\& ' ,
'\. ' , '\| ' , '\? ' ...
I am creating a socket server in C# and a client in PHP. The conversation between client and server is something like this:
client connects
server sends welcome message
client sends data
server sends response
(repeat step 3 - 4 until client disconnects)
It works until step 3. The data from the client is received by the server. Howeve...
Hey guys!
I have an application here that is growing bigger and bigger. The address is this: www.aquitanda.com [brazilian portuguese].
Basically, it's a website where you can buy and sell stuff on your own, which means people can create their own webstores.
I have, for this project, 4 big "interfaces". One of them is the commom interf...
I am thinking of implementing a small tracking system that will track users logon / logoff times and also track who is currently logged on. It all makes sense to me except for the tracking of when a user logs off. Its easy enough when a user clicks a "log off" button which calls a function that can update the database with the logoff tim...
Hello,
I will explain more, because it might not be clear enough
I want to set the ajax url to: www.domain/controller/method
I already have everything in place for this with normal php.
But if I have to do this with ajax, I am not getting the intended result.
The result should be some json variable being echo'd back to me.
It is not e...
Trying to wrap my head around the new PayPal Adaptive Payments API - specifically the ConvertCurrency functionality. Has anyone had any luck with this in PHP?
Documentation: https://www.x.com/docs/DOC-1400
...
From http://php.net/manual/en/function.mcrypt-encrypt.php, I saw the following codes using AES with an IV in ECB mode,
<?php
$iv_size = mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB);
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
$key = "This is a very secret key";
$text = "Meet me at 11 o'clock behind the mon...
Is it possible to record a voice onto the uploaded video using PHP?
...
Hay guys, I'm doing some work where i have a large collection of forms. Seems these aren't 'posted' the traditional way (i.e using a submit button). I need a way to collect all the names and values of all form data when clicking a link (document.location is then used for redirects).
I want names to stay intact so that i can used a simpl...
I'm trying to set up a new class for my web application, rewriting my code starting from original procedural programming.
Since I need to populate my object using many different(complex) queries, and this object'll be stored in session, I decided to create another static class containing all long queries.
Is it more convenient to define...
Hello, i have a huge problem with a system i have been assigned to maintain.
In reality it is many systems over an intranet.
The problem is, the original programmer created many systems for the intranet which all of them connect to the database through a script, where the user name, pass,db params,etc are stored in $_SESSION variables....
Hi,
Is it possible to protect a video from a site from being downloaded?
While users could record a video by using some hardware device, it should not be possible to download a video using some link - exactly like google videos.
For example, if I have Real One Player in my system, I have an option to download the video; this should be...
I'm trying to do a simple word cloud exercise in PHP but with little twist. I have everything else done but I can't figure out how to do a loop that combines the words.
Here's example that will make it little bit easier to understand what I'm trying to do:
I have array like this:
$arr = array('linebreak','indent','code','question',...
I'm trying to send a SOAP request to a newsletter service using this WSDL:
dev-service.go.mayoris.com/wcf/SubscriptionService.wsdl?wsdl
Here's my PHP:
$client = new SoapClient($wsdl_url, array(
'login' => 'myusername',
'password' => 'mypassword',
'trace' => true
));
$client->AddSubscriber(
new SoapParam('MyFirstName',...
Hi all,
I'm currently trying to write a jQuery script which opens a modal box then (upon user entry) changes a value on the original page.
Currently I've got the script working on just the page itself (without the modal), but when I try to run the command from the modal the value on the main page doesn't change?
Does anyone know how I...
Hi friends,
How can I redirect such link (below) to 404 error page?
http://www.blabla.com/category/sub/.html
I generate a SEO friendly links, normally products has url like blabla.com/category/sub/product.html
the page doesnt give any error. it just display blank content. I mean i can see static texts like CATEGORY NAME header a...
Hi,
I am entering '35444650.00' as a float into my MySQL and it keeps reformatting to 35444648.00, any help welcome...
...
I'm working on a project in PHP (5.3.1) where I need to send a JSON string to a webservice (in python), but the result I get from json_encode does not pass as a valid JSON (i'm using JSLint to check validity).
I should add that the structure I'm trying to encode is fairly big (13K encoded), and consists partially of UTF8 data, and while...
Hi,
I'm working on a PHP app which requires various settings to be stored in a database. The client often asks if certain things can be added or changed/removed, which has been causing problems with the table design. Basically, I had a lot of boolean fields which simply indicated if various settings were enabled for a particular record...