I am trying to get an array to pass in a session variable from one page to another. I am setting the session variable equal to my the $_POST data collected from my form. Printing the variable for test shows me that it is getting set initially on Page 1. Page 1 On Page 2 I am trying to set
Tag: php
Symfony2 Accessing route variables
I know I can access current route name by $request->get(‘_route’);. If my route is defined this way: How can I retrieve the id variable from within service? Answer $request->attributes->get(‘id’) does the trick.
PHP Scrape Article Excerpt like Readability
I’ve seen this question, but it doesn’t really satisfy what I’m looking for. That question’s answers were either: lift from the meta description tag, and the second was generating an excerpt for an article you already have the body from. What I want to do is actually get the first few …
PHP, Date() and fopen
I have an error system that take the date() and the error and insert it into a file: My problem: for start at the fopen at the second parameter I need the pointer to be at the start and that looked at the manual and I need the parameter to be writing only, put the pointer at the start and
replace array keys with given respective keys
I have an array like below I have another array having keys to replace with key information. I need to replace all keys of array $old with respective values in array $keyReplaceInfo. Output should be like this I had to do it manually as below. I am expecting better option. can anyone suggest better way to acc…
Any way to simplify PHP constructor arguments?
When I want to pass values into a PHP constructor I have to go: class Rump { private $var1; private $var2; private $var3; public function __construct($var1, $var2, $var3) { $…
How can I send JSON response in symfony2 controller
I am using jQuery to edit my form which is built in Symfony. I am showing the form in jQuery dialog and then submitting it. Data is entering correctly in database. But I don’t know whether I need to send some JSON back to jQuery. Actually I am bit confused with JSON thing. Suppose I have added a row in
The image contain error with imagick
thumbnailImage(100, 0); …
Convert from 64bit number to 32bit number
Trying a lot and just failing.. I want to this number, turn into this: That is the 32bit form of it. Trying to explain with more details: http://www.tonymarston.net/php-mysql/converter.php 1) Put the value 76561198005785475 on the “Decimal (input)” field. 2) Press “DEC to BIN” on the &…
PHP issue about sending mail message
I am having an issue when sending e-mail using php code. I have a form which sends an attachment to a folder and the name of the attachment to the database, in order to then send the link of the file inside the message. The problem is that the file and all the rest go the way it should but