Jump to content

Oliverkahn

Members
  • Posts

    28
  • Joined

  • Last visited

Oliverkahn's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. i have enable it but no error was reported.. pls help me
  2. hmm...so what do i do? i have allow all permission i also chmode it to 777
  3. i want to implement file importing via url i want any type of file to be imported... the script didn't work pls can you help me review it?
  4. i wrote a script to upload files via url but its not working fine. wen i import the file, it creates the file on the server but refuses to write to it and the file size remains 0.00 byte. below is my code. php <?php //blog.theonlytutorials.com //author: agurchand if($_POST){ //get the url $url = $_POST['url']; //add time to the current filename $name = basename($url); list($txt, $ext) = explode(".", $name); $name = $txt.time(); $name = $name.".".$ext; //check if the files are only image / document if($ext == "jpg" or $ext == "png" or $ext == "gif" or $ext == "doc" or $ext == "docx" or $ext == "pdf" or $ext=="jpeg" or $ext=='apk' or $ext=='jar' or $ext=='mp4' or $ext=='mp3' or $ext=='avi' or $ext=='3gp' or $ext=='exe' or $ext=='zip' or $ext=='tar' or $ext=='jad'){ //here is the actual code to get the file from the url and save it to the uploads folder //get the file from the url using file_get_contents and put it into the folder using file_put_contents $upload = file_put_contents("uploads/$name",file_get_contents($url)); //check success if($upload) echo "Success: <a href='uploads/".$name."' target='_blank'>Check Uploaded</a>"; else "please check your folder permission"; }else{ echo "Please upload only image/document files"; } } ?> html <html> <head><title>Theonlytutorials - Simple File Upload from URL Script!</title></head> <body> <h3>Theonlytutorials.com - Very Simple File Upload from URL Script!</h3> Paste the url and hit enter! <form action="" method="post"> Your URL: <input type="text" name="url" /> </form> </body> </html> [ /code]
  5. i created a file called "general.sql" with the below code and uploaded it to the server....but when i checked the phpmyadmin its still tells me no table created -- phpMyAdmin SQL Dump -- version 3.5.1 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Aug 27, 2012 at 06:25 PM -- Server version: 5.5.24-log -- PHP Version: 5.4.3 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; /*!40101 SET NAMES utf8 */; -- Table structure for table `b_users` -- CREATE TABLE IF NOT EXISTS `users` ( `userID` bigint(21) NOT NULL AUTO_INCREMENT, `username` varchar(60) NOT NULL DEFAULT '', `password` varchar(255) NOT NULL DEFAULT '', `files` varchar(100) , 'wish' varchar(100) , `email` varchar(255) NOT NULL DEFAULT '', `sex` char(7) NOT NULL, 'date' varch(20), 'ban' bigint(21), 'level' bigint(21), PRIMARY KEY ('userID') ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; ---table structure for files-- CREATE TABLE IF NOT EXIST 'files' ( 'fileID' bigint(21) NOT_NULL AUTO_INCREMENT, 'file_name' varchar(50) NOT_NULL, 'description' varchar(200) NOT_NULL, 'comment' varchar(200), 'date' varchar(20) PRIMARY_KEY('fileID') ) ENGINE= MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMEN=1; what do i do pls
  6. what error did you get??
  7. am sure you should chect ur db connection details
  8. that error means your update query is not proper
  9. am not sure your database connection is working well, try this one.... and if its still not working that realy means your db connection has problem <?php $host="localhost"; $user="*****"; $pwd="******"; $dbname="jingleko_reloader"; mysqli_connect($host,$user,$pwd, $dbname); $song = mysql_real_escape_string( $_GET['Song']); $songSafeHtml = htmlspecialchars($ _GET['Song']); if(isset($_GET['Song']) { $Votes=$Votes +1; } mysqli_query(" UPDATE voting SET Votes= $Votes WHERE Song = '$song' "); echo ("You voted for $ songSafeHtml" ); ?>
  10. am sure this will work <?php $host="localhost"; $user="*****"; $pwd="******"; $dbname="jingleko_reloader"; mysqli_connect($host,$user,$pwd, $dbname); or die(mysqli_error()); mysqli_select_db( $dbname); or die(mysqli_error); $song = mysql_real_escape_string( $_GET['Song']); $songSafeHtml = htmlspecialchars($ _GET['Song']); if(isset($_GET['Song']) { $Votes=$Votes +1; } mysqli_query(" UPDATE voting SET Votes= $Votes WHERE Song = '$song' "); echo ("You voted for $ songSafeHtml" ); ?>
  11. do you mean you are an old man??…………how old are you??
  12. then i advice you to start learning programming @w3chools.com
  13. <form name="frm1" method="post" action="#"> <label for="email">change email</ label><input type="email" name=" new_email" value=""> <input type="submit" name="submit " value="change email"> //am sure you understand the html part ……………………………………………………………………php part <?php require_once("connect.php"); //this include your database connection if(isset($_POST['submit'])) //check if the submit button is being clicked //if the submit button is clicked, the following code will run $sql="UPDATE email=$new_email FROM tb_name WHERE username=$ username"; //set a query to select and update the database and store it in a variable called $sql at the left mysql_query($sql); //send the query above to the database echo "email successfully updated "; //print some text out to the browser after updating the database ?>
×
×
  • 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.