Hi I'm using Closure Compiler to compress and join a few JavaScript files the syntax is something like this;
$c = new PhpClosure();
$c->add("JavaScriptA.js")
->add("JavaScriptB.js")
->write();
How could I make it systematically add more files from an array lets say for each array element in $file = array('JavaScriptA.js','JavaScri...
Hello.
I get a page using file_get_contents from a remote server, but I want to filter that page and get a DIV from it that has class "text" using PHP. I started with DOMDocument but I'm lost now.
Any help?
$file = file_get_contents("xx");
$elements = new DOMDocument();
$elements->loadHTML($file);
foreach ($elements as $element) {
...
Here is what i'm trying to do:
Delete a project from the projects table and all the images associated with that project in the images table.
Lets say $del_id = 10
DELETE FROM projects, images WHERE projects.p_id = '$del_id' AND images.p_id = '$del_id'
What is wrong with this query?
...
I'm working on my first PHP project, and it's going well. I've been able to figure out how to do most of what I need so far, but there's one big problem for me now: E-mail.
I'm on a shared server, so I can't install PEAR, and I can't modify my php.ini. According to my host's very limited documentation, I have to use SMTP so I can't (cor...
Stupid question, this code:
<?php
$variable = system("cat /home/maxor/test.txt");
echo $variable;
?>
with file test.txt:
blah
prints:
blah
blah
What can I do with system() function to not print nothing so I get 1 "blah"???
...
Given the following code snippet:
$i= 11;
function get_num() {
global $i;
return (--$i >= 0) ? $i : false;
}
while($num = get_num()) {
echo "Number: $num\n";
}
Results in the following output:
Number: 10
Number: 9
Number: 8
Number: 7
Number: 6
Number: 5
Number: 4
Number: 3
Number: 2
Number: 1
However, I also w...
Hello,
I was thinking of making a commercial application to sell to customers to install on their servers but I wanted to do it with PHP & MySQL.
what should i do to ensure that the source code (& Database) will not be opened nor copied.
The most important thing is the code will be hosted on the customer server.
And also how to ensure ...
How do I use the sha512 function for PHP?
Can I replace all my md5 funtions with the sha512 function?
Do I have to download something if so what?
Can any one provide examples? Thanks!
...
I'm having trouble with the MyClass::function(); style of calling methods and can't figure out why. Here's an example (I'm using Kohana framework btw):
class Test_Core
{
public $var1 = "lots of testing";
public function output()
{
$print_out = $this->var1;
echo $print_out;
}
}
I try to use the following to cal...
Hi. I'm using symfony with doctrine and I make a registration form. Email field is declared unique and if I set it to already existing one, I get the message An object with the same "email" already exist.. I use the following validator:
$this->validatorSchema['email'] = new sfValidatorEmail(array('required' => true), array('invalid' => ...
I have a PHP array that I'm using to generate an HTML form. The PHP array is this:
<?php
$vdb = array (
array( "Alabama", 275),
array( "Alaska", 197),
array( "Arizona", 3322));
?>
The PHP to generate the HTML form is below. I need to have the value be the name of the s...
I have a practical exam in web technologies so html, css, javascript and (possibly) php. I'm still learning and just wondered if you guys had any advice. HTML im fine with, css sometimes takes me time to get right and javascript and php get a bit messy! It's open book, so what would you suggest taking with me?
...
Say I have a simple client/server scenario with one method:
// client code
$client = new SoapClient("service.wsdl");
$result = $client.getPi();
...
// server code
function getPi(){
return 3.141;
}
$server = new SoapServer("service.wsdl");
$server.addFunction("getPi");
$server.handle();
Am I right in thinking that when the client...
I was wondering if I use PHP's hash() function to generate sha512 hashes how would my MySQL table field look like in-order to be capable of holding the hashed password.
Here is my current MySQL password field layout
char(40)
...
I've been trying to create a specialised CMS, as none of the current open-source ones fit my needs for this project.
I did my research on Google, tried multiple times but haven't got very far with this project.
I'm trying to create a CMS for a TV/episode guide which is similar to this
where records expire and delete from the database a...
Ok I am trying to update a specific area of a table in postgresql
I want it to find the user that goes along with the table
and then update the information I have
like in this case the email is the user name that it needs to look for.
it needs to add in areas like $aboutSelf, $hobbies, $music, $tv, $sports
so ya I have no idea how t...
Ok the error is showing up somewhere in this here code
if($error==false) {
$query = pg_query("INSERT INTO chatterlogins(firstName, lastName, gender, password, ageMonth, ageDay, ageYear, email, createDate) VALUES('$firstNameSignup', '$lastNameSignup', '$genderSignup', md5('$passwordSignup'), $monthSignup, $daySignup, $yearSi...
I've got an html page from where Im making this call periodically:
function logon(id)
{
$.get("data.php", { action: 'online', userID: id}, function(data){
$("#msg").html(data);
});
}
What this does is it calls this SQL script in data.php:
$sql = "update user_sessions set expires=(expires + 2) where userID = $userID";
mysql_query(...
Im working on a website (html,css,javascript, ajax, php,mysql), and I want to restrict the number of times a particular user votes for a particular video.
Its similar to the YouTube system where you can voteUp or voteDown a particular video.
Each vote involves adding a row to the video.votes table, which logs the time, vote direction(u...
I've got about 6 subdomains that have a "contact us" link and I'm sending all these links to a single form that uses "Contact Form 7". I add ?from=site-name to each of the links so that I can set a $referredFrom variable in the contact form.
The only two things I'm missing are (1) the ability to insert this referredFrom variable into th...