Hi,
I want to pass the result of a query trough a $.post.
function GetAllTasks()
{
$sql = "select t.id as task_id,
description,
createdat,
createdby,
max_requests,
max_duration,
j.name as job_name
from darkfuture.tasks t...
I'm doing a left join on several tables. What I want to happen is that it list all the businesses. Then, it looks through the photos, videos, specials and categories. IF there are photos, then the tables shows yes, if there are videos, it shows yes in the table.
It does all that without any problems. Except for one thing. For every phot...
on my database i am planning to create a table storing messages to alert users of anything they need to do.
i am looking at using a jQuery growl like notification method but im confused at how i would begin building it.
the data would be added into the database using the standard MYSQL insert method from a form but how would i select...
Hi all,
I am trying to display a recursive list in PHP for a site I am working on.
I am really having trouble trying to get the second level to display. I have a function that displays the contents to the page as follows.
function get_menu_entries($content,$which=0)
{
global $tbl_prefix, $sys_explorer_vars, $sys_config_vars;
...
I'm hoping to use Google Maps on my site.
My addresses are stored in a DB. I’m pulling up a page where the information is all dynamic. For example: mysite.com/site/business/5 (where 5 is the id of the business).
Let’s say I do a query like this:
function addressForMap($id) {
$this->db->select('b.id, b.busaddress, b.buscity, b.buszip')...
I want an adaptable database scheme. But still use a simple table data gateway in my application, where I just pass an $data[] array for storing.
The basic columns are settled in the initial table scheme. There will however arise a couple of meta fields later (ca 10-20). I want some flexibility there and not adapt the database manually e...
$GLOBALS['current_view'] and global $current_view, which do you prefer and why?
...
I have a table of tags
ID tag
--- ------
1 tagt
2 tagb
3 tagz
4 tagn
In my items table, I'm using those tags in serialized format, comma delimited
ID field1 tags
---- ------ -----
1 value1 tagt,tagb
2 value2 tagb
3 value3 tagb,tagn
4 ...
Hello!
I have a session variable $_SESSION["animals"] containing a deep json object with values:
$_SESSION["animals"]='{
"0":{"kind":"mammal","name":"Pussy the Cat","weight":"12kg","age":"5"},
"1":{"kind":"mammal","name":"Roxy the Dog","weight":"25kg","age":"8"},
"2":{"kind":"fish","name":"Piranha the Fish","weight":"1kg","age":"1"},
"...
I am trying to get a random array like this
srand((float) microtime() * 10000000);
$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
echo $input[$rand_keys[1]] . "\n";
it shows 2 numbers randomly if I have $rand_keys = array_rand($input, 2);$rand_keys...
Hello,
The function below allows a user to insert a comment into a MySQL table called "comment." Then, the file "comments2.php" displays all comments for a given submission.
Right after a user submits a comment, I would like the top of the user's browser to be anchored by the comment the user just submitted.
How can I do this?
Tha...
I want to prevent users from accidentally posting a comment twice.
I use the PRG (post redirect get) method, so that I insert the data on another page then redirect the user back to the page which shows the comment. This allows users to refresh as many times as they want. However this doesn't work when the user goes back and clicks subm...
I've got my HTML inside of $html.
dom = new DOMDocument();
$dom->loadHTML($html);
$xpath = new DOMXPath($dom);
$tags = $xpath->query('//div[@id="header"]');
foreach($tags as $tag) {
var_dump($tag->nodeValue); // the innerHTML of that element
var_dump($tag); // object(DOMElement)#3 (0) { }
}
Is there a way to get that no...
I just started the Plugin development for the Wordpress, but finding it little difficult to understand. Looks like everything should be hooked with the wordpess to get it run and moreover are there all the global variables that i need to use.
I am making a video plugin and designed some of the forms and display page, but didn't went th...
I've got a website that is currently all in English. It is an online game, so it has a bunch of different pages with static text, as well as a lot of content in a database.
I am trying to expand more globally and am gearing up to release some localizations of the site. However, I'm not sure about the best way to go about setting thi...
On my registration script i have:
// Save registration information into the database
// Set sessions
$_SESSION['var1'] = 'somevalue';
$_SESSION['var2'] = 'anothervalue';
header('Location: /somewhere');
exit();
Then on my login script i have:
// Check if user provided correct login credentials
if (correct) {
$_SESSION['var1'] = ...
Hello,
I'm kind of a website development nub so bear with me.
My problem is that the website php session doesn't seem to be set when I log in to my website. After ensuring that the username and password are correct, I have the following simple code:
session_start();
$_SESSION['username'] = $myusername;
$_SESSION['password'] = $mypassw...
Seems like a fairly simple issue but can't get it to work. I am getting the user to download a csv file(which works fine).
Basically I can't get the carriage return to work.
header("Content-type: text/x-csv");
header("Content-Disposition: attachment; filename=search_results.csv");
echo '"Name","Age"\n"Chuck Norris","70"';
exit;
Res...
I'm new to PHP and i was trying to learn mod rewrite to rewrite my URLs i use godaddy as my hosting company and they say to add the desired code to the body of your .htaccess file how do I mod rewrite my URLs and add it to my .htaccess file?
Can some one give me an example of how to do this as well as point me to a good tutorial and or ...
Here's my current code:
define('IMG_WIDTH', (isset ($_GET['width'])) ? (int) $_GET['width'] : 99);
define('IMG_HEIGHT', (isset ($_GET['height'])) ? (int) $_GET['height'] : 75);
$image = imagecreatefromjpeg($_GET['image']);
$origWidth = imagesx($image);
$origHeight = imagesy($image);
$croppedThumb = imagecreatetruecolor(IMG_WI...