How would I construct a statement like if current time ($time) is more than 30 seconds past time ($djs['currenttime'])? Would it be something like
if ($time => $djs['currenttime'])? I can't figure it out with the 30 seconds..:).
Thanks :).
...
I have this code:
$link = mysql_connect("localhost", "ctmanager", "pswsafgcsadfgG");
if ( ! $link )
die("I cannot connect to MySQL.<br>\n");
else
print "Connection is established.<br>\n";
print "a";
if ( mysql_create_db("ct", $link) )
print "AAA";
else
print "BBB";
print "2";
die();
And this is the output:
Connection is...
Hi,
Need help here for the following:
Running PhP, javascript, MySQL, XML.
1) Retrieving file from MySQL and stored it onto XML file.
2) Use javascript function to load XML file (that stored those data).
3) It produces invalid characters in XML file.
STEP 1 : Sample of the code in PhP -> Loading MySQL DB to store data onto XML fil...
i have a function (below) which is used in my mysql abstraction class and converts table names in fields like "tableName.fieldName" and replaces them with the specified variables (it's useful for joins). the array of fields is very mixed, and so i need it to support recursion so that it can change the table names in an array(array(array(...
Hello,
I must cleanup some HTML code to remove <style> and <link> tags inside the <body> tag.
I'm already using PHP Tidy to do some cleanup but I did not found how to remove those tags with PHP Tidy.
Do you have a solution ? Or maybe another markup cleaner PHP class...
...
I'm using PHP to get XML from an API (Say that 3 times fast). I'm getting all of the correct strings returned from all of the data. The problem comes when I try to reformat the time string with the following two methods:
$dataset = $xmlDoc->getElementsByTagName( "Class" );
foreach( $dataset as $row ) {
$xmlStartTimes = $row->getEl...
I have a classifieds website, and on each classifieds page, there is a form for tipping a friend where you just enter the persons email-adress and the tip will then be sent. The form is submitted to tip.php where all "magic" happens with checking and sanitizing etc etc...
Lastly I use php:s mail() function to send the email from tip.php...
I am using the following code snippet in order to crop a image?
function crop($width,$height) {
$new_image = imagecreatetruecolor($width, $height);
imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $this->getWidth(), $this->getHeight(), $width, $height );
$this->image = $new_image;
}
Here, $this->imag...
Lets say I have a variable that will always be a string.
Now take the code below:
if($myVar === "teststring")
Note $myVar will always be a string, so my questions is
Which is quicker/best, using === (Indentity) or the == (Equality)?
...
if i have an array like
array("key1" => "value1", "key2" => "value2", ...)
how would i go about removing a certain key-value pair, given the key? thanks!
...
Given an arbitrary string, for example ("I'm going to play croquet next Friday" or "Gadzooks, is it 17th June already?"), how would you go about extracting the dates from there?
If this is looking like a good candidate for the too-hard basket, perhaps you could suggest an alternative. I want to be able to parse Twitter messages for date...
Hello.
Is there a way to know, for example for the 15th of June, how many visitors (unique) went on how many pages, and from what country where they from ?
Like a way to get an array with, for example for the page '/index.php' :
'USA' => 5628,
'Canada' => 2000,
etc...
thanks !
...
I have a very simple INSERT statement being executed from a PHP script running on a Linux Apache web server. I can run the query fine from within SQL Management Studio and it normally runs fine from PHP as well. However, every once in awhile I get an error message from my PHP script that the query failed and the mssql_get_last_message(...
Hi,
I've searched the web but haven't been able to find a solution to the following challenge:
I'd like to somehow associate a function that executes when session_start is called independent of the page session_start is called in. The function is intended to restore constants I've stored in $_SESSION using get_defined_constants() so th...
I'm working on a site written in PHP/MySQL. We have a form to reserve time on a calendar and it works great in Mozilla and stores the reservation to our database, but in IE you fill out the form and when you click the "Reserve" button to submit it and nothing happens. All I can think of is that my javascript is not working with IE. I hav...
Hi all,
Now I have my website built on PHP & Mysql. Consider this like a forum. Now when a user posts a reply in my website 1 (ex. www.website1.com), I want to be able to show the starting thread and it's related replies in a sister website of mine. I want to do this in a way that it does not show the rest of the page & other page conte...
Hi,
I have the two following files:
main.php
include("functions.php")
__EXTRACT();
echo $testvar;
functions.php
function __EXTRACT(){
extract($_POST, EXTR_SKIP);
}
However, having a form with a textbox called testvar I can't get the extract function to extract the data.. if I remove the function call and insert it the extract...
I currently have 2 tables in a MySql database.
Structure:
messages
id | content | user_id | time
submessages
id | subcontent | msg_id | user_id | time
In the submessages table, column msg_id is a foreign key, referencing the id column in table messages.
Now i need to query from php
$cur_userID = $user->current_id; // current user ...
I am trying to add random bytes to binary (.exe) files to increase it size using php.
So far I got this:
function junk($bs)
{
// string length: 256 chars
$tmp = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
Hello,
I am a wordpress plugin developer. I saw the source of many pluginsand many plugin use "classes" in them and some without classes.
Many huge coded plugins like "wp-postratings" does not use Classes and some small plugins use Classes.
edit:
Since classes have private, public and protected access specifiers, i feel a taste of s...