Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Posts posted by wildteen88

  1. rather than checking that $_POST['code'] value also check that is actually set. This is why you are getting an error on your page B. So chnage you code to the following:

    [code]<?php

    //first check that $_POST['code'] is actually set and then chekc that its value is set to "list"
    if (isset($_POST['code']) && $_POST['code'] == "list")
    {
        echo "<a href=Downloads/list.txt target=top>See List</a>";
    }
    else
    {
        echo "Access Denied";
    }
    ?>[/code]
    I would also recommend you to use indentaion with you code blocks this helps you to idently code bocks to code blocks for functions, if, if/ele/else if statements etc. ALso I would recommend to use braces too.
  2. I would recommend to to ajaxfreaks.com as ober mentioned above. What I will do is provide link to a turorial that is over at ajaxfreaks.com to get you started with the AJAX basics whcih you can go to by [a href=\"http://www.ajaxfreaks.com/tutorials/1/0.php\" target=\"_blank\"]clicking here[/a].
  3. ratther then doing the following: [code]AddType application/x-httpd-php .html
    AddType application/x-httpd-php .htm
    AddType application/x-httpd-php .php3[/code]in you .htaccess do it one line like so:
    [code]AddType application/x-httpd-php .html .htm .php3 .phtml[/code]
    just seperate each file extension by a space!
    You dont have to put .htaccess file in every folder. However you can just place it one folder and it'll effect everysingle folder that is below it. Such as the root folder (wwwroot, public_html, public_www or whatever your root folder is called).
  4. Do you post a message and then go back a page and are you using FF? I find that FF tends to save your last sent data temporarily and so is a browser based feature rather than a PHP one. I believe the extension SessionSaver does this too.
  5. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]As I said, I may be wrong, but I have never been able to use the "value=" parameter for a TEXTAREA. This always works.[/quote]Beacuse the textare tag is not part of the <input> tag family and so has an opening and closing tag just like the paragraph tag.
  6. I guess it is becuase your database values have \n's in them and so this could be why you are getting a bigger than usual button. SO chnage the following line in your lang_conver function:
    [code] $Var_lang = $data['NAME'];[/code]to[code] $Var_lang = str_replace(array("\r", "\n"), '', $data['NAME']);[/code]
    Any values that si returned from the database will now have any newline (\n) or carriage returns (\r) stripped out so this should stop what is happening with your button.
  7. You can easily find what you need in over at php.net which holds the fine and easy to follow manual too. First always check over at [a href=\"http://www.php.net/manual/en/\" target=\"_blank\"]http://www.php.net/manual/en/[/a] and have little browse through the manual to see if there is anythink there can help you.

    If you cant find anythink then just post here and we will help!
  8. You'll want to do this:
    [code]<?php

    $subtotal = 33;
    $delivery = 45;
    $total = $subtotal + $delivery;

    echo 'Subtotal: ' . $subtotal . '<br />';
    echo 'Total: ' . $total . '<br />20% off: ';
    //take 20% off from $total, 20% of $total is 15.60
    echo $total - ($total/100*20);

    ?>[/code]
  9. CHMOD sets perssions which can restrain users from doing certains things on your files/folders. Therer are three groups which are Owner, Group and Public

    Each groups has three settings which are Read, Write and Execute. The defualt perssions for your files is usually 0644. You can set these permissions in your FTP client after you have uploaded your files to the server. Once uploaded depending on your FTP client right click on the file and select Properties or Perssions from the menu. A small box should popup and a perssions table should be shown with tickboxes for each read, execute and write settings in each group. If you tick all the read, write and execute tickboxes in all three groups that wil set your file permissions to CHMOD 0777.

    CHMOD is a much more advanced file permission handler than WIndows persions which is just one setting Read-Only!
  10. Chnage your whole code to the following:
    [code]<?php

    session_start();

    $_SESSION['abfrage_session'] = "Anrede : " . $_POST["anrede"] . "\n";
    $_SESSION['abfrage_session'] .= "Vorname : " . $_POST["vorname"] . "\n";
    $_SESSION['abfrage_session'] .= "Name : " . $_POST["name"] . "\n";
    $_SESSION['abfrage_session'] .= "Anschrift : " . $_POST["anschrift"] . "\n\n";
    $_SESSION['abfrage_session'] .= "PLZ : " . $_POST["plz"] . "\n";
    $_SESSION['abfrage_session'] .= "Ort : " . $_POST["ort"] . "\n";
    $_SESSION['abfrage_session'] .= "Tel : " . $_POST["tel"] . "\n\n";
    $_SESSION['abfrage_session'] .= "eMail : " . $_POST["email"] . "\n\n";
    $_SESSION['abfrage_session'] .= "Art d. Interesses : " . $_POST["Bucher"] . "\n\n";
    $_SESSION['abfrage_session'] .= "Produktinteresse : " . $_POST["produkt"] . "\n\n";
    $_SESSION['abfrage_session'] .= "Trainingsform : " . $_POST["Art"].  "\n\n";
    $_SESSION['abfrage_session'] .= "Nachricht : " . $_POST["anfrage"] . "\n";

    // Mail verschicken
    $mailSubject = "Kontakt über A.S.S.E.T- Website";
    $mailFrom = "WEB-Kontaktformular";

    // mail("isd@isdgmbh.com", $mailSubject, $abfrage_session,"From: $mailFrom\nReply-To: ".$HTTP_POST_VARS['email']."\nX-Mailer: PHP/" . phpversion());
    // mail("rene.gyurcsik@isdgmbh.de", $mailSubject, $abfrage_session,"From: $mailFrom\nReply-To: ".$HTTP_POST_VARS['email']."\nX-Mailer: PHP/" . phpversion());

    $mailTo = $Empfaenger;
    $mailSubject = "ASSET-Anfrage für " . $Empfaenger;
    $mailFrom = "ASSET Webseite";

    mail($mailTo, $mailSubject, $_SESSION['abfrage_session'], "From: $mailFrom\nReply-To: " . $_POST['email'] . "\nX-Mailer: PHP/" . phpversion());
    mail("braunschweig@stevens-english.de", $mailSubject, $_SESSION['abfrage_session'], "From: $mailFrom\nReply-To: " . $_POST['email'] . "\nX-Mailer: PHP/" . phpversion());

    header("Location: ../nachricht.html");

    ?>[/code]
  11. Well in that case you will want to look in to AJAX and PHP for what you want to do. As you can't do what you want to do with just PHP on its own. Have a look at the [a href=\"http://www.ajaxfreaks.com/tutorials/1/0.php\" target=\"_blank\"]AJAX Tutorial[/a] over at ajaxfreaks.com.

    NOTE: You can get help over at ajaxfreaks.com on the AJAX forum no need to signup again to that forum over at ajaxfreaks.com as your account which you use here should work over there as both forums are tied to the same database.
  12. The source of the output is comming form witin index.php on or around line 17. So check index.php have a look at lines 15 to 20 in index.php if you cant see why then maby post you code here.

    But please do read the thread toplay has posted.
  13. Your code is working it is because of your last PHP statement:
    [code]<?php echo 'We omitted the last closing tag';
    </body>
    </html>[/code]
    You haven't ended your PHP statement properly and I dont know here you have heard that from about PHP not needing a closing PHP statement tag (?>) as PHP needs this in order to know here each code block ends, as currently PHP is returning the following error:
    [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: syntax error, unexpected '<' in {path/of/file/here/filename.php} on line 13[/quote]You dont see this message as your server may have display_errors turned off in your php.ini file and so you get a blank page. I would recommend you to turn on display_errors this will help understand why your scripts aren't working if an error occurs.

    The other two PHP statements are valid. However dont use the the secound PHP statement too much make sure you do allways end you lines of code with a semi-colon. So in order to get your script to work just delete this: [i]<?php echo 'We omitted the last closing tag';[/i] from your script.
  14. You cant do that you will [b]HAVE[/b] to submit the form in order for PHP to create the $_POST['education'] variable this will then hold value fo the option that was selected upon submit. PHP will create this variable automatically.

    Why do want PHP to create the variable before you submit the form?, as this is impossible to do
  15. The following timestamp 20051107065122 is an invalid timestamp. As a timestamp is the number secounds passed since January 1 1970 00:00:00 GMT. So in order to get the timestamp of Nov 07 2005, 06:51:22 you will want to use strtotime to convert tat date into a timestamp like so:
    [code]<?php

    $date = strtotime("Nov 07 2005, 06:51:22");
    echo $date . '<br />';
    echo date("M d Y H:i:s", $date);

    ?>[/code]
  16. [!--quoteo(post=358812:date=Mar 27 2006, 10:24 AM:name=AMcC)--][div class=\'quotetop\']QUOTE(AMcC @ Mar 27 2006, 10:24 AM) [snapback]358812[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    Perfect! Thanking you!
    [!--quoteo(post=0:date=Mar 22 2006, 08:04 PM:name=snowdog)--][div class=\'quotetop\']QUOTE(snowdog @ Mar 22 2006, 08:04 PM)[/div][div class=\'quotemain\'][!--quotec--]
    put this on the bottom of tha page you want displayed for xx seconds.

    $sec = 5; // number of seconds until redirect
    header("Refresh: $sec; url=http://www.yoururl.php");
    Snowdog[/quote]
    [/quote]
    Make sure you use the header function before the output of any text/html otherwise PHP will report back a warning error and your script wont run.
  17. IF you want to show the current selection of the select box before submitting the form it. Then you'll want to look into Javascript to get the current selected value fo the selectbox.

    Something like this:
    [code]<?php

    if (!isset($_POST['submit']))
    {
    ?>

    <script type="text/javascript">

    function getEdu(eduValue)
    {
        //alert('Form has changed: value = ' + eduValue);
        eduText.innerHTML = "You have selected: " + eduValue;
    }

    </script>
    <div id="eduText">Make a selection below:</div><br />
    <form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>" onChange="getEdu(document.getElementById('edu').value)">
      <select name="education" id="edu">
        <option value="Jr.High">Jr.High</option>
        <option value="HighSchool">HighSchool</option>
        <option value="College">College</option>
      </select>:<br />
    <input type="submit" value="submit" name="submit"><br />
    </form><br />
    <?
    }
    else
    {
        echo $_POST['education'];
    }
    ?>[/code]
  18. I think trhe following line:
    [code]/If cmd has not been initialized
    if(!isset($cmd)) [/code]should be:
    [code]/If cmd has not been initialized
    if(!isset($_GET['cmd'])) [/code]as cmd is being sent over as a url parameter/variable see the following code:
    [code]//make the title a link
          echo "<a href='edit.php?cmd=edit&id=$id'>$title - Edit</a>";[/code]notice the following [b]edit.php?cmd=edit[/b]You are assigning edit as the value of cmd variable. So I guess cmd stores stuff like edit, add and delete.

    If the tutorial you got this form actually explained what the code does you should be able to understand, which isn't your fault as just like the other million PHP so called tutorials out there the tutorial you followed may of went along the lines of "Copy the following code and save it as somefile.php, now copy the next bit of code and save it as someotherfile.php! Enjoy!" and didn't even bother explaining what the hell the code is doing. I can't see how that teaches someone PHP but just a stupid Copy 'n' Paste session.

    Hope that helps.
  19. Rather than using the single quotes for the index/key you use double quotes, that way PHP will use the value stored in the id variable as the index/key. As currently PHP was treating your variable 'as-is' and so was tring to find a index/key called $id in the _POST array.

    So eother of the following will work
    [code]$_POST["$id"];
    // OR
    $_POST[$id];[/code]
  20. [!--quoteo(post=358535:date=Mar 26 2006, 04:18 PM:name=landoplenty)--][div class=\'quotetop\']QUOTE(landoplenty @ Mar 26 2006, 04:18 PM) [snapback]358535[/snapback][/div][div class=\'quotemain\'][!--quotec--]
    hello,

    First off let me tell you now im a newb to php my question is this
    i installed Rapidphp2006 to my pc thinking it would make my pc able to view my work as i go
    but all i see is code i also installed apache2triad and im running windows xp so am i missing something why cant i view the images under the view tab do i need to install anything else?
    [/quote]

    I have rapidPHP too, but 2005 version however there shouldn't that much of change between the two. In order for you to preview your php files you will need to tell rapidPHP where your PHP intepreter is located. You can set this by going to [b]Options[/b] -> [b]Preferences[/b] -> [b]PHP Options[/b]

    You need to specify where your [b]php.exe[/b] file is (This is the PHP Intepreter) which should be located somewhere as you have installed apache2triad, which I believe includes PHP too. So have a look where you installed apache2triad to. Once you have set where the php.exe file is, you need to setup the Preview settings.

    Simply open the [b]Preview[/b] folder by clicking on the [b]+[/b] next to it in the Preferences dialog box and select [b]Mappings[/b].

    Now Click the [b]Add[/b] button and select the [b]Local Folder[/b] button next to the [b]Local or FTP Path[/b] textbox. Now in the [b]Browse for Folder[/b] box naviagte to where you store your PHP files to be parsed by the webserver. Once you have done that click [b]Ok[/b] and now in the [b]Webserver Path[/b] textbox type in [b]http://localhost/[/b]. Now Click Ok and Ok agaion to close the Preferences dialog box.

    Everything should now be setup so you can preview your PHP scripts within rapidPHP!

    Hope that helps.
  21. Its in frameset thats why.

    This is the main page:
    [a href=\"http://www.century-properties.com/canyonranch/project.html\" target=\"_blank\"]http://www.century-properties.com/canyonranch/project.html[/a]
×
×
  • 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.