Hi,
The current app I'm building is a collaboration app that holds several users in a "team" or company that can access a set of projects. Each project has it's own documents.
I want to protect team users from running in to each other and so I have built a system where documents are locked by the first user to access them. The document...
$string = "MaryGoesToSchool";
$expectedoutput = "Mary Goes To School";
...
Hi experts,
In a typical PHP application what should the file permissions of .php, .html and image files be? I'm using PHP5 with Apache on a Linux box.
Thanks
...
Hi,
I know result page that uses GET method can be bookmarked while the one using POST cannot be. I also know about the restrictions of the GET methods.
Now suppose I want to build a search engine which by default uses GET allowing users to bookmark but when the length of the search phrase exceeds the limit, switch to POST. On the ser...
Hi!
I've written a regular expression to strip out BBCode tags - it just strips the allowed tags out (for later counting the string length without the tags).
I'm not an expert when it comes to regular expressions - so after an hour I found this pretty much working:
$pattern = "/\[\/?(i|b|u|url(.*?)|list|li)[\]\[]*\]/i";
$stripped = pre...
I am using Zend_Application and it does not feel right that I am mixing in my application.ini both application and user configuration.
What I mean with this is the following. For example, my application needs some library classes in the namespace MyApp_ . So in application.ini I put autoloaderNamespaces[] = "MyApp_". This is pure applic...
I know for example the Zend Framework has some capability for creating form elements with validators. But now, lets say the user enters complete garbage data, which is invalid. What would happen next? Lets say the JS part goes wrong or JS is disabled, and the server receives the garbage data.
How do the "big" PHP frameworks handle this...
Hi Guys,
I want something (final) like this :
<?php
//named as config.php
$fn[0]["long"] = "file name"; $fn[0]["short"] = "file-name.txt";
$fn[1]["long"] = "file name 1"; $fn[1]["short"] = "file-name_1.txt";
?>
What that I want to?:
1. $fn[0], $fn[1], etc.., as auto increasing
2. "file-name.txt", "file-name_1.txt", etc.., as fi...
I'm using the get_browser() function in an attempt to warn people that their browser doesn't support Javascript. Actually I'm using it to tell them they can use certain parts of a web application I'm building. I've decided to properly use Javascript because I'm tired of listening to developers that are scared of using it and I've seen so...
In PHP, I'm trying to read an Excel file using COM():
$rrc_app = new COM("Excel.application");
$rrc_workbook = $rrc_app->Workbooks->Open($filename);
$rrc_worksheet = $rrc_workbook->Worksheets('Top sheet');
$rrc_worksheet->activate;
I tried to extract the value of a cell containing a "Time" value:
$review_time = $rrc_worksheet->Range(...
I'm trying to make seo to search queries. i've got a form like this:
<form action="index.php?<?=$_GET['search-input01']?>'" method="get">
<p class="nom t-center">
<label for="search-input01">All:</label>
<input type="text" size="75" name="q" id="search-input01" />
<input type="image" src="design/search-button.gif" cla...
Hi,
I have an array of strings and want a way to create a CSV line from them. Something like:
$CSV_line = implode(',',$pieces);
Will not work as the pieces may contain comma and double quotes.
Is there a PHP built in function that takes the pieces and return a well formatted CSV line?
Thanks,
Roge
...
I'm developing a web application that requires the use of Cron. I'd like to make it easy to setup with an auto install process like Wordpress. I have no problems writing the install script up en till its time to set up Cron. Please tell me if I can do this.
...
What's the best approach to comparing two images with php and the Graphic Draw Library?
This is the scenario:
I have an image, and I want to find which image of a given set is the most similar to it.
The most similar image is in fact the same image, not pixel perfect match but the same image.
I've dramatised the difference between th...
I have the following data from print_r ($_SESSION);
Array (
[totalprice] => 954
[cart] => Array (
[115] => Array (
[name] => MÅNESKINN
[price] => 268.00
[count] => 1 )
[80] => Array (
[name] => DELFINLEK
[price] => 268.00
[count] => 1 )
[68] => Array (
...
Finally I have got this function to work. It does its job but it looks real messy, just wanna hear your thoughts and maybe theirs something I could improve?
Thanks alot!
Login
$result = mysql_query("SELECT * FROM users WHERE username = '".mysql_real_escape_string($_POST['username'])."' AND password = '".md5($_POST['password'])."'");
$...
The $_SESSION has the following data array.
Array (
[totalprice] => 954
[cart] => Array (
[115] => Array (
[name] => MÅNESKINN
[price] => 268.00
[count] => 1 )
[80] => Array (
[name] => DELFINLEK
[price] => 268.00
[count] => 1 )
[68] => Array (
[name] => OPPDAGELSEN
[price] => 418....
Hello guys
I have a table in DB that has messages exchanged between groups and I need to create a table like this one (messages exchanged between 2 groups):
knowing that Gr1,.... are group names from DB and numbers are from DB too.
Edited to add sQL query (given by Sarah in comments -below):
(SELECT COUNT( Msg_ID ) AS msgcount, Gr...
I've got a script that sets some session values before redirecting to / using header().
I've read many posts about the $_SESSION variable being destroyed / lost after header(), even after I implemented this:
// set session here
session_regenerate_id(true);
session_write_close();
header("Location: /");
session_start() is set in the c...
Hi friends,
i develop a webpage , in that i need to change the date format from 22/01/2010 to 2010-01-22
i use the following function but i am getting a warning as "Deprecated : Function ereg() is depreceted in c:\wamp\www\testpage.php on line 33" . Is there anyway to hide that error or is there any other way to change the date format ?...