Skip to content

Tag: php

PHP passing array in session variable

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

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

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

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