Hello all,
I am working on a PHP application and missing some of the functionality that Rails has. I currently have an AJAX form that when submitted accesses my_page_save_ajax.php. After I process the form and save it, I would like to redirect the AJAX call to either my_page_show_ajax.php if successful or back to my_page_edit_ajax.php i...
Can anyone of you help me understand the behavior I get when visiting this page?
<html>
<body>
<?php
$liendb = mysql_connect("localhost","","");
mysql_select_db ("test");
for($i = 0; $i < 418; ++$i)
{
echo("Any old text<br />");
}
$resultatSQL = mysql_query("SELECT...
Greetings!
I am attempting to solve a few performance issues which are cropping up on our site. As part of this effort I have begun profiling our most trafficed pages according to GA.
Essentially I have determined, as I originally suspected, the majority of time spent is in database related traffic... makes sense. Unfortunately, when...
I am building a blog based on a self-rolled MVC structure. I want to build my own, not used a 3rd party.
What is the best way to handle the creation of a new blog? Heres two options i can see...which is better, or is there something i haven't thought of?
Instantiate a blank (doesn't go fetch blog info from db) Blog model, set all the ...
$userid = $_SESSION[userid]
$sqll = mysql_query("SELECT count(id) FROM entries WHERE userid='$userid'");
Is using count(id) efficient? Or is there a better way?
...
Background: I have a site that displays songs with the Post structure of .com/song/foo.html
I am adding every song to an additional child category called "private" that uses a different template (inserts premium content in custom fields), so the structure of the private versions of the Posts will be .com/song/private/foo.html.
Question...
Is there any way w/o majorly rewriting the phpMyAdmin source code to have a different theme chosen based on server?
I see it's easy to change themes, but it applies to all servers.
Reason I'd like to do this is so that when I perform a query on production it shows a different color right there and I won't confuse it with a query on de...
Is there a way to make a static class where it has another static class as a member?
E.G. Parent_Class::Child_Class::Member_function();
...
Hi I'm trying to loop through a array and set a keys value. Very basic question.
The Code I tried is below.
http://pastebin.com/d3ddab156
<?php
$testArray = array("bob1" => array( 'name' => "bob1", 'setTest' => '2'));
foreach($testArray as $item)
{
$item['setTest'] = 'bob';
}
print_r($testArray);
I imagine I'm missing somet...
When is the right time to use functions to set variables inside of my models, verse simply directly assigning them?
AKA...
When do I use:
$model->set('status','active');
...instead of:
$model->status = 'active';
...
I have seen mention of Java and Python. I need something that can be installed on a users desktop without them having to also install Java or anything else. User simplicity is a must.
This widget will log into an online php based calendar that accesses mySQL. Any pointers on what I should be reading up on? Python?
Thanks!
Joel
Up...
Hi
I'm trying to convert this to dwoo:
foreach($duplicates as $duplicate)
{
echo "<tr>";
foreach($column_list as $column)
{
if(@$duplicate{$column . "_diff"} == 1)
{
$id_is_different = '';
echo "<td style=\"background: #333333\" >". $duplicate{$column} ."</td>\n";
}
el...
I am trying to determine the end of a foreach loop that is seeded with a collection of DOMNodeList. Currently, I am using a for loop would like to avoid having a 'magic' number there. I do know there are only going to be 8 columns, but I would like the code me generic for other applications.
Is it possible to convert this to a Foreach...
How would I do to check if a email actially exists?
Cant understand how sites do to send mails with a unique link that the users clicks to validate that he is the owner of email =/
Make a 2 new columns called activationkey and activated and store some random string, send an email with the activationkey, and update the users activated =...
Hello all,
I thought I had answered this question before thanks to StackOverFlow, but I hastily took an answer and it turns out not to be the real cause to my problem.
I have checked my Apache Access Log:
This is me browsing my web app on Google Chrome Browser.
127.0.0.1 - - [06/Jan/2010:22:17:35 +0000] "GET /webs/end/new.php HTTP/1...
Hi stackers,
I'm trying to take a jSON encoded string out of my database and loop through the items but I'm having some difficulty. Here's the string in the database:
["volunteers","seat_dedication_program","memberships"]
And here is the code:
//Looks for _checkbox when looping through my database fields (object dbVals) and turns i...
Hello.
i want to use the functionality of www.stopbadwares.com and implement it in my web app using php.
so i can pass a url and check if it's contains badwares or it's dangerous for use.
is there an api, or class, or something to do that ?
or even if there isn't, is there a similar service, to protect my users from sharing bad links ...
is there a class to handle $_REQUEST that makes the life of a php developer easier?
I want to handle the client requests easier.
I dont want to test with if(is_set($_REQUEST['blabla'])) {makesomthing();}
I wish there could be a solution like this.
class rpclike
{
public function getMember()
{
$memberid = $this->inputhandler['member...
I have a self-rolled MVC framework that I am building, and up to this point have managed to avoid the need for any AJAX calls. Now, however, I'd like to create a real-time updating feed.
My question is, where are the handlers for the ajax calls usually stored in an MVC? Should I store them in the same controller that is involved in maki...
UPDATE: I'm making progress, but this is hard!
The test text will be valid[REGEX_EMAIL|REGEX_PASSWORD|REGEX_TEST].
(The real life text is required|valid[REGEX_EMAIL]|confirmed[emailconfirmation]|correct[not in|emailconfirmation|email confirmation].)
([^|]+) saves REGEX_EMAIL, REGEX_PASSWORD and REGEX_TEST in an array.
^[^[]+\[ matche...