I'm trying to write a PHP script using cURL that can authorize a user through a page that uses an SSL certificate, in addition to username and password, and I can't seem to get past the SSL cert stage.
In this case, curl_setopt($handle, CURLOPT_VERIFYPEER, 0) unfortunately isn't an option. The certificate is a required part of authenti...
I have a discussion with a friend regarding the Lesser GNU General Public License, LGPL, for server side code - in this case a PHP library.
He argues that since the PHP application is not distributed to the user - it is merely running on the server - he doesn't have to re-distribute the library sources after he modified it. This is basic...
I'm designing a very simple (in terms of functionality) but difficult (in terms of scalability) system where users can message each other. Think of it as a very simple chatting service. A user can insert a message through a php page. The message is short and has a recipient name.
On another php page, the user can view all the messages ...
I am generating the following html form with this php:
echo "<form name=\"userForm\">
Username:
<input type=\"text\" name=\"username\" />
<br />
First name:
<input type=\"text\" name=\"firstname\" />
<br />
Last name:
<input type=\"text\" name=\"lastname\" />
<br />
<input name=\"Submit\" type=\"submit\" value=\"Update\" onclick=\"submi...
I'm currently having a discussion about the choice between php as a template engine versus a template engine on top of php.
What is your choice, and why?
I say, why another template engine, if php is an template engine itself.
...
I am using a mysqli prepard query with php, the code is:
$retreiveQuery = 'SELECT username, firstname, lastname FROM USERS WHERE username = ?';
if ($getRecords = $con->prepare($retreiveQuery)) {
$getRecords->bind_param("s", $username);
$getRecords->execute();
$getRecords->bind_result($username, $firstname, $lastnam...
How can I show the 'Save as' dialog box using PHP which will ask the user to download a string as a text file? Basically I will retrieve some values from the database, and want then to be able to download a .txt file which contains this data.
...
I notice that a couple of weeks ago PHP 5.3 reached release candidate stage (woo!), but then seeing the list of already-deprecated functions finally being removed, that got me thinking about whether it would break any of my old code.
Short of doing a suck-it-and-see test (installing on a test server and trying it out), are there any sor...
I have a text link in a php file, but I want to make it an image link. The current code is.
$link="<a target='_blank' href='/stuff/morestuff/?url=".rawurlencode($url)."'>".t("Add")."</a>";
Now instead word "Add" I want to have an image in there. My current syntax to do that isn't working though, my error is Parse error: syntax error,...
I am pretty new to PHP programming so I apologize if I am missing the obvious.
I have a site hosted at GoDaddy (Windows, PHP5, MySQL 5). I read this article: GoDaddy FAQ and created a php5.ini file in the root folder but when I try to connect to the database, I get the following error:
Fatal error: Call to undefined
function mysq...
I'm using PHP and libtidy to attempt to screen scrape what might possibly be the most horrendous and malformed use of HTML tables in history. The site closes few table, tr, td, font, or bold tags and consistently nests many different layers of tables within tables.
Example snippet:
<center>
<table border="1" bordercolor="#000000" cells...
There's a comment in another question that says the following:
"When it comes to database queries,
always try and use prepared
parameterised queries. The mysqli and
PDO libraries support this. This is
infinitely safer than using escaping
functions such as
mysql_real_escape_string."
Source
So, what i want to ask is: Why...
I want to create a sortable list that looks something like
$VAR1[0], $VAR2[0]...
$VAR1[1], $VAR2[1]...
The data comes from multiple same structured xml files:
$xmlfile="
<Level1>
<Level2>
<Level2Item VAR1="1" VAR2="2" ... />
<Level2Item VAR1="4" VAR2="5" ... />
<Level2Item VAR1="7" VAR2="8" ... />
</Level2>
</Level1>";
//Ex...
What are difference?
Is there a specific situation or reason for each function? If yes, can you please give some examples of those situations?
PHP.net says that they are used to execute external program.
From examples I see, I don't see any obvious difference.
If I were to simply run a script (bash or python), which function do you rec...
I have below stored procedure to check the user name availability
DELIMITER $$;
DROP PROCEDURE IF EXISTS tv_check_email$$
CREATE PROCEDURE tv_check_email (IN username varchar(50))
BEGIN
select USER_ID from tv_user_master where EMAIL=username;
END$$
DELIMITER ;$$
when i run this from my mysql front end tool, it is working fine
cal...
In PHP, empty() is a great shortcut because it allows you to check whether a variable is defined AND not empty at the same time.
What would you use when you don't want "0" (as a string) to be considered empty, but you still want false, null, 0 and "" treated as empty?
That is, I'm just wondering if you have your own shortcut for this:
...
hi i recently installed xampp 1.7.0 , but when i try to start the mysql from the control panel it gives error:
Busy....
ERROR: Mysql service not started [-1]
and
when i start from the mysql_start.bat it starts !!
why is this happening why mysql is not starting from xampp control pannel?
...
I often have large arrays, or large amounts of dynamic data in PHP that I need to run MySQL queries to handle.
Is there a better way to run many processes like INSERT or UPDATE without looping through the information to be INSERT-ed or UPDATE-ed?
Example (I didn't use prepared statement for brevity sake):
$myArray = array('apple','or...
I'm having a strange problem and not sure how to troubleshoot it. I have created a script in one of my Zend Framework controllers that allows an administrator to log in, upload a PDF, and send as an attachment to everyone subscribed to the mailing list. The problem is that some users report that they are unable to open the PDF attachment...
Is it possible to convert a HTML page to PDF using PHP, and if so, how can it be done?
Specifically, the page is an invoice generated dynamically. So I would like it loaded using:
http://site.com/invoices/3333
And the HTML output would have to be converted to PDF.
Any good libraries that do this will be fine.
...