Jump to content

pjc2003

Members
  • Posts

    27
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pjc2003's Achievements

Member

Member (2/5)

0

Reputation

  1. hi there, im looking for a script that will upload an mp3 file to server and update an xml playlist.. Ive come accross this script but it doesnt work and no error messages are displayed just does nothing.. http://www.phpfreaks.com/forums/index.php/topic,129643.0.html Can anyone tell me where there may be a working script I could use Cheers.
  2. on line 20 i thought it was missing a " if (($HTTP_POST_FILES['userfile']['type']=="audio/mp3")")) { so ive changed it to : if ("($HTTP_POST_FILES['userfile']['type']=="audio/mp3")")) { but it now comes up with: Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/home/longnines/public_html/fyp/upload.php on line 20 Im quite new to PHP so just after some guidance not people to do work for me. Thanks.
  3. hi there, Ive created the uploads folder but its throwing up a syntax error Parse error: syntax error, unexpected '"' in upload.php on line 20 any ideas? thanks for your reply by the way its much appreciated, Pjc.
  4. hi, Im trying to design a webpage form in php that allows uploading of three mp3 files to a folder on my server. The webpage should convert the name of each mp3 file uploaded to 1.mp3 , 2.mp3 and 3.mp3 and whenever a new song is uploaded it should replace whatevers in the folder on the server, im totally stuck as where to begin.. Any help would be great, Many thanks, Pete.
  5. hi ive recently changed hosting provider and need to update my settings in my local file, Im using the pear db object factory and used to call it in via require_once 'DB/DataObject.php'; my new hosting provider has given me the following paths they use.. Just wondering which one will contain the pear files? [php_dir] => /usr/local/lib/php [ext_dir] => /usr/local/lib/php/extensions/no-debug-non-zts-20020429 [doc_dir] => /usr/local/lib/php/doc [bin_dir] => /usr/local/bin [data_dir] => /usr/local/lib/php/data [test_dir] => /usr/local/lib/php/test [php_bin] => /usr/local/bin/php if anyone could help that would be great. Pete.
  6. hey, I need to use some files that are in the pear dataobject factory package. Im just wondering if I can manually download the files and put them on my hosting space? the pear website goes on about installing the package but when I try the method to install via a web browser is doesnt even work! anyone with experience installing this particular pear package some advice would be much appriciated... Cheers, Jeff.
  7. hey im building a website using the pear dataobject factory and im having a problem connecting to my database.. Im getting the following error when i go to my admin area.. dataobjects_classes: find: dataobjects_classes: CONNECT: Checking for database database_ in options dataobjects_classes: CONNECT: NEW CONNECTION dataobjects_classes: CONNECT: mysql://longnines:xxxxxx@localhost/longnines 9f43fb47a730f4d0c5fd0d75c05b2c31 dataobjects_classes: CONNECT: a:1:{s:32:"9f43fb47a730f4d0c5fd0d75c05b2c31";O:8:"db_error":8:{s:20:"error_message_prefix";s:0:"";s:4:"mode";i:1;s:5:"level";i:1024;s:4:"code";i:-4;s:7:"message";s:19:"DB Error: not found";s:8:"userinfo";s:90:"Unable to include the DB/mysql.php file for 'mysql://longnines:xxxxxx@localhost/longnines'";s:9:"backtrace";a:7:{i:0;a:6:{s:4:"file";s:45:"/usr/home/longnines/public_html/fyp/DB/DB.php";s:4:"line";i:966;s:8:"function";s:10:"pear_error";s:5:"class";s:8:"db_error";s:4:"type";s:2:"->";s:4:"args";a:5:{i:0;s:19:"DB Error: not found";i:1;i:-4;i:2;i:1;i:3;i:1024;i:4;s:90:"Unable to include the DB/mysql.php file for 'mysql://longnines:xxxxxx@localhost/longnines'";}}i:1;a:6:{s:4:"file";s:27:"/usr/local/lib/php/PEAR.php";s:4:"line";i:563;s:8:"function";s:8:"db_error";s:5:"class";s:8:"db_error";s:4:"type";s:2:"->";s:4:"args";a:4:{i:0;i:-4;i:1;i:1;i:2;i:1024;i:3;s:90:"Unable to include the DB/mysql.php file for 'mysql://longnines:xxxxxx@localhost/longnines'";}}i:2;a:6:{s:4:"file";s:45:"/usr/home/longnines/public_html/fyp/DB/DB.php";s:4:"line";i:543;s:8:"function";s:10:"raiseerror";s:5:"class";s:4:"pear";s:4:"type";s:2:"::";s:4:"args";a:7:{i:0;N;i:1;i:-4;i:2;N;i:3;N;i:4;s:90:"Unable to include the DB/mysql.php file for 'mysql://longnines:xxxxxx@localhost/longnines'";i:5;s:8:"DB_Error";i:6;b:1;}}i:3;a:6:{s:4:"file";s:53:"/usr/home/longnines/public_html/fyp/DB/DataObject.php";s:4:"line";i:2223;s:8:"function";s:7:"connect";s:5:"class";s:2:"db";s:4:"type";s:2:"::";s:4:"args";a:1:{i:0;s:44:"mysql://longnines:xxxxxx@localhost/longnines";}}i:4;a:6:{s:4:"file";s:53:"/usr/home/longnines/public_html/fyp/DB/DataObject.php";s:4:"line";i:1870;s:8:"function";s:8:"_connect";s:5:"class";s:19:"dataobjects_classes";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:5;a:6:{s:4:"file";s:53:"/usr/home/longnines/public_html/fyp/DB/DataObject.php";s:4:"line";i:411;s:8:"function";s:5:"table";s:5:"class";s:19:"dataobjects_classes";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:6;a:6:{s:4:"file";s:53:"/usr/home/longnines/public_html/fyp/admin/product.php";s:4:"line";i:111;s:8:"function";s:4:"find";s:5:"class";s:19:"dataobjects_classes";s:4:"type";s:2:"->";s:4:"args";a:0:{}}}s:8:"callback";N;}} dataobjects_classes: CONNECT FAILED: [db_error: message=DB Error: not found" code=-4 mode=return level=notice prefix="" info="Unable to include the DB/mysql.php file for 'mysql://longnines:xxxxxx@localhost/longnines'] dataobjects_classes: ERROR: Connect failed, turn on debugging to 5 see why DB_DataObject Error: Connect failed, turn on debugging to 5 see why Any help would be great Thanks, Jeffrey.
  8. hey im building a website using the pear dataobject factory and im trying to get my admin area working but its comming up with the following error: I have replaced my username and password for database for security reasons... dataobjects_classes: find: dataobjects_classes: CONNECT: Checking for database database_ in options dataobjects_classes: CONNECT: NEW CONNECTION dataobjects_classes: CONNECT: mysql://username:xxxxxx@localhost/username 9f43fb47a730f4d0c5fd0d75c05b2c31 dataobjects_classes: CONNECT: a:1:{s:32:"9f43fb47a730f4d0c5fd0d75c05b2c31";O:8:"db_error":8:{s:20:"error_message_prefix";s:0:"";s:4:"mode";i:1;s:5:"level";i:1024;s:4:"code";i:-4;s:7:"message";s:19:"DB Error: not found";s:8:"userinfo";s:90:"Unable to include the DB/mysql.php file for 'mysql://username:xxxxxx@localhost/username'";s:9:"backtrace";a:7:{i:0;a:6:{s:4:"file";s:45:"/usr/home/username/public_html/fyp/DB/DB.php";s:4:"line";i:966;s:8:"function";s:10:"pear_error";s:5:"class";s:8:"db_error";s:4:"type";s:2:"->";s:4:"args";a:5:{i:0;s:19:"DB Error: not found";i:1;i:-4;i:2;i:1;i:3;i:1024;i:4;s:90:"Unable to include the DB/mysql.php file for 'mysql://username:xxxxxx@localhost/username'";}}i:1;a:6:{s:4:"file";s:27:"/usr/local/lib/php/PEAR.php";s:4:"line";i:563;s:8:"function";s:8:"db_error";s:5:"class";s:8:"db_error";s:4:"type";s:2:"->";s:4:"args";a:4:{i:0;i:-4;i:1;i:1;i:2;i:1024;i:3;s:90:"Unable to include the DB/mysql.php file for 'mysql://username:xxxxxx@localhost/username'";}}i:2;a:6:{s:4:"file";s:45:"/usr/home/username/public_html/fyp/DB/DB.php";s:4:"line";i:543;s:8:"function";s:10:"raiseerror";s:5:"class";s:4:"pear";s:4:"type";s:2:"::";s:4:"args";a:7:{i:0;N;i:1;i:-4;i:2;N;i:3;N;i:4;s:90:"Unable to include the DB/mysql.php file for 'mysql://username:xxxxxx@localhost/username'";i:5;s:8:"DB_Error";i:6;b:1;}}i:3;a:6:{s:4:"file";s:53:"/usr/home/username/public_html/fyp/DB/DataObject.php";s:4:"line";i:2223;s:8:"function";s:7:"connect";s:5:"class";s:2:"db";s:4:"type";s:2:"::";s:4:"args";a:1:{i:0;s:44:"mysql://username:xxxxxx@localhost/username";}}i:4;a:6:{s:4:"file";s:53:"/usr/home/username/public_html/fyp/DB/DataObject.php";s:4:"line";i:1870;s:8:"function";s:8:"_connect";s:5:"class";s:19:"dataobjects_classes";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:5;a:6:{s:4:"file";s:53:"/usr/home/username/public_html/fyp/DB/DataObject.php";s:4:"line";i:411;s:8:"function";s:5:"table";s:5:"class";s:19:"dataobjects_classes";s:4:"type";s:2:"->";s:4:"args";a:0:{}}i:6;a:6:{s:4:"file";s:53:"/usr/home/username/public_html/fyp/admin/product.php";s:4:"line";i:111;s:8:"function";s:4:"find";s:5:"class";s:19:"dataobjects_classes";s:4:"type";s:2:"->";s:4:"args";a:0:{}}}s:8:"callback";N;}} dataobjects_classes: CONNECT FAILED: [db_error: message=DB Error: not found" code=-4 mode=return level=notice prefix="" info="Unable to include the DB/mysql.php file for 'mysql://username:xxxxxx@localhost/username'] dataobjects_classes: ERROR: Connect failed, turn on debugging to 5 see why Warning: raiseerror(DB/DataObject/Error.php) [function.raiseerror]: failed to open stream: No such file or directory in /usr/home/username/public_html/fyp/DB/DataObject.php on line 4007 Fatal error: raiseerror() [function.require]: Failed opening required 'DB/DataObject/Error.php' (include_path='.:/usr/local/lib/php') in /usr/home/username/public_html/fyp/DB/DataObject.php on line 4007 Ive been told it has something to do with the location of the files in the folders but im sure I have put everything in the right place! ive double checked all day and still getting this cheers people. Jeff.
  9. hey, ive just moved my website to another server and am trying to set up my local.php page to connect to my database etc.. but having the following errors returned when i try to access my website.. Warning: main(DB/DataObject.php) [function.main]: failed to open stream: No such file or directory in /usr/home/mywebsite/public_html/fyp/local.php on line 4 Fatal error: main() [function.require]: Failed opening required 'DB/DataObject.php' (include_path='.:/usr/local/lib/php') in /usr/home/mywebsite/public_html/fyp/local.php on line 4 $options = array( 'database' => 'mysql://user:passwrd@localhost/mywebsite', 'schema_location' => '/home/mywebsite/public_html/fyp/DataObjects', 'class_location' => '/home/mywebsite/public_html/fyp/DataObjects', 'require_prefix' => 'DataObjects/', 'class_prefix' => 'DataObjects_', ); all folders seem to be in the right location on the server so im a bit confused! Thanks, Pjc.
  10. hi ive got a select box that gives a value to variable $location_id <select name="location_id">       <option =1 <?php if ($location_id = 1) echo ' selected '?> >Location A</option>       <option =2 <?php if ($location_id = 2) echo ' selected '?> >Location B</option>       <option =3 <?php if ($location_id  = 3) echo ' selected '?> >Location C</option>       <option =4 <?php if ($location_id  = 4) echo ' selected '?> >Location D</option> </select> Ok what i want to do is have the select box display the option "location x" etc ... all the way from A - Z which I can do fine  BUT  I want the location_id variable to hold its corresponding number! But no matter what I try the variable stores the value of what is actually displayed in the select box... Please help me! pj
  11. hi there, i want to create a loop that changes the value of a variable based on the value of another variable i.e if{ $variable_one = "A" then $variable_two ="1" } etc but i want it for 26 options so it can deal with all 26 possible values of variable 1? Just a bit stuck on how to write the code? Many thanks. Peter.
  12. hi ive created a page that allows a user to select a value for variable "$location_name" from a select box, I wish to put some code in that assigns a value to another variable "$location_id" based on whatever value is currently given to "$location_name".. Is it possible to do it with an if or while loop? here is my code so far: <?php require('./header.php'); require('./dbconn.php'); //Gets the variables part number and location id from previous page where they were POSTED... $part_number = $_GET['part_number']; $action = 'show_form'; if(!empty($_POST)) { $action= 'process_data'; } if($action== 'process_data')  { $part_number = $_POST['part_number']; $location_id = trim($_POST['location_id']);      ------- how can i get this to equal number based on what location_name equals??        $location_name = trim($_POST['location']); $valid = intval(trim($_POST['valid'])); $sql= "UPDATE stockdata set location = '$location_name', location_id = '$location_id', valid = '$valid' WHERE  part_number= '$part_number'  "; $ok= mysql_query($sql) or die(mysql_error()); if($ok){ echo "<p class='ErrorText'>Update OK!</p>"; } else { echo "<p class ='ErrorText'>Update Failed!</p>"; } } else { $action = 'show_form'; } echo $sql;    //end running database query if($action == 'show_form')  { ?> <form method="post" action="stock_control.php"> <input type="hidden" name="part_number" value="<?=$part_number?>" /> <input type="hidden" name="location_id" value="<?=$location_id?>" />   <p class ='MainText'>   Change Location -       <select name="location">       <option =1 <?php if ($location_name ="A") echo ' selected '?> >A</option>       <option =2 <?php if ($location_name ="B") echo ' selected '?> >B</option>   <option =3 <?php if ($location_name ="C") echo ' selected '?> >C</option>       <option =4 <?php if ($location_name ="D") echo ' selected '?> >D</option>   <option =5 <?php if ($location_name ="E") echo ' selected '?> >E</option>       <option =6 <?php if ($location_name ="F") echo ' selected '?> >F</option>   <option =7 <?php if ($location_name ="G") echo ' selected '?> >G</option>       <option =8 <?php if ($location_name ="H") echo ' selected '?> >H</option>   <option =9 <?php if ($location_name ="I") echo ' selected '?> >I</option>       <option =10 <?php if ($location_name ="J") echo ' selected '?> >J</option>   <option =11 <?php if ($location_name ="K") echo ' selected '?> >K</option>       <option =12 <?php if ($location_name ="L") echo ' selected '?> >L</option>   <option =13 <?php if ($location_name ="M") echo ' selected '?> >M</option>       <option =14 <?php if ($location_name ="N") echo ' selected '?> >N</option>   <option =15 <?php if ($location_name ="O") echo ' selected '?> >O</option>       <option =16 <?php if ($location_name ="P") echo ' selected '?> >P</option>   <option =17 <?php if ($location_name ="Q") echo ' selected '?> >Q</option>       <option =18 <?php if ($location_name ="R") echo ' selected '?> >R</option>   <option =19 <?php if ($location_name ="S") echo ' selected '?> >S</option>       <option =20 <?php if ($location_name ="T") echo ' selected '?> >T</option>   <option =21 <?php if ($location_name ="U") echo ' selected '?> >U</option>       <option =22 <?php if ($location_name ="V") echo ' selected '?> >V</option>   <option =23 <?php if ($location_name ="W") echo ' selected '?> >W</option>       <option =24 <?php if ($location_name ="X") echo ' selected '?> >X</option>   <option =25 <?php if ($location_name ="Y") echo ' selected '?> >Y</option>       <option =26 <?php if ($location_name ="Z") echo ' selected '?> >Z</option>     </select> </p>   <p class ='MainText'>     Change Validity-       <select name="valid">       <option =1 <?php if ($valid =0) echo ' selected '?> > 0</option>       <option =2 <?php if ($valid =1) echo ' selected '?> > 1</option>     </select> </p>   <input type="submit" value="save"/>   </p> </form>  <?php } require('./footer.php'); ?> many thanks, pete.
  13. hi ive got this page and i want to assign a number to variable "location_id" , It needs to be some kind of if loop that makes "location_id" equal to "1" if the location name equals "A"... I have my location names available to be selectd by a drop down box.. heres my code.. <?php require('./header.php'); require('./dbconn.php'); //Gets the variables part number and location id from previous page where they were POSTED... $part_number = $_GET['part_number']; $action = 'show_form'; if(!empty($_POST)) { $action= 'process_data'; } if($action== 'process_data')  { $part_number = $_POST['part_number']; $location_id = trim($_POST['location_id']);      ------- how can i get this to equal number based on what location_name equals??        $location_name = trim($_POST['location']); $valid = intval(trim($_POST['valid'])); $sql= "UPDATE stockdata set location = '$location_name', location_id = '$location_id', valid = '$valid' WHERE  part_number= '$part_number'  "; $ok= mysql_query($sql) or die(mysql_error()); if($ok){ echo "<p class='ErrorText'>Update OK!</p>"; } else { echo "<p class ='ErrorText'>Update Failed!</p>"; } } else { $action = 'show_form'; } echo $sql;    //end running database query if($action == 'show_form')  { ?> <form method="post" action="stock_control.php"> <input type="hidden" name="part_number" value="<?=$part_number?>" /> <input type="hidden" name="location_id" value="<?=$location_id?>" />   <p class ='MainText'>   Change Location -       <select name="location">       <option =1 <?php if ($location_name ="A") echo ' selected '?> >A</option>       <option =2 <?php if ($location_name ="B") echo ' selected '?> >B</option>   <option =3 <?php if ($location_name ="C") echo ' selected '?> >C</option>       <option =4 <?php if ($location_name ="D") echo ' selected '?> >D</option>   <option =5 <?php if ($location_name ="E") echo ' selected '?> >E</option>       <option =6 <?php if ($location_name ="F") echo ' selected '?> >F</option>   <option =7 <?php if ($location_name ="G") echo ' selected '?> >G</option>       <option =8 <?php if ($location_name ="H") echo ' selected '?> >H</option>   <option =9 <?php if ($location_name ="I") echo ' selected '?> >I</option>       <option =10 <?php if ($location_name ="J") echo ' selected '?> >J</option>   <option =11 <?php if ($location_name ="K") echo ' selected '?> >K</option>       <option =12 <?php if ($location_name ="L") echo ' selected '?> >L</option>   <option =13 <?php if ($location_name ="M") echo ' selected '?> >M</option>       <option =14 <?php if ($location_name ="N") echo ' selected '?> >N</option>   <option =15 <?php if ($location_name ="O") echo ' selected '?> >O</option>       <option =16 <?php if ($location_name ="P") echo ' selected '?> >P</option>   <option =17 <?php if ($location_name ="Q") echo ' selected '?> >Q</option>       <option =18 <?php if ($location_name ="R") echo ' selected '?> >R</option>   <option =19 <?php if ($location_name ="S") echo ' selected '?> >S</option>       <option =20 <?php if ($location_name ="T") echo ' selected '?> >T</option>   <option =21 <?php if ($location_name ="U") echo ' selected '?> >U</option>       <option =22 <?php if ($location_name ="V") echo ' selected '?> >V</option>   <option =23 <?php if ($location_name ="W") echo ' selected '?> >W</option>       <option =24 <?php if ($location_name ="X") echo ' selected '?> >X</option>   <option =25 <?php if ($location_name ="Y") echo ' selected '?> >Y</option>       <option =26 <?php if ($location_name ="Z") echo ' selected '?> >Z</option>     </select> </p>   <p class ='MainText'>     Change Validity-       <select name="valid">       <option =1 <?php if ($valid =0) echo ' selected '?> > 0</option>       <option =2 <?php if ($valid =1) echo ' selected '?> > 1</option>     </select> </p>   <input type="submit" value="save"/>   </p> </form>  <?php } require('./footer.php'); ?> many thanks, pete.
  14. Hi ive created this page stock_control but i cant seem to get the SQL to pick up the value of a variable part_number that I have used the GET function to bring in from previous page.. the error im getting is: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '( location , valid) VALUES ('G', '0' ) WHERE part_number='0000 below is my code: <?php require('./header.php'); require('./dbconn.php'); $part_number = $_GET['part_number']; $action = 'show_form'; if(!empty($_POST)) { $action= 'process_data'; } if($action== 'process_data')  { $part_number = $_POST['part_number']; $location_name = trim($_POST['location']); $valid = intval(trim($_POST['valid'])); $sql= "UPDATE stockdata ( location , valid)  " . "VALUES ('$location_name', '$valid' ) WHERE  part_number='$part_number' "; $ok= mysql_query($sql) or die(mysql_error()); if($ok){ echo "<p class='ErrorText'>Update OK!</p>"; } else { echo "<p class ='ErrorText'>Update Failed!</p>"; } } else { $action = 'show_form'; } echo $sql;    //end running database query if($action == 'show_form')  { ?> <form method="post" action="stock_control.php"> <input type="hidden" name="part_number" value="<?=$part_number?>" />   <p class ='MainText'>   Change Location -       <select name="location">       <option =1 <?php if ($location_name ="A") echo ' selected '?> >A</option>       <option =2 <?php if ($location_name ="B") echo ' selected '?> >B</option>   <option =3 <?php if ($location_name ="C") echo ' selected '?> >C</option>       <option =4 <?php if ($location_name ="D") echo ' selected '?> >D</option>   <option =5 <?php if ($location_name ="E") echo ' selected '?> >E</option>       <option =6 <?php if ($location_name ="F") echo ' selected '?> >F</option>   <option =7 <?php if ($location_name ="G") echo ' selected '?> >G</option>       <option =8 <?php if ($location_name ="H") echo ' selected '?> >H</option>   <option =9 <?php if ($location_name ="I") echo ' selected '?> >I</option>       <option =10 <?php if ($location_name ="J") echo ' selected '?> >J</option>   <option =11 <?php if ($location_name ="K") echo ' selected '?> >K</option>       <option =12 <?php if ($location_name ="L") echo ' selected '?> >L</option>   <option =13 <?php if ($location_name ="M") echo ' selected '?> >M</option>       <option =14 <?php if ($location_name ="N") echo ' selected '?> >N</option>   <option =15 <?php if ($location_name ="O") echo ' selected '?> >O</option>       <option =16 <?php if ($location_name ="P") echo ' selected '?> >P</option>   <option =17 <?php if ($location_name ="Q") echo ' selected '?> >Q</option>       <option =18 <?php if ($location_name ="R") echo ' selected '?> >R</option>   <option =19 <?php if ($location_name ="S") echo ' selected '?> >S</option>       <option =20 <?php if ($location_name ="T") echo ' selected '?> >T</option>   <option =21 <?php if ($location_name ="U") echo ' selected '?> >U</option>       <option =22 <?php if ($location_name ="V") echo ' selected '?> >V</option>   <option =23 <?php if ($location_name ="W") echo ' selected '?> >W</option>       <option =24 <?php if ($location_name ="X") echo ' selected '?> >X</option>   <option =25 <?php if ($location_name ="Y") echo ' selected '?> >Y</option>       <option =26 <?php if ($location_name ="Z") echo ' selected '?> >Z</option>     </select> </p>   <p class ='MainText'>     Change Validity-       <select name="valid">       <option =1 <?php if ($valid =0) echo ' selected '?> > 0</option>       <option =2 <?php if ($valid =1) echo ' selected '?> > 1</option>     </select> </p>   <input type="submit" value="save"/>   </p> </form>  <?php } require('./footer.php'); ?> Any ideas would be great..
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.