Jump to content

TGWSE_GY

Members
  • Posts

    255
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TGWSE_GY's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Well I have it down to one problem and that is firebug is returning "$ not defined" not sure what this means and can't really find anything in searching online. Thanks for the help in advance.
  2. So I am trying to code a drop down using -> http://jquery-ui.googlecode.com/svn/branches/labs/selectmenu/index.html?noheader I have successfully gotten the style applied to the dropdown list however when you click on it it is not dropping down the list. Hopefully someone can tell me where I am going wrong because I have just started using JQuery recently to add to my arsenal of web development tricks. Link to what I am working on here -> http://visualrealityink.com/dev/clients/rug_src/scratchbox%20v2/frontend/inc/leftnavi/left_nav.php# Thanks for your help in advance
  3. http://visualrealityink.com/dev/clients/ar/parents/ so now I am trying to get the green dot to move with the images in the screen however when I use the same nextId and prevId for both slider and slider2 neither one will scroll. Any help would be great! Thanks
  4. Ok So this is what I have so far, http://visualrealityink.com/dev/clients/ar/parents/ the code is in here for easy slider however the buttons are no longer working. All I did was change their position so they were on either side of the phone. Thanks in advance.
  5. I am wanting to take an image of a cellphone cutout the screen and have images scroll where the screen is at. Also there is a left and right button that I am wanting to use to control to progression of the images. There is also bullet-esque images that have to rotate as the image rotates, here is a link to and image of what I am wanting to achieve. Thanks in advance for the help!
  6. sasa thank you so much as usuall your advice and code are flawless!
  7. So I have an interesting one for you guys this AM, I first want to make it very clear that I am not scraping code, rather I am scraping data that is needed to import into a shopping cart system for someone. I have a URL that I am trying to scrape required data off of, however it is not returning all the data that I want. I have created a function that uses preg_match_all() and regex and I am still having issues striping what I want. here is a link to my test what I am wanting to strip from http://visualrealityink.com/dev/clients/rug_src/scrapeing/Rugsource/www.vendio.com/stores/Rugsource1/item/other/tribal-wool-3x5-shiraz-persian/lid=10363581.html I am wanting to grab all this data: Here is the code note that $url holds the link above. $html = file_get_contents($url); $newlines = array("\t","\n","\r","\x20\x20","\0","\x0B"); $html = str_replace($newlinews, "", html_entity_decode($html)); preg_match_all('/<tr><td width="50%" align="right"><font color="#800000"><b>[^\s ](.*?)<\/b><\/font><\/td><td width="50%" align="left">[^\s ](.*?)<\/td><\/tr>/', $html, $matches, PREG_SET_ORDER); foreach($matches_label as $match){ $count = 0; echo $match[$count]; echo "<br>"; $count++; } echo $count; This returns the following it is missing: You can see the script in action here -> http://visualrealityink.com/dev/clients/rug_src/scrapeing/scrape_tst.php Thanks in advance for all of your help
  8. Ok for security and other purposes I went to just phpMailer! its more friendly as far as attachments go plus more secure I think Thanks for all the help guys!!!!!!
  9. when I do mail( $to, $subject, $body, $headers ); the message is never sent, this is per the instructions however when I run mail( $to, $subject, $headers, $body ); the email is sent but the body of the message is blank. Seems to be an odd trade off either the attachment gets delivered with no body text, or the email doesn't get delivered at all. Anyone ever had similar issues? Or know what could be causing it to go haywhire? Thanks again
  10. Am I not putting the headers together right, or the message? Or is it the way its being sent to mail()? Any help would be greatly appreciated. Thanks again
  11. Yes $message and $content are both called right before $image=........ I set $message = ""; and $content =""; I am so confused at this point, doesn't make much sense that the body isn't getting delivered along with the message.
  12. Everything about the email is sending except the message text does anyone know what the issue could be? here is the block of code that sends the email Thanks in advance $image = "http://www.visualrealityink.com/dev/clients/arzan/snell_form/images/email.png"; echo "got to process form"; $target_path = "upload/"; $path = $target_path = $target_path . basename( $_FILES['file']['name']); $boundary = '-----=' . md5( uniqid ( rand() ) ); $message .= "Content-Type: application/msword; name=\"my attachment\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment; filename=\"$path\"\n\n"; echo $path; $fp = fopen($path, 'r'); do //we loop until there is no data left { $data = fread($fp, 8192); if (strlen($data) == 0) break; $content .= $data; } while (true); $content_encode = chunk_split(base64_encode($content)); $message .= $content_encode . "\n"; $message .= "--" . $boundary . "\n"; $message .= $image . "<br />" . $_POST['name'] . "submitted a resume on our website. Please review the applications and contact the candidate if their resume is a fit for any open opportunities with the company. <br><br> Thank you. <br><br> SEI Team"; $headers = "From: \"Me\"<me@example.com>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\""; mail('george@visualrealityink.com', 'Email with attachment from PHP', $headers, $message);
  13. ok so I have progress! now the file is retrieved and uploaded but even though it is uploaded it still gives me an error that the upload failed (hardcoded error trap). Where I am now confused is that even though "if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path))" succeeds and uploads the file it still gives me the else error statement, this doesn't make much sense does anyone have a suggestion? Here is the trouble area $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['file']['name']); echo $target_path; if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['file']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } $path_of_uploaded_file = '/uploads/' . $_FILES['file']['name']; process_form(); Here is my full source code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <style> #form_container{ display:block; position:absolute; width:610px; min-height:450px; background:#f8f8f8; padding: 5px 5px 5px 5px; font-family:Arial, Helvetica, sans-serif; font-size:14px; } #form { min-height:450px; width:100%; background:#ececec; padding:0 0 0 0; } #formheader { background:url(images/form2_08.png) no-repeat #2f2f2f; margin:0 0 0 0; padding:0 0 0 0; width:631; height:30px;} form{margin:35px 0 0 35px;} fieldset div { margin:0.3em 0; clear:both; } label { float:left; width:10em; text-align:left; margin-right:1em; font-family:Arial, Helvetica, sans-serif; font-size:14px; } input { padding:0.15em; margin:0 0 0 -110px; width:300px; background:url(images/inputbg.png) no-repeat; border:0px solid #ddd; background:#fafafa; -moz-border-radius:0.4em; -khtml-border-radius:0.4em; } .bg2{background:url(images/inputbg.png) no-repeat; height:28px; line-height:28px;} fieldset { border:0px solid #ddd; padding:0 0.5em 0.5em; margin:0 0 0 -100px; } #details{font-size:10px;} #logo{background:url(images/form2_11.png) no-repeat; width:189px; height:238px; margin:-200px 0 0 400px; position:absolute;} #submit{margin:14px 0 0 -5px; border:none; position:absolute; cursor:pointer; cursor:hand;} #reset{border:none; margin:14px 0 0 115px; position:absolute; cursor:pointer; cursor:hand; } #divinputfile{ background:url(images/form2_27.png) no-repeat 100% 1px; height:43px; line-height:43px; width:340px; }#divinputfile #filepc{ opacity: 0.0; -moz-opacity: 0.0; filter: alpha(opacity=00); font-size:18px; margin:0 0 0 0; cursor:hand; cursor:pointer; } #fakeinputfile{ margin-top:-28px; } #fakeinputfile #fakefilepc{ background:url(images/inputbg2.png) no-repeat; style:none; width:240px; height:28px; line-height:28px; border:0; margin:5px 0 0 0; font-size:18px; font-family:Arial; } button { cursor: hand; cursor: pointer; padding: 0px; margin: 0 0 0 0; } a.link_button{ cursor: hand; cursor: pointer; } .fileupload{ margin:0 0 0 50px; } input[type="file"] { cursor: pointer; } .error{font-size:9px; font-family:Arial, Helvetica, sans-serif; color:#F00; } .error ul { text-decoration: none; list-style: none; } .error li { color: #F00;} .captcha_form { margin: 0 0 0 -45px; width:235px; } #captchaimage{ padding:0 0 10px 0;} .small { font-size:9px;} </style> </head> <body> <?php if ($_POST['_submit_check']) { // If validate_form( ) returns errors, pass them to show_form( ) if ($form_errors = validate_form()) { show_form($form_errors); } else { // The submitted data is valid, so process it process_form(); } } else { // The form wasn't submitted, so display show_form(); } function show_form($errors = '') { // If the form is submitted, get defaults from submitted parameters if ($_POST['_submit_check']) { $defaults = $_POST; } else { // Otherwise, set our own defaults: medium size and yes to delivery $defaults = array('IssueDate' => '','ExpiryDate' => ''); } if ($errors) { $error_text = 'You need to correct the following errors:'; $error_text .= '<br /><ul>'; $error_text .= implode('<li>',$errors); $error_text .= '</li></ul>'; } else { // No errors? Then $error_text is blank $error_text = ''; } include 'formhelpers.php' ?> <div id="form_container"> <div id="form"> <br /> <div id="formheader"> </div> <form method="POST" action="<?php print $_SERVER['PHP_SELF']; ?>" enctype="multipart/form-data"> <span class="error"> <?php print $error_text ?> </span> <input type="hidden" name="_submit_check" value="1"/> <div> <label for="name">Name: </label> <?php input_text('name', $defaults) ?> </div> <div> <label for="email">Email:</label> <?php input_text('email', $defaults) ?> </div> <div> Attach Resume: <span class="small">(1MB : PDF : DOC : DOCX : TXT)</span> </div> <div> <!--<input type="hidden" name="MAX_FILE_SIZE" value="1000000" /> <label for="userfile"></label> <input type="file" name="userfile" id="userfile"/> </div>--> <div id="divinputfile"> <input name="file" type="file" size="30" id="filepc" onchange="document.getElementById('fakefilepc').value = this.value;"/> <div id="fakeinputfile"> <input name="fakefile" type="text" class="link_button" id="fakefilepc" /> </div> </div> <div id="captchaimage"><img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" /></div> <div><label for="email"><a style="text-decoration: none" href="#" onclick="document.getElementById('captcha').src = 'securimage/securimage_show.php?' + Math.random(); return false">New Captcha: </a></label> <input type="text" name="captcha_code" class="captcha_form" size="10" maxlength="6" /> </div> <button type="submit" value="submit" id="submit" ><img src="images/form2_33.png" /></button> <button type="reset" value="reset" id="reset" ><img src="images/form2_37.png" /></button> </form> </div> <div id="logo"></div> </div> </div> <?php } function validate_form() { $errors = array( ); // name is required if ($_POST['name'] == "") { $errors[ ] = 'Please enter your name.'; } if (! strlen(trim($_POST['email']))) { $errors[ ] = 'Please enter your Email.'; } if (! preg_match('/^[^@\s]+@([-a-z0-9]+\.)+[a-z]{2,}$/i', $_POST['email'])) { $errors[ ] = 'Please enter a valid e-mail address'; } $filename=$_FILES['file']['name']; //For size if($_FILES["file"]["size"]>1000000) //1 mb { $errors[ ] = "File size should be less than 1MB"; } echo $_FILES['file']['name']; // for extention $ext = end(explode('.', $filename)); if($ext=='doc' || $ext=='txt' || $ext=='pdf' || $ext=='docx' ) { $target_path = "uploads/"; $target_path = $target_path . basename( $_FILES['file']['name']); echo $target_path; if(move_uploaded_file($_FILES['file']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['file']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } $path_of_uploaded_file = '/uploads/' . $_FILES['file']['name']; process_form(); } else { $errors[ ] = "Only doc or pdf or txt file is allowed: $filename "; } return $errors; } function process_form() { $image = "http://www.visualrealityink.com/dev/clients/arzan/snell_form/images/email.png"; include_once('Mail.php'); include_once('Mail_Mime/mime.php'); $to = 'george@visualrealityink.com'; $text = $image . "<br />" . $values['name'] . "submitted a resume on our website. Please review the applications and contact the candidate if their resume is a fit for any open opportunities with the company. <br><br> Thank you. <br><br> SEI Team"; $message=new Mail_mime(); $message=setTXTBody($text); $message=addAttachment($path_of_uploaded_file); $body = $message->get(); $extraheaders = array("From"=>$formValues['email'], "Subject"=>$subject, "Reply-To"=>$formValues['email']); $headers = $message->headers($extraheaders); $mail = Mail::factory("mail"); $mail->send($to, $headers, $body); echo "email sent"; } ?> </body> </html> Thanks Again
  14. <input name="file" type="file" size="30" id="filepc" onchange="document.getElementById('fakefilepc').value = this.value;"/> <div id="fakeinputfile"> <input name="fakefile" type="text" class="link_button" id="fakefilepc" /> </div> shows that the file input is named file and so I should be able to call $_FILES['file']['name'] and get the file name but its not working. This is becomming frustrating because I have done upload forms before. Its not making any sense why the file is not getting uploaded and retrieved.
  15. monkeytooth: thanks for the reply, I understand what you are saying and we both know the security issues behind attachments via php and yes it should be uploaded and linked in the email. However the client has no experience with ftp and the designer that wants this done is not budging on email attachment through php no matter how I tell him that its wrong. So I guess this is something that I am going to need to plug away with until I get it. I thought someone could offer some reasoning to why the file was not getting pulled from the form. Although I like the information you provided and yes I knew most of it before its down to what the client wants and sometimes you just cant change their mind no matter how much talking you do and smoke you blow. Thanks Again, any other suggestions would be appreciated.
×
×
  • 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.