Josh Connerty 20 Unverified User

Thanks for the instructions!

Now I will just run ffmpeg in command prompt and learn it and see if it works.

Now if it does how do I translate this to run it off php to while uploading and converting?

I have to do some programming like system(C:\ffmpeg\etc)?
Followed by the parameters -a -b -c in php something like that?

google PHP execute, this should work, it basicly allows you to execute a batch programm so would be pretty much like typing in the command window.

I have had some trouble with exec because if the command prompt doesn't close within 60 seconds you get a script timeout error. I suppose the command prompt stays open though :P.

Take a look at using cron jobs after the file is uploaded.

Basicly upload the file and upon completion give them a message saying, we are currently checking the file or whatnot we will email you when it's done.

Then update the mysql database and when the cron job next runs it will convert the file stated in the mysql database from the current file extension to flv for instance. When this cron job finishes you could say change a field from 1 (needs converting) to 2 (needs the user to be notified) , this means you can have another cron job checking for user notifications, and when it finds one it sends the email then changes the field to 3 (done).

You could also add …

Josh Connerty 20 Unverified User

Shared hosting dreamhost.com has FFMPEG and flvtools2 on the machine I'm on. I haven't used it much, but it worked when I tested it just now. Transcoding a 400MB wmv to FLV with FFMPEG took about 10 minutes. I have no idea if thats considered fast or slow.

I suppose thats actually kinda quick as you'll find most shared servers are terribly over filled so to speak.

Josh Connerty 20 Unverified User

So you are trying to send a windows word document over fax to someone via a webform?

Josh Connerty 20 Unverified User

Or furthermore Google: PHP upload to MySql database.

Depends on wther you wish to store the image binary in the MySql database or in a webserver directory and just store the location in the MySql database.

Josh Connerty 20 Unverified User

Yes but we still need you to answe how you are going to give a finish time???

Timestamp is the best option.

Josh Connerty 20 Unverified User

Or JS and it takes a timstamp and minuses 1 second from it every seccond :P Same basis just doesn't need to pass to the PHP document.

Josh Connerty 20 Unverified User

Basicly the logic is like this, :P
You take the time stamp when they log in, store this in two fields last log in time and last movement.

Every page they visit you need to runa query to update their last move to the current time stamp.

Most systems use 5 minutes so I will to.

$timestampFromTable = "sometimestamp";
$timenow = time();

$lastMove = $timenow - $timestampFromTable;

$fiveMins = 60*5;

if( $lastMove > $fiveMins ) {
    echo "User not logged in...";
} else {
   echo "User is logged in";
}
Josh Connerty 20 Unverified User

That is *()&$##*( GOLD!!!!

That is going down in my quotes book.

I agree with you :D:P

Josh Connerty 20 Unverified User

Quick search turned up this, http://forums.aspfree.com/code-bank-54/javascript-countdown-timer-89373.html

How are you getting the finish date? For example a timestamp in a mysql database etc.

Josh Connerty 20 Unverified User

This is then in the wrong section. You need to look for JavaScript.

PHP is server-side so it'd be useless for what you are trying to acheive.

I will have a look and see what I can come up with.

Josh Connerty 20 Unverified User

Well I'd presume it is some kind of registry entrie that is cocking with your system.

To my knowledge there not much else to do.

Josh Connerty 20 Unverified User

Im pretty sure my hosting is LINUX but I run WINDOWS. But I use windows to access both not linux. So I think I would need to know how to install it on windows first and then contact me web host about installing it on the server? or if i just need to install it on the root I can do that myself as I have access. But that still leaves how to install on windows as it only has linux instructions.

Thanks

I presumme you are on a shared server?

As far as I know there isn't a shared server host that supports FFMPEG.

It causes allot of strain on the servers so they tend not to allow it.

If the server doesn't already have FFMPEG installed then you will need Shell Root Access, this is like command prompt for winodws.

I would advise you (if you are serious about this) to falk out some extra money on either a dedicated server or a VPS server.

