php

What is the use of mysql_rollback() function in PHP?

What is the use of mysql_rollback() function in PHP? How is it used? please explain me with some example, PS: Please Do not give me link to the php.net or, mysql site, I dont need AUTHOR language to understand it, I need the Developer way to understand... I hope u understand... Thanks in advance. UPDATE if i have Updated someth...

where to find "template" interfaces?

i wonder where one can find template interfaces. eg. i am creating these classes that implements iLog: DatabaseLog ScreenLog FileLog i wonder what methods should a typical Log class have? is there a set of interfaces you could just implement/learn from rather than reinvent the wheel and have to think about the method names. eg. ...

php mail function

<?php $sendto = "[email protected]"; $subject = "email confirmation"; // Subject $message = "the body of the email - this email is to confirm etc..."; # send the email mail($sendto, $subject, $message); ?> this is the code that i wrote to test mail function on localhost. i have ran the script in browser for several times and still du...

singleton vs factory?

i've got 3 Log classes that all implements iLog interface: DatabaseLog FileLog ScreenLog there can only be one instance of them. initially i though of using single pattern for each class but then i thought why not use a factory for instantiation instead, cause then i wont have to create single pattern for each one of them and for all ...

How to return a ComplexType in PHP SOAP ?

The following is a fragment from my WSDL which describes the ComplexType "user" which has to be returned by the SOAP method. <s:complexType name="user"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int" /> <s:element minOccurs="0" maxOccurs="1" name="name" type="s:string" /> ...

Is it a good practice to carry DB values in session variable or in a cookie?

Is it a good practice to carry DB values in session variable or in a cookie? ...

How to turn such string into a data grid? (C# .Net)

So I have such string (recived from php server... normal print_r of array) Array ( [item_number_in_array] => Array ( [id] => id_value [title] title_value_as_string_vith_spaces [content] => content_value_as_string_vith_spaces ) [item_number_in_array]... ) I need any how to represent it as table like this in C# How to do such thi...

Using a Form With Variables as Part of a Function

Hello, Could the form below be part of a function? I am wondering if it might not be able to be part of a function since it has variables. Thanks in advance, John echo '<form action="http://www...com/sandbox/comments/comments2.php" method="post"> <input type="hidden" value="'.$_SESSION['loginid'].'" name="uid"> <input ty...

how to display the checkbox in pdf

I'm working on a php(codeigniter) form that sends data to a PDF file when submitted. I can get value of a text field to populate corresponding field in PDF but don't know how to display checkbox in pdf. Can someone help please? thanks Ahammed ...

Displaying image with php

I have a script which displays images like this: header("Content-Type: image/{$ext}"); readfile($image->path); This has worked fine for weeks and now suddenly it has stopped working. The response header looks fine (Content-Type: image/jpg), I have no ending php-tag and I have made no changes to my code, server- or php-setup which could...

Can't retrieve more than 2 gmail messages using Zend framework imap access - server dies - doens't report any error

Hi guys I'm working on a google apps application. Basically I've set it up so users can add multiple gmail addresses and check on their inboxes in the application. It works fine with a google apps email address however when I add a gmail address it just dies out. I'm using this code here: $mail = new Zend_Mail_Storage_Imap($mail_option...

Using new Graph API to pass a var from PHP to .swf file - Facebook Application

I am using this in my .php file and I want to pass the user's photo variable into a .swf file. <?php require_once 'src/facebook.php'; $facebook = new Facebook(array( 'appId' => 'xxxxxxxxxxxx', 'secret' => 'xxxxxxxxxxxxxxxxxx', 'cookie' => true, )); $me = null; if ($session) { try { $uid = $facebook->getUser(); $me = $facebook-...

What are the best practices for storing PHP session data in a database?

I have developed a web application that uses a web server and database hosted by a web host (on the ground) and a server running on Amazon Web Services EC2. Both servers may be used by a user during a session and both will need to know some session information about a user. I don't want to POST the information that is needed by both serv...

HTTP request failed! HTTP/1.1 505 HTTP Version Not Supported error

I'm trying to use file_get_contents() to get the response from a server and this error was encountered. Could someone tell me what is the reason and how to fix it? The portion of the code is: $api = "http://smpp5.routesms.com:8080/bulksms/sendsms?username=$username&amp;password=$password&amp;source=$source&amp;destination=$destin&amp;dl...

http://localhost/mydirector/ - echo mydirectory and avoid 404 error on localhost

Hello, I have the URL http://localhost/mydirector/, I want to echo mydirectory and not have a 404 error. mydirectory does not exist as a directory, but is taken as username. I am using Windows/apache/MySQL,PHP. All this happening on localhost or 127.0.0.1 Thanks Jean ...

How would I update jQuery to allow mutiple button clicks to dynamically call/update data using ajax?

hey guys, im having some trouble... i'm able to capture the first button on the page, but there are a total of 10 buttons. When I click on any of those 10 buttons, only the first button's value is called and the other ones don't update. is there a way to capture all of the buttons so they each have their own independent value and update ...

php curl login problem

<?php // create a new CURL resource $file_path = '/mail'; define("COOKIE_FILE", "c:\cookie.txt"); $ch = curl_init(); // set URL and other appropriate options curl_setopt($ch, CURLOPT_URL, "https://mail.gov.in/iwc/signin"); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt ($ch, CURLOPT_US...

how to secure my password in my registration form?

Hi how to secure my password in my "registration form" using salt and hash technique? And how the technique of salt and hash works? ...

highlight multiple keywords in search

i'm using this code to highlight search keywords: function highlightWords($string, $word) { $string = str_replace($word, "<span class='highlight'>".$word."</span>", $string); /*** return the highlighted string ***/ return $string; } .... $cQuote = highlightWords(htmlspecialchars($row['cQuotes']), $search_result...

What could be done to get the old values back in the table after execution of any update query on it?

What could be done to get the old values back in the table after execution of any update query on it ? I am using PHP and Mysql DB ...