Search found 12 matches
- Mon Apr 04, 2011 5:15 am
- Forum: PHP - Code
- Topic: adding folders that are empty to disallowed array
- Replies: 0
- Views: 315
adding folders that are empty to disallowed array
Hi, I am using an array which allows me to prevent particular subfolders from being included in a script that generates an audio playlist. It looks like this: $disallowed=array('..', '.', 'simon', 'steve'); I would like to find a way of disallowing any folders which are empty, or, perhaps, better st...
- Sat Apr 02, 2011 4:09 pm
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Re: string returned by variable not working as it should
I have already tried that. It doesn't work. Somehow, even though $targetFolder is generating the correct string, whether it be '/songs/nick/' or '/songs/nick', it isn't working with the upload script, and php_error.log shows this: Undefined index: name in /Library/WebServer/Documents/uploadify/uploa...
- Sat Apr 02, 2011 3:42 pm
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Re: string returned by variable not working as it should
print $targetfolder returns the correct path, i.e. '/songs/nick' $_SESSION variable is set in log.php: <? session_name("MyLogin"); session_start(); if($_GET['action'] == "login") { $conn = mysql_connect("","",""); // your MySQL connection data $db = ...
- Sat Apr 02, 2011 1:10 pm
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Re: Help needed adding echo to single line of script
Yes, you got it. $_SESSION['name'] gets set in my log.php: <? session_name("MyLogin"); session_start(); if($_GET['action'] == "login") { $conn = mysql_connect("","",""); // your MySQL connection data $db = mysql_select_db(""); //put your da...
- Sat Apr 02, 2011 12:09 pm
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Re: Help needed adding echo to single line of script
sure: <?php session_name("MyLogin"); session_start(); $targetFolder = '/songs/nick'; // Relative to the root if (!empty($_FILES)) { $tempFile = $_FILES['Filedata']['tmp_name']; $targetPath = $_SERVER['DOCUMENT_ROOT'] . $targetFolder; $targetFile = rtrim($targetPath,'/') .'/'. $_FILES['File...
- Sat Apr 02, 2011 11:12 am
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
string returned by variable not working as it should
Hi, I am trying to make some adjustments to uploadify.php which comes with the latest version of uploadify (3.0 beta), so that it works with a session variable that stores the login username and adds it to the path for uploads. Here is uploadify.php as it currently looks: <?php session_name("My...
- Sat Apr 02, 2011 5:57 am
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Re: Help needed adding echo to single line of script
I now have the session variable available to the uploadify.php page, by adding session_name("MyLogin"); above session_start(); Now when I add echo $targetFolder; it returns the correct path: '/songs/nick', but the uploads are still going to the parent directory 'songs'. When I manually ent...
- Thu Mar 31, 2011 4:58 pm
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Re: Help needed adding echo to single line of script
Thanks. I added that line and the uploads are getting added to the directory 'songs', and not the (username) subfolders. I added <?php echo $_SESSION["name"];?> to the top of the main html page to make sure that $_SESSION["name"] is returning the correct string/name, and it is.
- Thu Mar 31, 2011 4:25 pm
- Forum: PHP - Code
- Topic: string returned by variable not working as it should
- Replies: 14
- Views: 657
Help needed adding echo to single line of script
Hi, I am pretty much a new newbie when it comes to PHP, and have a problem that I need to solve, for a website that has to go live tomorrow. Basically I have been using a javascript upload script called 'uploadify' which had an option for the upload folder which was added to the script in the form: ...
- Mon Mar 28, 2011 11:39 am
- Forum: PHP - Code
- Topic: Converting uploaded audio files to mp3 using PHP/ffmpeg
- Replies: 0
- Views: 194
Converting uploaded audio files to mp3 using PHP/ffmpeg
Hi, I have limited experience of using PHP, but having done some searching around it would seem that it is possible to convert audio files that are uploaded through a web page to mp3 using ffmpeg. The audio files would be uploaded using the Uploadify script to subfolders that are named according to ...
- Sun Mar 06, 2011 12:26 pm
- Forum: PHP - Code
- Topic: Need help adding exceptions so that php login page works
- Replies: 2
- Views: 360
Re: Need help adding exceptions so that php login page works
Sorry, here's the code: log.php: <? session_name("MyLogin"); session_start(); if($_GET['action'] == "login") { $conn = mysql_connect("localhost","user","password"); // your MySQL connection data $db = mysql_select_db("DATABASENAME"); //put ...
- Thu Mar 03, 2011 4:23 pm
- Forum: PHP - Code
- Topic: Need help adding exceptions so that php login page works
- Replies: 2
- Views: 360
Need help adding exceptions so that php login page works
Hi, I am a php newbie, who has a page that relies on some php scripts, and to which I am trying to add a login page written in php. I took the example from here: http://www.howtodothings.com/computers-internet/how-to-make-a-login-system-for-your-website Basically it consists of adding: <? require(&q...