I run foo.com. I have two different applications that live in foo.com: one is foo.com/bar, and the other is foo.com/example. I use sessions to track information about the user while they're logged in, but if the user goes from foo.com/bar to foo.com/example, foo.com/example sees the session the user started from foo.com/bar and uses that...
I know that you cannot simply set DocumentRoot in htaccess but it's all I have access to. Is there a work around? How should I proceed? Or is this the wrong configuration for a setup like this?
I have a dev server where: www.foo.com is mapped to /usr/www/users/foo.
I then have
www.foo.com/peter => /usr/www/users/foo/peter
www.foo...
Hello.
Could some please advise how to include a php file to update content in a div upon successful Ajax form submit?
This works:
jQuery(form).ajaxSubmit({
success: function() {
$('#ajaxRenew').load('script.php');
}
});
but my script.php requires headers, etc, from the page it gets included into (it works ok as "Include" normal...
Let's say I have a PHP class called Color, it's constructor accepts various params.
// hex color
$myColor = new Color('#FF008C');
// rgb channels
$myColor = new Color(253,15,82);
// array of rgb channels
$myColor = new Color(array(253,15,82));
// X11 color name
$myColor = new Color('lightGreen');
My question is:
How should I use p...
This has been driving me crazy. I know in C++ and in PHP you can fill a string or a file with hard coded text.
If I remember correctly this is how it is supposed to look:
var <<< DELIMITER
Menu for program X
1.Add two numbers
2.Substract two numbers
3.Multiply two numbers
Please pick an option from (0-3);
DELIMITER
Th...
Hello,
I want to make a category path with pagination. URL's would be as followed;
All paths should work with or without trailing slash (if possible)
/category/entertainment-and-music/
/category/entertainment-and-music/music/
(represents "music" category "under
entertainment and music")
/category/entertainment-and-music/5/
...
So I'm working on a project for a realtor. I have the following objects/MySQL tables in my design:
Complexes
Units
Amenities
Pictures
Links
Documents
Events
Agents
These are the relationships between the above objects.
Complexes have a single Agent.
Complexes have multiple Units, Amenities, Pictures, Links, Documents, and Events.
Un...
We are building a large search interface with close to 70 properties. Most of these properties are boolean (only hold 0 or 1), around 12 are with int values and some are string.
goal: http://www.example.com/q/test_search/fdgREGd3vfS323
want to avoid: http://www.example.com/q/test_search/?val_12=1000&val_120=0&val_4=XY....
Our ...
Hello,
How does gettext translate string variables? It doesn't seem to want to do it.. lets say I have $sentence = "Hello World"; and then I want to echo ($sentence); ... how can I do that so that I can translate what's inside $sentence in Poedit?I can use -> echo sprintf(("%s test"), $sentence) and this will print "Hello World test" in...
I've got a number of REST feeds I'd like to store in a MYSQL database, can anyone suggest a solution for this? Something PHP related appreciated....
...
Im making a rudimentary "human test" for a form on my website.
I want to take the current date (to the minute, not second), and combine that with the users REMOTE_ADDR, then from that generate a string (perhaps use md5?) then limit that to 6 characters.
This code will then be presented to the user, which is instructed to copy it to a p...
Hello i have this foreach loop that gives weird result , it displays only the first character form the db record
<?php
$result2 = mysql_query("SELECT id,fp_thumb,title FROM media") or die(mysql_error());
$data2 = mysql_fetch_array($result2) or die(Mysql_error());
foreach ($data2 as $val) {
echo '<li><a href="media.php?id='.$val['id...
Everywhere I read about converting time to a users timezone time says the best method is to store a date adn time in UTC then just add the users timezone offset to this time.
So I am wanting to know, how can I store a date in UTC time, I use mysql's DATETIME field.
When adding a new record to mysql in my PHP code I would use NOW() to...
How is one supposed to handle files that aren't in the current directory when using ftp_put? This piece of code is trying to upload a file that I know exists, but it always gives the following error:
"Warning: ftp_put() [function.ftp-put]: Requested action not taken, file not found or no access. in /path/to/files/domains/mydomain.com/ht...
I need to find a PHP based HTML (as in WC3-Like) Validator that can look for invalid HTML or XHTML. I've searched Google a little, but was curious if anyone has used one they particularly liked.
I have the HTML in a string:
$html = "<html><head>.....</body></html>";
And I would like to be able to test the page, and have it return the...
Hi is this totally safe or not? I would like a totally safe fileuploading script for my new project. Thanks in advice. Here is the one i found:
<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 20000))
{
if ($_...
I've a string which looks like this:
[{text:"key 1",value:"value 1"},{text:"key 2",value:"value 2"},{text:"key 3",value:"value 3"}]
I'm not sure what kind of notation this is, AFAIK this is generated by a ASP .NET backend. It looks a lot similar to JSON but calling json_decode() on this fails.
Can someone bring me some light on this ...
Hello, I am currently writing a script whereby an array of checkboxes are displayed using:
<?
while($i = mysqli_fetch_array($get_perms)){
$pname = $i[pname];
$id = $i[id];
?>
<div>
<input type="checkbox" tabindex="1" name="<? echo("$id");?>" value="1" <? if($permissionid[$id] == '1') {echo ' checked="checked" ';}?> /><?echo...
Hi guys,
at my working place (php only) we have a base class for database abstraction. When you want to add a new database table to the base layer, you have to create a subclass of this base class and override some methods to define individual behaviour for using this table. The normal behaviour should stay the same.
Now I have seen ma...
I want to rotate the location where temporary files are written however it is my understanding that the PHP script wont execute until after the full post is already completed. By that time the file is already written to the default temp location from the configuration file which is loaded in at the time apache is spawned and the php mod...