Hi All,
I'm writing some PHP to convert BBcode to HTML.
I would like to convert this BBcode:
[quote]
Hello World
[/quote]
to the following:
<blockquote>Hello World</blockquote>
The preg_replace function that I'm using to perform this is:
preg_replace("/\[quote\](.+?)\[\/quote\]/s", "<blockquote>\\1</blockquote>", $bbCode);
Thi...
In this little example below in PHP what would be a good way to be able to create the variables in the user class and then be able to use them on any page where I create a user object?
<?PHP
//user.class.php file
class User
{
function __construct()
{
global $session;
if($session->get('auto_id') != ''){
//set u...
Hello. I have an Ext Grid and want to grab the JSON "success":false/true response an execute a function for each situation. I would like to have it as callback function for every grid interaction with the JSON PHP file.
Any examples of this ?
Thank you for your time.
...
I'm trying to connect to a third party API and I'm using the Zend 1.7.0 framework to access it. To authenticate, I have to first check an SSL certificate returned from a URL. This is what I'm doing in my code.
$client = new Zend_Http_Client($url);
$response = $client->request('GET');
The response is always OK, and when I navigate to...
UPDATE: I solved the problem myself and the answer is below. Carry on...
I have a form for updating your account using PHP and mySQL. On submit, it assigns all of the $_POST variables to the new user() object, and then does an update() method on the user object which runs an UPDATE query in SQL.
The form obviously defaults to all of th...
Hi,
I have a very large MySQL database with a table having structure like this:
In the exmaple, the DATE is in unix timestamp format. So it will need to be
converted to normal US date format and this is just a few records from my DB.
ID DATE
REG_TYPE
--------------------------------------
1 1251917888 ...
function login_board($url,$ch)
{
$cookie="cookie.txt";
curl_setopt( $ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1" );
curl_setopt( $ch, CURLOPT_URL, $url );
curl_setopt( $ch, CURLOPT_COOKIEJAR, $cookie );
curl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );
...
I am stuck now, here below is a snip from my paging code, this is the part the builds the URL for the paging links, it worked really great until now because now I am changing my whole site to use mod-rewrite so before a page would look like this
http://localhost/?p=mail.inbox&page=2
and now I want it to be like this..I already ...
Example
7.30pm, second Monday each month
or
7.30pm, first & third Thursday each month.
Basically I want a upcoming events list for the next month.
How do I handle reoccurring events in PHP/MySQL?
...
I'm using the PHP-Excel-Reader library to read some XLS files and immediately have hit this issue:
PHP Notice: iconv() [function.iconv]: Detected an incomplete multibyte character in input string in C:\web\docs\housing\excel_reader2.php on line 1718
The line in question is this:
$result = iconv('UTF-16LE', $this->_defaultEncoding...
I am templatizing my php.ini using PHP. I have a script to set up a development environment by generating httpd.conf, apachectl, and php.ini from templates using a CLI PHP script. Unfortunately there are literal <? and <?php strings in php.ini (in a comment). Is it possible to escape those somehow so php doesn't interpret them as normal ...
I am trying to get my old paging class to work which relied on the variables available with $_GET in PHP to reconstruct the URL for the paging links, it worked great but now I am changing to have "pretty url's" with mod-rewrite.
So this
domain.com/?p=the-pagename-identifier&userid=12&page=3
would now be
domain.com/the-pagenam...
Hello
lets say our table has the following structure
col1 | col2 | col3
I want to sum col1 and col2 then update the col3 with the result
Thanks
...
First of all I am in DESPERATE need of help here PLEASE I will most likely start a bounty as soon as SO lets me.
I have a pretty large site (social network) MANY PAGES, I am currently doing a complete re-write to build it better then I did 2 years ago. 1 thing I have decided to change is the URLs on my site, there were like this http:/...
Hello
I have two tabled in my Mysql database
table1 has the all webpages in my network
| table1: (pages)|
|----------------|
| id | url |
|----------------|
table2 has two fields, which are the source page of the link and the destination page of the link
|------------------------...
In PHP how do you refer to files in an OS friendly manner? I'm looking at some code like
<?php
require_once(dirname(dirname(__FILE__)).'/common/config.inc.php');
...
that I have to run on a Windows machine, but it doesn't parse the path right:
PHP Warning: require_once(C:\workspace/common/config.inc.php): failed to open stream: No ...
I am trying to learn OO and classes and all that good stuff in PHP, I am finally learning the sytax good enough to use it some and I am curious if there is any benefit of starting a new object instead of just using static methods...let me show some code for what I mean...
<?PHP
test class
{
public function cool()
{
re...
I'm looking at creating a full text search engine for one of my projects.
We have a Mysql, Tokyo Tyrant and file documents that need to be indexed.
I'm looking at Sphinx right now but I can't figured out if I can use it to index every document.
I know it's possible to let Sphinx to use Mysql but I'm looking at a way to let Sphinx inde...
I have one form (input.html) that's completed by people working in five different divisions of this business. When the form is submitted it posts to output.php.
Output.php does a number of things:
First it displays all of the input information to the screen as a completed form. (Just to show them their completed document).
It has also...
Hi,
I am trying to get the entire page URL as a string in PHP - so, if the requested URL is ./foo.php?arg1=test&arg2=test2, I get "./foo.php?arg1=test&arg2=test2".
I know that I can get the ./foo.php part from $_SERVER and the variables from $_GET, but I was wondering if there's an easy way to do it in just one fell swoop.
TIA.
...