Jump to content

larissahn

Member
  • Posts

    16
  • Joined

  • Last visited

Posts posted by larissahn

  1. hi, I have this tell a friend php script. it works, it does send the email, but without any of the fields, like subject, friend's name, message.

    here is the code:

     

    <?php 
    
    $site_name = "[url=http://www.utilaecology.org]www.utilaecology.org[/url]"; 
    $subject = "Tell a friend"; 
    $body = "Hello,\r\nYour friend $name ($email) has recommended that you see our website $site_name. He has also sent this message along with the recommendation:\r\n" . $message . "\r\n Thank you,\r\n-The webmaster"; 
    
    if($_POST["send"] == "true") { 
       $to = $_POST["to"]; 
       $name = $_POST["name"]; 
       $email = $_POST["email"]; 
       $message = $_POST["message"]; 
       if (($name == "") OR ($email == "") OR ($message == "")) { 
           print (""); 
           print ("One of the fields was left blank. Please put something in all fields.
    
    "); 
           print ("
    "); 
           email_form(); 
       }elseif(ereg("([[:alnum:]\.\-]+)(\@[[:alnum:]\.\-]+\.+)", $email)) { 
           $recipient = $to; 
           $subject = $the_subject; 
           $additional_headers = ("From: $email\n"); 
           if(mail($recipient, $subject, $body, $additional_headers)) { 
               print (""); 
               print ("Tell a friend script mailed your friend at $to about $site_name successfully.
    Thank you.
    
    "); 
               print ("
    "); 
           }else{ 
               print (""); 
               print ("Uh-Oh! Something went wrong with the script! Please try again.
    
    "); 
               print ("
    "); 
               $send = "false"; 
               email_form(); 
           } 
       }else{ 
           print (""); 
           print ("That email address does not appear to be valid. Please try again.
    
    "); 
           print ("
    "); 
           $send = "false"; 
           email_form(); 
       } 
    
    }else{ 
       print (""); 
       print ("
    Tell a friend"); 
       print ("
    "); 
       email_form(); 
    } 
    
    function email_form(){ 
       global $subject_array, $recipient_array, $this_script, $PHP_SELF; 
    
       print (""); 
       print ("\n"); 
       print (""); 
       print ("To:
    \n"); 
       print (""); 
       print ("
    \n"); 
       print (""); 
       print ("Name:
    \n"); 
       print (""); 
       print ("
    \n"); 
       print (""); 
       print ("Your Email Address:
    \n"); 
       print (""); 
       print ("
    \n"); 
       print (""); 
       print ("Your Message:
    \n"); 
       print (""); 
       print ("
    \n"); 
       print (""); 
       print (""); 
       print ("\n"); 
       print (" \n"); 
       print ("\n"); 
       print (""); 
       print ("\n"); 
       print (""); 
       print ("script by leapinglangoor"); 
       print (""); 
       print (""); 
    } 
    ?>

    Thanks!

  2. hi, I created this form. to avoid errors, I'd like the user to select the date from a calendar that pops up. unfortunately, I haven't been able to make it work.

    this is my form: http://www.utilaecology.org/research/lionfish_contact.php

    this is the date picker I want to use: http://www.rainforestnet.com/datetimepicker.htm

     

    and this is my code:


    <?php include('../includes/core.php'); layout_start(true); ?>




    Report lionfish sighting

    Please fill in the form below if you would like to report a lionfish sighting and we will get back to you as soon as possible.





    Name:
     

    Email:
     
    Date: 
    Pick a date

    thanks!

  3. Hi, I recently created a simple form for my website, http://www.utilaecology.org/research/lionfish_contact.php

     

    the feedback should be sent to my email, but I am not receiving anything.

     <?php
    $name = $_REQUEST['name'] ;
    $email = $_REQUEST['email'] ;
    $date = $_REQUEST['date'] ;
    $dive_site = $_REQUEST['dive_site'] ;
    $depth = $_REQUEST['depth'] ;
    $additional_information = $_REQUEST['additional_information'] ;
    
    if (!isset($_REQUEST['email'])) {
       header( "Location: http://www.utilaecology.org/contact/response.php" );
       }
     elseif (empty($email) || empty($dive_site)) {
     header( "Location: http://www.utilaecology.org/contact/response.php" );
     }
     else {
     mail ( "larissahn@rocketmail.com", "Report Lionfish Sighting Form", 
     "Date: $date\n", 
     "Dive Site Location: $dive_site\n", 
     "Depth: $depth\n",
     "Additional Information: $additional_information\n", 
     "From: $name <$email>" ) ;
    
     header ( "Location: http://www.utilaecology.org/contact/response.php" ) ;
     }
    ?> 

  4. hi, this question might just be the stupidest ever, but I want to be careful and not mess anything up. this is the code for a drop down menu I have in an application page.

    Select Programme

    2-Week

    4-Week

    8-Week

     

    to change from a 2 week to a 3 week option, I just substitute the 3 for a 2, right? I think it is just a string, I'm just not sure what >2-Week at the end of the line is, not calling a variable, right?

  5. let's say i have to update an existing site. the page i'm working on is called programmes.php

    i haven't downloaded the entire site to my pc, just this one page to work on it. i made some changes to the text and i added a new pdf file (which i copied to my local root folder first). i didn't download images or anything else from the server, just the one page. i want to make sure that when i upload it, i don't ruin the page. when i finish with the changes, i only have to choose the arrow that says"put files", nothing else?

  6. i have no idea how the menu is being generated. the code i pasted above came from dreamweaver, where i could read it on every page of the site, but it wouldn't let me modify it. i've opened almost every page on the server looking for a kind of menu.php, because i imagine the menu has it's own .php file, but i've had no luck. what can i do to know how the menu is being generated?

  7. ok, let me see if i got this straight. changing the order of the menu options is plain and simple. i just copy the options in the order i want them (in the code). and to delete an option from the menu, i just delete any reference to it in the code. the menu is universal, so i should make these changes to the menu in each page and upload to the server, right?

  8. so it's probably a good idea to download the www folder from the server using BitKinex and copying it to the www directory of the wamp. that way i can preview the pages from now on without any problems.

  9. ok, i already have WampServer 2 running on my pc. i saved a page from dreamweaver in the www directory, but when i choose localhost, it doesn't give me the list of projects. basically my question is: after making the changes using dreamweaver (before uploading anything to the server), how can i preview how the page looks using WampServer 2? thanx again.

  10. hello, I recently got a new job. I have to update a website, I have done so in the past. the problem is that I am familiar with HTML and this website was built using PHP. the corrections are small, mostly text, but I am not sure how updating a PHP web page works. can somebody help me, please?

×
×
  • Create New...