php

PHP: PDF Generation

Hi, I am currently working on a website. Basically when a user searches for something, i should be able to generate the pdf for the each of the search result item. I know one option of fpdf. Is there something easier than fpdf or some service like if i send the url of my search result page, it sends back the generated pdf to me. What ...

What is a good tutorial or book to learn credit card processing using PHP?

I am looking for a good tutorial or book that explains how to process a customer's credit card from a form on your site. I read something about using curl, but it wasn't a complete tutorial. I am looking for a lesson that will take me from step 1 to actually charging a customer's credit card. What is a good tutorial or book to learn cre...

One php recordset instead of 7 ? Extra filtering during presentation.

I have a table about a program guide with 4 columns: idguide, idday, starthour, program. I would like to present it on the screen per day. Must i call 7 times its recordset, like this SELECT * FROM tblguide WHERE idday = 1 ORDER BY start ASC This works but causes bigger workload; is there another solution where i only have one recordse...

what exactly happens with the from action script in php.

<form action="somesite.com" name="somename"> <input type="text" name="data" value=""> </form> If I try to execute this code in my local system, the value with the name 'data' will be transferred to the site 'somesite.com' Is it the right way to transfer the data to any other web site which already exists? What will happen to that ...

Using functions from within the same class

This is probably a really simple question however Google isn't my friend today. I have something like this but it says call to undefined function <?php class myClass{ function doSomething($str){ //Something is done here } function doAnother($str){ return doSomething($str); } } ?> ...

single quotes in SQL Query

Hi Guys, Im writing a php script that is used to update a database but it is giving errors when i tries to run the query it returns an error along the lines of You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'id=15"' at line 1 Where it says "To us...

contents of page reload when any user post data in database in php

Hello Tech Jargons, I have developing messenger in php. In my application in need to reload the content of div in a page while any user post their comments on database of server. Please kindly help me... Thanks in Advance Mayan Alagar. ...

cURL Download Progress in PHP not working ?

Hi, I am a PHP newbie and trying to add a progress-bar to an existing PHP script using the following method : $ch=curl_init() or die("ERROR|<b>Error:</b> cURL Error"); curl_setopt($ch, CURLOPT_URL, $c); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_FILE, $fp); //##############################################...

Changing only the home page layout in cakephp

If my whole site is using the default.ctp layout specified in apps/view/layouts/default.ctp, how do I change only the home page layout to use homepage.ctp and leave the rest of the site using default.ctp? ...

Accessing a function in a class from other classes

What I want to do is access the query function in my database class form anther class. Evey time a query is done I track the time it takes and add the the query count, I want to do that for all query's. The layout I have now is: Global ----------------------------- | | database class ...

Why does this work: if ( isset($var) && $var ){

Lets say I have a variable $var that has not been defined. Why don't I get errors with this statement: if ( isset($var) && $var ){ // something } else { // do something else } How can you check whether something is true or not "&& $var" if it is not set yet? Does isset() do something to the if statement. Surely this should ret...

Php is not being treated as a script, instead the php file is downloaded. Argg!

My site has a simple form to sign up to the newsletter by typing in your email and then pressing a button. However, when the button is pressed, the browser tries to download the actual php file instead. What am I doing wrong? ...

PHP variable to JS - over and over

Sorry my Gods, but.... I have php, file, and in this php i set the language, and include the necessary lang file: ... if ($lan=='ge') {$_SESSION['lang']='german';...} if ($lan=='en') {$_SESSION['lang']='english'; ....} } if ($_SESSION['lang']=='english'){ include ..english }else{ include ...german } I u...

PHP: Stop the auto appending of @something.com for the "From" field using email

Hey guys/gals, I want to be able to send texts to phones via email (since each phone has their own address), and for specifying the from, I want to specify my own number, is there a way to do this? For example: $from = '7785555555'; if(mail($to, $subject, $message, "From: $from")) echo "Mail sent"; If I do this, the From in the em...

APC vs pecl uploadprogress

In the Status Report page in drupal, i usually find this message (on fresh installation): Your server is capable of displaying file upload progress, but does not have the required libraries. It is recommended to install the PECL uploadprogress library (preferred) or to install APC. But i never understood why its preferred the PECL ...

is there a __construct() equivalent for extended classes

I have a parent class: Abstract Class Base { function __construct($registry) { // stuff } } I then have at least 2 classes that extend that class class Cms extends Base { // a few functions here } and this one class Index extends Base { // a few functions here } For the CMS class, the user will need to be l...

Codeignter and GD image manipulation

Hello, In codeigniter I am creating an application that allows the user to upload multiple files in one go, to this I am using this library, http://www.mitesdesign.com/blog/open-source/multi-upload-jquery-code-igniter My question is if there are multiple images that have been upload how do I define the source image in the $config, so...

checkdnsrr error with php 2.9.2

i am trying to use checkdnsrr() function with php 2.9.2, but it shows an error as "Call to undefined function checkdnsrr()".. is it because this function is not compatible with the version i am using? Can i have an alias of this function so that it works with my version? ...

show google map markers with php

Hi everyone! Im working on a google map project where the user can type in a address and gets the result of nearby restaurants ploted on a google map. So far no problems. I've created a ajax call where the backend outputs and xml and then with jquery I create the markers. But now to my problem. With this ajax solution anyone can ea...

mysql continue on errors

I have a PHP foreach loop and a mysql insert statement inside of it. The loop inserts data into my database. I've never ran into this issue before but what I think is happening is that the insert dies (I do not have an "or die" statement after the insert) when it reaches a duplicate record. Even though there may be duplicate records in t...