Fadion
-
Posts
1,710 -
Joined
-
Last visited
Posts posted by Fadion
-
-
Basically, HTML uses <br /> while the textarea uses \n. When for ex u enter some text from a textarea in a database, retrieving that data from the db u would have smth like 'text\ntext\ntext'. To convert all the newlines in html brakes u can use the nl2br function. Pretty easy:
echo nl2br('this is some\ntext');
-
It is an extension not a class or smth so it has to be install. If u have a shared host theres no way for your hosting provider to install it, only if they already have it installed which i doubt to be the case. U need a server for this. Also i never had the need to use it so i cant tell, but from what i read in their website, it also supports quick time, so im guessing it has a vast format support.
-
For the first 2 questions the answer is easy, FFMPEG. Its a pretty powerful extension for php http://ffmpeg-php.sourceforge.net/
For the third, u can make Flash custom player. Flash has great video capabilities and some simple actionscript can produce panning, volume adjust etc.
Im sure theres a lot in the net for these. Hope i helped.
-
U can do it simple with mysql so why chosing another method. Maybe a flat file (.txt) can make the work and im sure u can find a lot of good tutorials in the net. Still i'd prefer the database method.
-
Actually i was experimenting with this script and thought to expand its capabilities a bit. Anyway u guys gave me some great ideas.
Thorp, im not a linux pro, but i tried 'whoami' and the user is 'apache' who doesnt have write privileges. Also im not going to realease this script to the end user
-
This topic is already discussed http://www.phpfreaks.com/forums/index.php/topic,147029.0.html
The advice there is to use some already made commercial script, which i dont have a clue what technology uses. Just give it a look.
-
Thnx for the reply m8, but actually it cant work like that. exec() passes its lines to an array and what it shows is just plain text, so using is_file over a string cant get any results. Anyway thnx, hope someone has got any idea.
-
you can validate it using javascript to check if the form is blank, or server side in mail.php
if(strlen($_POST['text']) < 1){ echo 'Please fill in the form'; } else{ ...... }
-
I am making a simple php script using exec() to execute commands in my linux host. When i execute 'ls' it shows the right content on that directory, but what i want to know if there is a way i can distinguish between folders and files. In this way i can lets say make folders show in black and files in grey. Also when i execute a wrong command i wanna get any system error message. If these are possible it would be great if someone helped me.
The actual code im using, just to give an idea:
if(array_key_exists('command', $_POST) and strlen($_POST['command']) > 0){ $command = $_POST['command']; exec($command, $arr); foreach($arr as $value){ echo $value . "<br />"; } }
-
$sql="INSERT INTO flights (CompanyName, PilotName, FlightID, FlightDate, AircraftName, NbrPassengers, CargoWeight, DepartureIcaoName, ArrivalIcaoName, TotalDistance, TotalBlockTime) VALUES ('None', '$valid_user', '$fltnbr', '$fltdate', '{$_POST['plane']}', '{$_POST['passengers']}', '{'$_POST['cargo']}', '{$_POST['depart']}', '{$_POST['arrival']}', '{$_POST['distance']}', '{$_POST['hour']}' . '{$_POST['minute']}')";
also mysql_query should be mysql_query($sql)
-
As far as i know it uses md5 and if so its impossible to decrypt, as it uses a one way hash algorithm.
-
Maybe u can do it with a list of usernames in xml and some ajax, but my knowledge of javascript is a disaster.
-
I dont get this query:
$query="insert into $songt(name, artist) values ($_POST[name], $_POST[artist])";
Shouldnt it be:
$query="insert into table (name, artist) values ('{$_POST['name']}', '{$_POST['artist'])}'";
-
in flash u can use
loadVariables("http://www.site.com/index.php", target, "GET");
The parameters are 1. site 2. target dynamic text 3. method. Guess ure pretty clear right now
-
Maybe uve written the wrong columns, but anyway the query cant work like that. Post variables must be called like $_POST['plane'] and in a query they must be like
'{$_POST['plane']}'
-
Try to CHMOD 777 the directory where u are uploading, to give it full (including write) permissions.
-
as far as i know theres no function error() in php, only i thats a custom function. Anyway u're getting a call to undefined function error, so i assume u have not made a custom one. So remove that and just use echo.
-
Yep theres really no question there. Why store deleted ids in a different table?! It would be just a pointless table with pointless ids.
-
For the files to be unique, he can add a 5 digits random number to the filename (ex. photo-33425.gif) and insert the same in the database. It would be a more readable technique.
-
It is an error produced by the query, which in fact is written correctly. Im guessing ure using a non existing table 'users' which gets you the error.
-
There's no way u can decrypt it. First i thought u were going to hash only the file extension and like that u can do it comparing the hash with md5('gif'), md5('jpg') etc. Dont know any way to handle this and i cant think of why u are hashing the filename.
-
should the value part of the input hidden be in quotes:
value='<?php echo $dateOfArticle; ?>'>
Maybe that is causing the date not to be passed to the other page.
-
Also dont forget to clean the values u get from get or post with addslashes or mysql_real_escape_string:
$id = mysql_real_escape_string($_GET['id']);
-
No the $_FILES superglobal is for file uploads, in this case u must use $_GET. Take this sample code:
$id = $_GET['id']; $query = mysql_query("SELECT * FROM table WHERE id='$id'"); $values = mysql_fetch_array($query); echo $values['name']; echo $values['age'];
When u open 'edit.php?id=5', the id=5 part is a variable 'id' which is assigned the value '5'. U get that id with $_GET and just make a sql query to show the results for that row. Hope u got it now.
Help with my function to make a thumbnail
in PHP Coding Help
Posted
the same about getting the extension but in a different approach
it will print 'jpg'