My newest project that I'm looking to build with PHP (likely CodeIgniter) would require some sort of system that would allow a user to drag and drop pre-defined functions/methods into mini-classes/objects and then run/test them in the browser.
So it'd something similar to Scratch. I've designed a relational database that I think could w...
I'm new to PHP so maybe I am overlooking something here but the following:
class someClass {
var $id = $_GET['id'];
function sayHello() {
echo "Hello";
}
}
gives the following error:
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\files\classes.php on line 13
If instead of $_GET['id'] I s...
This may well be simple, but I'm new to Drupal. The organization I work for switched to Drupal a little while ago, but there's still some legacy code in various external PHP files that would be cumbersome to convert over to work within Drupal.
However, it would be very nice to be able to restrict access to some of these pages based on a...
When my PHP script receives data from an AJAX POST request, the $_POST variables are escaped. The really strange thing is that this only happens on my production server (running PHP 5.2.12 on Linux) and not on my local server (running PHP 5.3.1 on Windows).
Here is the AJAX code:
var pageRequest = false;
if(window.XMLHttpRequest) p...
I'm trying to write a script that will download files from an FTP server. They're all fairly large (nearly 2GB each). The script starts running, but then eventually terminates with the above error. Is it size related? Is there a way around this? Here's the code:
<?php
$ftp_server = "ftp.EXAMPLE.com";
$conn_id = ftp_connect ($ftp_s...
Hi,
I'm trying to update the session table used by Zend_Session_SaveHandler_DbTable directly after authenticating the user and writing the session to the DB. But I can neither update nor fetch the newly inserted row, even though the session id I use to check (Zend_Session::getId()) is valid and the row is indeed inserted into the table....
I have a link, which links to domain.com , when a person clicks, I want it to do an ajax call to counter.php and post 2 variables to it, so it can add 1 to the views for that link.
I have a link:
<a href="http://www.domain.com" onClick="addHit('12345', '1')" rel="nofollow" target="_blank">Link Title</a>
How would I do this with jque...
Hey I'm really new to PHP and PostgreSQP or any database in that matter. So I'm at a loss how to do this.
I need an if statement that says.
If(the username user just typed in is already in database) {
my code here
}
the variable the username that the user just typed in is $userNameSignup
how would I do that with PHP for PostgreSQL...
I'm getting the following error while uploading a zip archive.
Warning: ZipArchive::extractTo(C:\xampplite\htdocs\testsite/wp-content/themes/mytheme//styles\mytheme/Thumbs.db) [ziparchive.extractto]: failed to open stream: Permission denied in C:\xampplite\htdocs\testsite\wp-content\themes\mythem\uploader.php on line 17
The thing I ca...
http://www.chuckecheese.com/rotator.php?cheese=4&id=1
I want to take out the id, leaving the cheese to stand alone. I tried:
$qs = preg_replace("[^&id=*]" ,'',$_SERVER[QUERY_STRING]);
But that said I was using an improper modifier. I want to remove "$id=" and whatever number comes after it. Are regexp really as hard as they se...
Hi, I am just trying the session_id function in PHP and I thought that it was unique for each machine that used the website? However, my flatmate and I have the same session_id for on two separate machines. I'm just using session_id() to create the session - am I doing it correctly?
Thanks
Tom
...
I'm new to Doctrine and ActiveRecord.
How should I filter a table after it has been loaded? (i suppose this is preferred over sending multiple queries?)
Is this 'good' or 'bad'?
class UserTable extends Doctrine_Table {
function filterByGroup($group) {
$ut = new UserTable();
foreach($this as $u) {
if($u-...
In php how can I access an array's values without using square brackets around the key? My particular problem is that I want to access the elements of an array returned by a function. Say function(args) returns an array. Why is
$var = function(args)[0];
yelling at me about the square brackets? Can I do something like
$var = funct...
this dont work any options please?
"Result below if printed"
http://maps.google.com/maps/api/staticmap?center=WYOMING,WYOMING,MI&zoom=14&size=500x500&maptype=roadmap&markers=color:blue|label:S|42.902160,-85.696708&sensor=false
need to replace parts of url like shown above to enter "result" into an iframe src= ???...
ORIGINAL TEXT REMOVED
OK, so I found the original problem thanks to a helpful answer.
It lists "Invalid query: No database selected" as the error.
require_once ('../dir_connect.php');
$dbc = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
if (!$dbc) {
die('Could not connect: ' . mysql_error()...
Hi,
I find Yii great framework, and the example website created with yiic shell is a good point to start... however it doesn't cover the topic of multi-language websites, unfortunately. The docs covers the topic of translating short messages, but not keeping the multi-lingual content ...
I'm about to start working on a website which nee...
A friend build a ranking system on his site and I am trying to host in on mine via wordpress and godaddy. It updates for him but when I load it to my site, it works for 6 hours, but as soon as the reload is supposed to occur, it errors and I get a 500 timeout error.
His page is at: http://www.jeremynoeljohnson.com/yakezieclub
My page i...
Hi all, I have an array, which I'd like to search for a value in and retreive the array key if it exists, but not sure how to even go about doing that. Here's my array:
Array
(
[hours] => Array
(
[0] => 5
[1] => 5
[2] => 6
[3] => 6
[4] => 8
[5] => 10
...
I write a function use observer in 1.3.2.4,the event name is "checkout_type_onepage_save_order".
Now I want to move it to 1.4,but I see that the event "checkout_type_onepage_save_order" is disappeared,so I want to know how to write a observer before order saved in onepage checkout?
...
i got this code
`
//
// prints out "Hello World!"
//
hello_world(); //First call
function hello_world()
{
echo "Hello World!<br/>\n";
}
hello_world(); //second call
?>`
Both of 'hello_world' call will print out the same result. It's easily to understand why the second call will be output 'Hello world', but ho...