Jump to content

bruckerrlb

Members
  • Posts

    155
  • Joined

  • Last visited

    Never

Everything posted by bruckerrlb

  1. Looks good, thanks! I'll test it out and let you know what it comes out to be
  2. but this can be done effectively with php correct? The thing is I know php, but pearl, not so much
  3. well I"m more or less talking about creating a search engine, like google, but not nearly as gigantic, that can support strong boolean searches for the web, with heavy emphesis on specific websites where users are more than likely going to find the info they are looking for.
  4. Hi everyone, I checked the tutorials, but couldn't find anything, so I'm wondering if anyone knows any articles on where to get started with meta searching, I'm trying to create my own search engine focused on something very specific. Thanks
  5. Maybe someone can help me with this, or at least point me in the right direction. I am a semi-mature, and struggle with all things that have to do with php and mail. Could someone tell me what needs to be done? I understand if this is too much to ask, but I am just really curious about this because I haven't struggled with something like this, this long. Thanks
  6. Thanks, I checked out the link and tried to get it working, but it's really complicated, and I"m not sure if I need to build my own form to use that, and if so, will I be declaring the variables it uses in that file. It comes with three files, but no instructions and the demo's it provides are for something a bit different than I'm trying to do, which is just simply a user uploads a file and it gets sent with the rest of the form information. I appreciate the link, if you have any more, or any other suggestions on how I can do this, I would really appreciate it.
  7. Hello, I have a simple php mail form, which sends when the person fills out the form, but I need for them to be able to upload an attachment and that attachment gets sent to the person as well as the form info. The following code I have <?php $description = $_POST['description']; $requirements = $_POST['requirements']; $location = $_POST['location']; $salary = $_POST['salary']; $priority = $_POST['priority']; $agreement = $_POST['agreement']; $screen1 = $_POST['screen1']; $screen2 = $_POST['screen2']; $screen3 = $_POST['screen3']; $screen4 = $_POST['screen4']; //Save visitor name and entered message into one variable: $formcontent="Description: $description \n\n Requirements: $requirements \n\n Location: $location \n\n Salary: $salary \n\n Priority: $priority \n\n Agreement in Place: $agreement \n\n Screening question 1: $screen1 \n\n Screening question 2: $screen2 \n\n Screening question 3: $screen3 \n\n Screening question 4: $screen4"; $recipient = "my@email.com"; $subject = "Partner Submit"; $mailheader = "From: him\r\n"; $mailheader .= "Reply-To: noreply\r\n"; $mailheader .= "MIME-Version: 1.0\r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Failure"); ?> So I have a couple questions maybe you guys can help me out with, where would I put the attachment, as well as is there anyway I get get the attachment to send without it being stored on our server? How should I go about doing this? I have tried to have an upload form, and tried to attach that uploaded file to get sent, but it breaks the entire file. Any help much appreciated! Thanks!
  8. Thanks for the tip, that's how I got my code in the first place, and I thought I was going in the right direction by using what you mentioned.
  9. Hello All, I am working on a script here. What happens is someone uploads their resume. This works fine, their resume gets uploaded. Now what I"m trying to do is, once it gets uploaded, it automatically gets emailed to someone. I am having problems with this, and I'm not sure if it's a flawed code, or where I have my code. //I have the code in the if statement that makes sure the file is uploaded if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "Your resume ". basename( $_FILES['uploadedfile']['name']). " has been uploaded! Thank you."; //start mail script $to = "me <my@email.com>"; $from = "Resume Submission <john.smith@domain.com>"; $subject = "Resume from US"; $fileatt = "basename( $_FILES['uploadedfile']['name'])"; $fileatttype = "application/msword"; $fileattname = "Resume"; $headers = "From: $from"; $file = fopen( $fileatt, 'rb' ); $data = fread( $file, filesize( $fileatt ) ); fclose( $file ); $semi_rand = md5( time() ); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; $data = chunk_split( base64_encode( $data ) ); $message .= "--{$mime_boundary}\n" . "Content-Type: {$fileatttype};\n" . " name=\"{$fileattname}\"\n" . "Content-Disposition: attachment;\n" . " filename=\"{$fileattname}\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n" . "--{$mime_boundary}--\n"; if( mail( $to, $subject, $message, $headers ) ) { echo "<p>The email was sent.</p>"; } else { echo "<p>There was an error sending the mail.</p>"; } } //end send email } else { echo "Sorry, there was a problem uploading your resume."; } If anyone has any suggestions it would be much appreciated!
  10. If anyone has a good link to help get my foot in the door, it would be appreciated. Thanks
  11. Hello All, I have a simple email form, written in php. What I want to do is have the person filling out the form be able to send a word file. I know how to do the file upload, but I'm not sure how to get that file to be sent as an attachment. Does anyone have any suggestions? Thanks
  12. hello, Hello all, I am trying to set something up where, when someone clicks on a link, the link goes to my contact page, and the subject in the contact form is already the subject of that page. Let me give an example. When someone goes to the "cell phone info" page, and they click on the link that says request more information, the contact page comes up with "more info about cell phones" in the subject line. Does anyone have any suggestions? Thanks
  13. FYI I figured this out, see code below for explanation $uploadfile = $_FILES['Filedata']['name']; where filedata is, it has to be the name on the form uploader, I was using userfile, which is the <i>example</i> on the php site!
  14. Hello all, I have been wracking my brains with this for a while now, I am uploading a file, the file uploads, then it writes to a database, that is all good, but one of my fields in the database is the path. I am trying to get the name of the file inserted into the database, and now it's not going in, nothing is going in the path field, only the primary id, and another field I have set up. <?php error_reporting(1); $filepath = getcwd()."/files/"; //This is what I thought was correct, how to get the name of the file, but it's not showing up in my //database. $uploadfile = $filepath . basename($_FILES['userfile']['name']); if(!file_exists($filepath)) { mkdir($filepath,0777); } chmod($filepath,0777); if(move_uploaded_file($_FILES['Filedata']['tmp_name'], $filepath.$_FILES['Filedata']['name'])){ chmod($filepath.$_FILES['Filedata']['name'], 0777); $link = mysql_connect("localhost","a username","a password"); if(!$link) { die('Failed to connect to server: ' . mysql_error()); } //Select database $db = mysql_select_db("thedb"); if(!$db) { die("Unable to select db"); } $query = "INSERT INTO video (id, path, page) VALUES (0, '$uploadfile', 'livevideo')"; if (@mysql_query ($query)) { print 'Successfully Added!'; } mysql_close(); } ?> So the following code returns me the entire path minus the name of the file, just the path to the folder that the file is in, and when I use the following as my variable, it returns nothing $uploadfile = $_FILES['userfile']['name']; I was reading the php site, and the first way is how they have there code set up, but it doesn't seem to be working for me, or they are trying to do something different, does anyone have any tips?
  15. Hello all, thanks for your help, I think the problem was my file db_connect. I finally just decided to put the connection in the actual file without any includes. The reason for this is, it's on a backend, the uploader cannot be accessed unless the user is signed in and then they can use it. So thanks for everything!
  16. Thanks for the advice, I tried it, but didn't get anything, not even any errors, it just never showed up in the database and the file didn't show up on the server. Now the file is not showing up at all, does anyone think it could be because of limitations in php.ini?
  17. I took your advice, and just decided to put the connect in the same folder, but I'm still having problems, it's still not loading in the database
  18. What I mean is, if I don't add it in there, than I imagine I will just get more errors. I am kind of doing this blindly, because when I upload, the flash uploader just tells me that it's been uploaded.
  19. yep, ID is my primary key, but if I take out the ID, than won't that cause problems?
  20. yep, $uploadedfile is the path to the file
  21. Hello! I am trying to modify a script here, an old script, what happens is, there is a flash uploader, and this flash uploader uploads a video, when the video is complete, it runs a script. I am trying to modify this script, so that when it adds the video, it not only adds the video into the specific folder, but also adds this record in the database (to be able to call the video path back on the front end). I cannot seem to figure out what I am doing wrong though! Below is my code with comments to try and explain my theory <?php $uploaddir = dirname($_SERVER['SCRIPT_FILENAME'])."/UploadedFiles/"; $target_encoding = "ISO-8859-1"; echo '<pre>'; if(count($_FILES) > 0) { $arrfile = pos($_FILES); $uploadfile = $uploaddir . iconv("UTF-8", $target_encoding,basename($arrfile['name'])); //the below part is to test to make sure that the file is a .swf and to make sure it was uploaded if ((move_uploaded_file($arrfile['tmp_name'], $uploadfile)) && ($_FILES["file"]["type"] == "application/x-shockwave-flash")) { //get my database connection include('/../../../../includes/db_connect.php'); //insert it into the database $query = "INSERT INTO video (id, path, page) VALUES (0, '$uploadfile' , 'livevideo')"; if (@mysql_query ($query)) { print 'Successfully Added!'; } } mysql_close(); } } ?> Any help is much appreciated!
  22. Awesome, that worked, thank you so much, I was reading the php website, and all I could find was a way to get to the root folder, but I was just trying to move down one, that works, thanks again!
  23. Hello, I have a simple question, but it's been driving me crazy. I am trying to use the php include statement to go down one folder in my directory. I've tried both of the following codes, but I always get errors <?php include(".../toolbar.php"); ?> Or <?php include('.../toolbar.php'); ?> Or <?php include(".../admin/toolbar.php"); ?> Or <?php include('.../admin/toolbar.php'); ?> Basically I've got a subfolder in the admin directory and I'm trying to get to my toolbar in the admin folder, which is one folder down, but I can't seem to get in there with php include, does anyone know what "m doing wrong?
×
×
  • 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.