Jump to content

DeathStar

Members
  • Posts

    529
  • Joined

  • Last visited

    Never

Posts posted by DeathStar

  1. Okay..

    Make one.

    <?php
    $contents = file_get_contents('script.txt');
    if ($_POST){
    $contents = $_POST['contents'];
    $open = fopen('script.txt', 'w');
    $do = fwrite($open, $contents);
    fclose($open);
    if (isset($do)){
    echo 'Saved.'; }
    else { 
    echo 'Failed'; }
    } 
    echo '<form action="index.php" method="post"><textarea name="contents">' . $contents . '</textarea><input type="submit" value="Save"></form>';
    ?>

  2. Then I have the right Idea.

     

    The script will determine the Country automatically by using the IP Address of the client.

    It has Text(eg:United States) aswell, so you can just call it.

    You can simply put one part int othe register page and then just call the saved data when You need it.

     

    Example: Ever noticed Google has a little flag in the top right corner of the screen, your countries?

  3. Hello there.

     

    I'm busy making an fully automated website for one of my clients.

    Is there maybe a language packs anywhere on the internet, that is already in an array or something?

     

    I'm making this website in mysql and php, but I really do not want to waste server load on mysql.

     

    I have seen an array like this before:

    if (isset ($_GET['lang']))
    {
        $langue = $_GET['lang'];
    }
    elseif (preg_match("/^fr/", $_SERVER['HTTP_ACCEPT_LANGUAGE']))
    {
        $langue = 'fr';
    }
    else
    {
        $langue = 'en';
    }
    $langues = array(
        'en' => array(
            'langue' => 'English',
            'autre_langue' => 'version française',
            'vers' => 'Version :',
        ),
        'fr' => array(
            'langue' => 'Français',
            'autre_langue' => 'english version',
            'vers' => 'Version de:',
        ),
        'all' => array(
            'Hello' => 'Hello',
        )
    );

     

    I don't exactly know how that works but have an idea.(I never bothered with arrays before.)

    Is the a language pack or would an array like that be the best, that I include in pages?

     

    Help Appreciated.

     

    Edit: I also use GD Image's for buttons.

  4. Okay, well.

    &hosturl=http://www.nestent.net/images/myspace/
    &mtitle1=James Bond: Casino Royale&mimgurl1=http://imagecache2.allposters.com/images/PYR/CON6519DM-CR.jpg&mrate1=5&mreview1=Excellent Movie! Plenty of action but still a good story. A little faster than older James Bond movies but I recommend it!

    Should look like:

    hosturl=http://www.nestent.net/images/myspace/
    mtitle1=James Bond: Casino Royale
    mimgurl1=http://imagecache2.allposters.com/images/PYR/CON6519DM-CR.jpg
    mrate1=5
    mreview1=Excellent Movie! Plenty of action but still a good story. A little faster than older James Bond movies but I recommend it!

    Then just change the identifier. :)

    $file = file('db.txt');
    
    foreach ($file as $lines) {
                                     //       this one '|' to '='
    list($ident,$text) = explode('|',$lines);
    if ($ident == $search){
    $var = $text; }
    }
    
    echo '<input type="text" value="'.$var.'">'; 

  5. $file = file('db.txt');

    1|Text One

    2|text two

    foreach ($file as $lines) { //Basically $lines == $file;
    list($ident,$text) = explode('|',$lines);

    Takes the text file search for the |'s

    Make first string before the | a variable called $ident.

    Make string after the | a valiable called $text

    if ($ident == $search){ //if the $ident is $search..
    $var = $text; }// Make a Variable called $var.
    }
    
    echo '<input type="text" value="'.$var.'">'; 
    // Put the variable called $var in the textbox.

     

    Hope that helps.

  6. eeek..

    Sorry for that.

     

    Thanks. I tried it and I get the following error:

     

    Parse error: syntax error, unexpected '{' in /home/****/public_html/login/grab.php on line 3

     

    Line 3 is:

    if (isset($_COOKIE[visit]) {

  7. eh...

    function send_mails() {
    
      // start mail process
    
    $mailContent = "--------CONTACT--------\n";
    $mailContent .= "Name: ".$name."\n";
    $mailContent .= "Date: ".$date."\n";
    $mailContent .= "E-mail: ".$email."\n\n--------PHONE--------\n";
    $mailContent .= "Phone: ".$phone."\n";
    $mailContent .= "Address: ".$address."\n";
    $mailContent .= "City: ".$city."\n";
    $mailContent .= "State: ".$state."\n";
    $mailContent .= "Zip: ".$zip."\n\n---------Other Details---------\n";
    $mailContent .= "When are you moving: ".$moving."\n";
    $mailContent .= "Where are you moving: ".$where."\n";
    $mailContent .= "Your price range: ".$price."\n";
    $mailContent .= "Number of bedrooms: ".$bedrooms."\n";
    $mailContent .= "Square footage: ".$sqft."\n";
    $mailContent .= "Comments: ".$comments."\n";
    
    /*--------------------------------------------------------------*/
    
    $toAddress = "harrylips@gmail.com"; // change this! 
    $subject = "Seattle Viet Homes Buyer Inquiry"; // change this!
    $recipientSubject = "Seattle Viet Homes Buyer Inquiry"; // change this! 
    $receiptMessage = "Thank you ".$name." for inquiring at SeattleVietHomes.com's website!\n\n\n";
    $receiptMessage .= "Here is the contact information you submitted to us:\n\n";
    $receiptMessage .= "--------CONTACT--------\n";
    $receiptMessage .= "Name: ".$name."\n";
    $receiptMessage .= "E-mail: ".$email."\n";
    $receiptMessage .= "Phone: ".$phone."\n";
    
    /*--------------------------------------------------------------*/
    
    mail($email, $subject, $receiptMessage,"From:$toAddress");
    
    /*--------------------------------------------------------------*/
    
    mail($toAddress,$recipientSubject,$mailContent,"From:$email");
    }
    

  8. IP addresses can change.

    Cookies can't. (Without humans.)

     

    if (isset($_COOKIE[visit]) {
    header('Location: page.php'); 
    }
    elseif (empty($_COOKIE[visit])) {
    echo 'This is your first time visiting this page.'; 
    }

     

    Try that.

  9. :-\

    Fetch the number of times from database and then if it is moee than one, die();

     

    I have a website where people can buy gift certificates and an email will be sent to whoever they are purchasing it for.  In the body of the email is a link for that person to click on it and print out the gift cert.  I just realize that people can change the id number in the url and retrieve other gift certs.

×
×
  • 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.