Hello, I'm currently using checkboxes to set permissions within my PHP application. On the user management page, if the user has the permission, defined by 1 or 0 in the database, the box with be checked or unchecked respectively.
Below is the code that is being used to check whether if the box should be checked or not:
<div><input type...
My string looks like so
February 2009
bla bla
March 2009
doo daa bla lbla
Septemer 2009
So I wrote this regex to split it up into months (which is what I want to do first, I think)
$regex = '/(.*)\s(\d){4}/i';
This matches them perfectly, except it throws away the actual string they were split on .. i.e. I wa...
Hi,
In response to another question I asked about regular expressions, I was told to use the *preg_replace_callback* function (http://stackoverflow.com/questions/959017/) as a solution to my problem. This works great, but now I have a question relating to variable scope in callback functions.
The function that parses the text is part o...
I'm trying to display the associated forums inside a category during a loop in /categories/index
Array
(
[0] => Array
(
[Category] => Array
(
[id] => 1
[name] => General
[status] => 1
[order] => 1
)
...
Hi
I'm using Pear's MDB2 and really enjoying it, but there is something that is starting to annoy me. I build the SQL string in the following way, using the quote method of the mdb2 package:
$sql = sprintf("INSERT INTO profiles(email, fullName) VALUES(%s,%s)",
$mdb2->quote($email), $mdb2->quote($fullName));
(as explained in...
Hey there! Here is my issue, it could just be a browser issue but any help/ideas would be awesome!
Pretty much I have the following redirect:
header("Location: page.php#images");
In most modern browsers it will redirect to page.php#images without any problems but in IE it seems to strip the #images. Has anyone come across this? So ...
I am a .net programmer vb & c# but i can't seem to figure out how to get my objects into a list or array in php.
var mylist = new List<myobject>();
mylist.add(myobject1);
mylist.add(myobject2);
what i have tried. Products being a property for a collection of orderitems
$this->Products = getOrderItems();
public function getOrderItem...
Im storing imdb.com links for each movie thats listed in the DB, and check for duplicates before a new movie is inserted. The problem is, some links are http://imdb.com/whatever while others are http://www.imdb.com/whatever
What would be the best way to force www. into every link thats submitted? I realize I should be storing the url wi...
i have something like
define("__ROOT_PATH__", "http://{$_SERVER['HTTP_HOST']}/admin");
within a class. how do i call it from within functions is it with a cologn? i tried looking it up on google but nothing.
thanks
...
I have a really long string in a certain pattern such as userAccountName: abc userCompany: xyz userEmail: [email protected] userAddress1: userAddress2: userAddress3: userTown: .....and so on. This pattern repeats.
I need to find a way to process this string so that I have the values of userAccountName:, userCompany: etc. (i.e. preferably in a...
Hello,
What's the best way to add dynamic content to a web page after a successfull xml http request. To break down a more concrete example:
User fills in data in input field (e.g. a forum post)
Data is asynchrously updated using the ajax technology
The forum post is instantly displayed for the end user
Sites like Facebook or last.f...
Hi,
I'm currently setting up an authentication system.
My current layout is to get his email from the $_POST, md5 his password, and check the database against his email and his password.
If it matches, I use session_start, and I start storing data in the $_SESSION variable, like so:
$_SESSION['uid'] = $uid;
$_SESSION['first_name'] = ...
Thanks to S. Gehrig's answer in the initial question I've got a regex which works fine and validates a variable based on the Letter property (except Chinese, but that's another topic :):
if (preg_match('/^\p{L}+$/u', $input)) {
// OK
}
Unfortunately I can't extend it to support to support numbers respective question/exclamation & ...
Hi I wonder if anyone can help with this code. I am trying to show the records from a URL table for a category, eg url_category_id = to 1. where the url and category is the same in the associating table.
I am having some issues with this rss as it has a parse error on line 55. I have tried to resolve the issue but without avail.
<?php ...
Hey. i am writing a forum, and i have this table that marks messages a specific user read:
`read_messages`(`message_id`,`user_id`)
a simplified version of the messages table:
`messages`(`id`,`forum_id`,`author_id`)
now, i want to be able, when retrieving the message data from the database for a given forum, to add a variable that w...
hi all, i m developing one joomla site,,
i have assign one article to home page.
But the text "Welcome to the Frontpage" display in home page, and i can't get from where to hide it.
thanks in advance..
...
I've worked with google maps before, but when implementing it, I've never found any documentation on how to get the exact distance between 2 given locations via Javascript or PHP.
1) It has to be the exact same distance shown on maps, not that formula that gives you the distance in a straight line from one geopoint to the other.
2) It ...
Hi I have two tables (users & friends) I need to connect to the friend table to bring all the friends for a user id, then connect to the user table and bring the information for that user, using the friend id. I have the code below but this only brings one user.
It needs to count the number of users online.
function online_friends()
{
...
Hello,
Wondering how I can change the php session id from PHPSESSID to something else so that it does not interfere with other PHP scripts running on the same domain. Is this possible?
Thank you for your time
...
Hi guys, working on my paypal integration and its going great - I was wondering that in the case a refund needs to be made is there a way to have a refund made programmatically?
...