php

Fetching columns from DB and creating an HTML table with the retrieved data in PHP

I have a table in database namely 'reg' with columns date and name. I want to select the name column and month_name and year from date column and create a corresponding html table with columns (serial number, name, month, year). How do I do this in PHP? ...

Temporary store image in php only while displaying on web page

I want to fetch images from other site and display on my site. I want to store that images in my side temporary only at time of showing on page , so that user think images are coming from my site.is it possible? How? Thanks in advance. ...

Creating facebook events via cron-job

I am trying to create facebook events via cron-job. The events should be created on behalf of users of my facebook-connect-site, who have granted offline-access. I have session_keys that do not expire, but can't get it to work! Creating events on behalf of my app works like a charm, is just not what I want... var_dump($event) with some...

how to organize images in threads?

im developing a forum and users will be able to upload pictures. i wonder how i should organize the folders for this? should they be sorted by threads or users? but how will they then be organized within these folders? and how could i couple some post's pictures to the database entry? eg, if the post got 5 images uploaded, should i ha...

Email piping in php for creating email ids

Hi all, I am working to create email ids on-the-fly while a user registers on my website in php. But Whenever i use fopen on my cpanel I get this error "failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found" Can any one help me with this. ...

php: recreate and display an image from binary data

Is it possible to recreate images from binary data (process them if needed) and display them, all in the same script? Something like // get and display image 1: $imagedata1 = file_get_contents('assets/test.png'); $imagedata1 = process_using_gd_or_something($imagedata1); echo "<img src={$imagedata1} >"; // <-- IS THIS (OR EQUIVALENT) PO...

User permission - triggering code on user role (Wordpress)

I'm developing a custom plugin in PHP so existing plugins are not usable. What I want to achieve is that I want to display different url within a post for some users . For users that are registered in wordpress, contacted me and are 'approved'. I want to set up this extra user profile field so I can use this field in a condition. So gues...

Convert date using strtotime from DOMDocument element

Hi there I'm parsing some data using DOMDocument after fetching HTML file using curl. The codes look like this $dom = new DOMDocument(); @$dom->loadHTML($content); $tables = $dom->getElementsByTagName('table'); $rows = $tables->item($tblNum)->getElementsByTagName('tr'); foreach ($rows as $row) { $cols = $row->getElementsByTagNam...

Wordpress and my own custom PHP stuff

Often times, when I try to add my own custom PHP source codes to the template files (sidebar.php, index.php, header.php, etc...), it generates errors. However, it works properly on it's own outside of Wordpress. Is there a way for me to use my custom PHP stuff in Wordpress' template files? ...

How to keep session alive for 1week without logout PHP, overwriting default server values?

How to keep session alive for 1week without logout PHP, overwriting default server values? I need to do this in the PHP code. ...

Using a variable to dynamically load a class.

I have decided to use the singleton pattern for my application. It makes the most sense to me. However, just when I feel like I have made some progress I run into another wall. I have a load function. The load function does the following. Check if class has been previously loaded. - If so - return $class::get_instance(); - Otherwise -...

HTML coding and mixing of PHP or Javascript code

I am assigned a task to revise a website and at present I am working on index.html page. the previous coder has mixed a lot of javascript and CSS code in between and it is becoming difficult to read. I want to know whether it is necessary to include tags and CSS code in between? What about PHP code? Where each must reside? Edited: If...

Treating Warnings as Errors

I have a php application that I have just re-factored. Unfortunately it spewing out warnings like: Warning: preg_match() expects parameter 2 to be string, object given in /home/yacoby/dev/netbeans/php/Zend/Db/Select.php on line 776 Which is impossible (or very hard work) to work out the issue as I don't have a callstack so can't te...

PHP extension: convert an object to string with __toString()

Writing a PHP extension in C, I want to convert a userland object (IS_OBJECT) to a string through __toString() if it has one, and fail otherwise. What should I use? I don't need another zval on output, just a char *. zval *zo; switch (Z_TYPE_P(zo)) { case IS_STRING: ... Z_STRVAL_P(zo) ... break; case IS_OBJECT: ... ???(zo)...

PHP cUrl mimic web login help

Hi, I've been trying to automatically log in to specific web page but no success till now. I would really appreciate any help to get me moving.... This is the URL for the login page: https://www.cellcom.co.il/login/pages/default.aspx The first field is for the username and the second is for the password. I've been using the Live HT...

Is it possible to find POP3 server for any email id using .net or PHP?

Is it possible to find POP3 server address for any given email id (like [email protected])? If yes, please provide some guidance preferably in PHP or .Net. Edit : I get addresses by querying MX record but those are not always the same which people use to fetch their emails. ...

Problem with diacritics and mb_substr

I am slicing unicode string with diacritics using mb_substr function but it works as I would use simple substr function. It splits unicode characters in half displaying question marked diamond. E.g. echo mb_substr('ááááá', 0, 5); //Displays áá� What might be wrong? ...

accessing images

I am new to Symfony. I created a layout page in which I have this : <img src="images/header.jpg" width="790" height="228" alt="" /> but the image isn't displayed in the page when accessed from the browser. I put the file header.jpg in the web/images/ folder. I thought I could learn Symfony in a week while working on a small projec...

What kind of text is stored with setcookie()?

When you setcookie('id','111'...) does the browser store that cookie with additional information, like where it got from? How would that look like? I assume a website cannot access cookies set by facebook or twitter on somebody's computer. ...

Call PHP method with Ajax.Request

Whats the best way to call a certain method in a PHP file with Ajax.Request (using prototype)? I am submiting a form with Form.serialize, so I thought of adding a parameter (like the name of the method to call) and then check it on the server script. Something like: var params=Form.serialize("someform")+"&=method='check_data'"; new Ajax...