You should be able to install FFMPEG on either but I would presume you would need a heafty VPS server to handle FFMPEG as allot only allow you 500MB burstable RAM.

Have you thought of building a quad core system and paying a local computer store to give it unsupported hosting (means you have to do everything yourself, it's your computer). Although you would have to falk out £640 for a copy of windows server 2003 (the …

Josh Connerty 20 Unverified User

Does it need to change without the page refreshing or not?

Josh Connerty 20 Unverified User

Hmmm, I think if you uninstall it alltogether and then do what I said in the previous post serch and destroy all IE7 files and registry entries and then reinstall it.

Josh Connerty 20 Unverified User

Yuo could just include a page containign the error?

Also could you not just build the code into the block where you are redirecting.

Or if you would like to use shortcode then create a function like return_error(1);
and have a list of all different error codes etc. This could just echo out an error message or an entire page...

The other alternative is using .htaccess's RewriteMod to tidy the url so the user doesn't realise it is in the title.

Josh Connerty 20 Unverified User

lol easy mistake to make.

Can you mark this as solved please?

Thanks,
Josh Connerty

Josh Connerty 20 Unverified User

I may be able to do it for you...

It'd be easier if you have the users id or username in the cookie?

You will need to add another table!

Execute this for the table

CREATE TABLE IF NOT EXISTS `files` (
  `file_id` int(2) NOT NULL,
  `file_name` varchar(200) NOT NULL,
  `file_src` varchar(200) NOT NULL,
  PRIMARY KEY (`file_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

And this for the values. Change the 'File (?) name' for the name of the file and change the 'File (?) HTTP source' for the address of the file eg. http://mydomain.com/filename.zip.
** (?) being the file number!!! **

INSERT INTO `files` (`file_id`, `file_name`, `file_src`) VALUES
(2, 'File 2 name', 'File 2 HTTP source'),
(1, 'File 1 name', 'File 1 HTTP source'),
(3, 'File 3 name', 'File 3 HTTP source'),
(4, 'File 4 name', 'File 4 HTTP source'),
(5, 'File 5 name', 'File 5 HTTP source'),
(6, 'File 6 name', 'File 6 HTTP source'),
(7, 'File 7 name', 'File 7 HTTP source'),
(8, 'File 8 name', 'File 8 HTTP source'),
(9, 'File 9 name', 'File 9 HTTP source'),
(10, 'File 10 name', 'File 10 HTTP source');

Then use this code please note that the commented queries are dependant on wether you store the user id in the cookie or the username in the cookie. If you use neither then you, if you don't mind me saying, fucked. You will have to go back and change the login to add the users username or id …

Josh Connerty 20 Unverified User

Strange...

Will have another look.

Josh Connerty 20 Unverified User

Ooops didn't see the preg_match, my bad.

Josh Connerty 20 Unverified User

I always thought the first was the start recoed and the second was the last record.

I think 3,3 is wrong run an if statement to make sure the count variable is not equal to or greater to 3 this would confuse MySql's brain.

Josh Connerty 20 Unverified User

Tried an iframe?

Josh Connerty 20 Unverified User

Hmmm, I presume it is in the registry. Is it still displaying in the taskbar? If not is it really an issue?

If so then I would look into the forums for a note on the taskbar registry and try and delete it that way. In the meantime I will have a look.

Josh Connerty 20 Unverified User

Hmmm maybe you could try downloading the .msi file from the windows website, I think it uses a different method of installing.

If this brings no luck you may want to clear your registry of all IE7 entries and search for all IE7 related files in the C:/Program Files/Internet Explorer folder I belive thats it anyhow.

Try these two and tell em where you get :)

Josh Connerty 20 Unverified User

0I think cpanel has the databse wizard correct? Well when you create a user you must add them to the database you are using. This is because the user can do everything they need to do but have no database assigned thus can't access your database.

If you have any issue's doing this then you should fisrt speak with your web host and ask them if they can do it :P

Or post back here for help I'm sure I can post some images with instructions etc.

Josh Connerty 20 Unverified User

Hmmm. try gettingthe script from scratch and starting again.

Josh Connerty 20 Unverified User

have you tried to download it either via microsoft update (if you downloaded it via a browser) or vice versa?

Josh Connerty 20 Unverified User

Got a screen shot I am not quite following you?

Josh Connerty 20 Unverified User

Arrays start from zero. Unlike counting t ten etc. :P
(Only example I could conjour up)

Josh Connerty 20 Unverified User

But the thing is $args[1] probably doesn't have a sufficient value because it hasn't come from anywere. You don't have to srt it's value like that but where has it's value been set. You just seemed to come up with $args from the middle of nowhere.

What are they supposed to be?

Also if there is somewhere were you have set it try $args[0] and $args[1] instead of $args[1] and $args[2]

Josh Connerty 20 Unverified User

So where have you got args from?

Josh Connerty 20 Unverified User

Okay so the version you have tried that is working, can you gimme an update of the code please so I know what is happenging now,
Thanks.
Ignore what I juts wrote :P

Josh Connerty 20 Unverified User

Ahhh a weksh boy are you? Not far from wales myself.

And we are here to help, always are. It's great to see people come and go knowing that they leave with a bit of gained knowledge.

Josh Connerty 20 Unverified User

Well fisrt off ytour get is retreiving names that don't have an x in the yet you put it at the end...

Can you give us more of an idea what the forbidden error is. Either a screen shot or an exact copy of the text displayed.

Thanks.

Josh Connerty 20 Unverified User

No problem.

Josh Connerty 20 Unverified User

No problem

Josh Connerty 20 Unverified User

This way would probably be better and only use one line.

$name = fetch("SELECT `name` FROM profile WHERE `id` = '$id'");

echo $name;
Josh Connerty 20 Unverified User

It does tend to crash but it's quite good and doesn't crash too often.

But yes change either the upload to make all the extensions lowercase or make a scrip that will scan or upercase versions and rename them.

Similarly gif and GIF do tend to do the same.

Josh Connerty 20 Unverified User
Josh Connerty 20 Unverified User

What PSU do you have? I'm pretty sure there is a watt calculator out there somewhere.

Josh Connerty 20 Unverified User

Hmmm who is your web server host? Youm are right this seems very much like you either have the wrong username or password or maybe a database name etc.

There are a few ways you can debug this error on the connection variables try adding this:

$con = mysql_connect( "host" , "username" , "password" ) or die( "SERVER SELECT ERROR: " . mysql_error() );

$db = mysql_select_db( "database" , $con ) or die( "DB ERROR: " . mysql_error() );

If these return any problems then it is indeed one of the listed problems. However if it isn't then it has something to do with your query. Make sure that the table exists and that you have not givein it an upercase name (must all be lower case, some linux servers do this).

If you get any errors please post them back here.

Hope this helps you out a little.

Josh Connerty 20 Unverified User

Okay, well I tend to beleive in dynamic applications so I would advise making something that can do it via a click of a button.

Josh Connerty 20 Unverified User
<?php
mysql_connect("localhost", "user", "password");
mysql_select_db("MyDataBase");
$mydbstuff = mysql_query("SELECT  * FROM `MyTable`");
$ALine = mysql_fetch_array( $mydbstuff );
$theTitle = $ALine['title'];

echo $theTitle;
?>

Try that it might work better.

Did you notice you were not running a query at all?

The best way to do what you are trying to acheive is:

1) Run a query to pull the data [$query = mysql_query("SELECT * FROM `MyTable`");]
2) Put it into an array [$row = mysql_fetch_array( $query )]
3) Take the specific array [$variable = $row;]

Josh Connerty 20 Unverified User

WinSCP is a good one.

Well, I was thinking more along the lines of .htaccess. You could add a mimetype decalring JPG as an image. This as far as I know will work fine.

But it is a good idea to change them all. You could run a simple command on the upload script or can manually run a script post upload that will scan for all the .JPG files and change them to .jpg.

I think the upload version is much better and I would also advise image resizing. This will also speed up the page loading. For instance if the client was to upload a 1024x768 image that will take a very long time to load. If you resize it to at max a 90x90 then this will reduce the download time to virtually null.

Josh Connerty 20 Unverified User

Well as far asd I knew (and thats not too much) I thought soem big hardware changes caused you to reformat your hard drive. That was my instail thought but then I remembered back in the Pentium III days I could switvh between two without anything going wrong.

Okay my first thought after this is your power supply. It could be that the Athlon (dual core?) is consuming more watages then the previous sempron. So it may be that you have to get a bigger PSU. What PSU do you currently have installed?

Josh Connerty 20 Unverified User

Hmmmm, maybe you could try make one yourself, it would give you an easier customized page controler and means you know exactly how it works and how to change it etc.

If you can't or don't want to however then you will need to post the code so as we can debug your script.

Josh Connerty 20 Unverified User

You see the thing is people need a programmer that can difficult things, hence the reason why they are not or can not do it them selves.

You wouldn't find any jobs on just about any freelance programer job website.

However if I tell you a website will you admit defeat and learn some more before going any further?

Josh Connerty 20 Unverified User

You can however do this in the mail function.

Your from variable, we haven't got it can you show us it so as we know what you are doing with it.

Josh Connerty 20 Unverified User

Does it work if you only order by one of the terms by removing the + and the following statement?

Josh Connerty 20 Unverified User

Can anyone please help.I am trying to add values to a table from 2 dropdown lists which are dynamically poulated.
I have managed to achieve it for one drop list but have added a second and cannot create the correct syntax to add both values to the table.

// Check for a URL.
	if (eregi ('^([[:alnum:]\-\.])+(\.)([[:alnum:]]){2,4}([[:alnum:]/+=%&_\.~?\-]*)$', $_POST['url'])) {
		$u = escape_data($_POST['url']);
	} else {
		$u = FALSE;
		echo '<p><font color="red">Please enter a valid URL!</font></p>';
	}
	
	// Check for a URL title.
	if (!empty($_POST['title'])) {
		$t = escape_data($_POST['title']);
	} else {
		$t = FALSE;
		echo '<p><font color="red">Please enter a URL name/title!</font></p>';
	}
	
// Check for a URL date.
	if (!empty($_POST['pub_date'])) {
		$p = escape_data($_POST['pub_date']);
	} else {
		$p = FALSE;
		echo '<p><font color="red">Please enter a date!</font></p>';
	}

		
	// Check for a description.
	if (!empty($_POST['description'])) {
		$d = escape_data($_POST['description']);
	} else {
		$d = FALSE;
		echo '<p><font color="red">Please enter a description!</font></p>';
	}
	
		// Check for a publisher.
	if (isset($_POST['posters']) && (is_array($_POST['posters']))) {
		$poster = TRUE;
	} else {
		$poster = FALSE;
		echo '<p><font color="red">Please choose a Publisher!</font></p>';
	}
	
	// Check for a category.
	if (isset($_POST['types']) && (is_array($_POST['types']))) {
		$type = TRUE;
	} else {
		$type = FALSE;
		echo '<p><font color="red">Please choose a Client!</font></p>';
	}
		
	if ($u && $t && $d && $p && $type && $poster) { // If everything's OK.
	

		// Add the URL to the urls table.
		$query = "INSERT INTO urls (url, title, description, pub_date) VALUES ('$u', '$t', '$d', '$p')";		
		$result = @mysql_query ($query); // Run the query.
		$uid …
Josh Connerty 20 Unverified User

I've never used the method you are trying to use so I wouldn't be able to help.

I would just run a query to fetch the data then run another query to insert it into another table.

To be honest with you mate you might save yourself about minute using the method you are tryin, it's not worth it.

I swear the world is turning lazy :P