Jump to content

Randy

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

Everything posted by Randy

  1. I was wondering how I would get the current url of an iframe, I have searched on google but all to no avail.
  2. Randy

    indexOf

    I was just wondering if there is a function in php (or an alternative) that is similar to javascript's indexOf, if you don't know what this function does, here is a brief example... [a href=\"http://www.hscripts.com/tutorials/javascript/string-indexof-method.php\" target=\"_blank\"]indexOf[/a]
  3. [code]while($row = mysql_fetch_array( $result )){     echo '<a href="model.php?m='.$row['model'].'"><br>'; }[/code] model.php [code]<?php     $model = $_GET['m'];     $result = mysql_query("SELECT * FROM `table` WHERE (`model`='$model')");     echo("Model: $model");     echo("<br>Price: " . mysql_result($result, 0, "price")); ?>[/code] Very simple example...
  4. Hmm... "Unable to jump to row 0" means that no data in the table fits this criteria: "WHERE pid = '$pid'", or just that there is nothing in the table
  5. ok, something was wrong with the post so here is a link to what i was going to post [a href=\"http://www.electric-monkey.com/ryan/post.txt\" target=\"_blank\"]http://www.electric-monkey.com/ryan/post.txt[/a]
  6. you need a bit of javascript for that, i remember doing that for a calendar i made, when you selected the month, the days dropdown box was filled. Theres plenty stuff on google that'll help you
  7. try changing MYSQL_NUM to MYSQL_ASSOC MYSQL_NUM returns an array like: [0] -> Hello [1] -> Hi whereas MYSQL_ASSOC returns an array like: [Money] -> 12 [Tax] -> 17.5 you can refer to a MYSQL_ASSOC array with $array['tax'] which is what you seem to be using
  8. form.html [code]<HTML>     <head>         <title>             Form         </title>     </head>     <body>         <form action="mail.php" method="POST">             <input name="name">             <br><input name="email">             <br><input name="phone">             <br><input type="submit" value="Send!">         </form>     </body> </HTML>[/code] mail.php [code]<?php     $email = "your@email.adress";     $subject = "Contact Form";     $message = "Name: ".$_POST['name'];     $message .= "\nEmail Adress: ".$_POST['email'];     $message .= "\nTelephone: ".$_POST['phone'];     $message = wordwrap($message, 70);     mail($email, $subject, $message);     echo("Thankyou for filling out the Form!"); ?>[/code] I hope this is what you wanted to do... the email would look like: Name: Bob Email Adress: Bob@hotmail.com Telephone: 0123 1234567
  9. [!--quoteo(post=377605:date=May 27 2006, 05:21 PM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ May 27 2006, 05:21 PM) [snapback]377605[/snapback][/div][div class=\'quotemain\'][!--quotec--] HI If this is your server and on the same internet connection you would use something like 192.168.1.101 or localhost (no firewall or routed )(in your house) for example if your server is running from somewhere else in the world (one you are paying for)you would use there connection address.wwwservername.co.uk which one is it ? cheers. [/quote] the www.electric-monkey.com/ type
  10. I am running this script on my server, not on my computer i use localhost all the time for select, update, insert and such and it always works...
  11. Oh yeah, i had missed out a semicolon, i have edited the script so it should work now...
  12. [code]<HTML>     <head>         <title>E-mail sent to your Inbox</title>     </head>     <body>         <?php             $to = "email removed for privacy reasons";             $subject = "Mail from your website";             $from = "FROM: ".$_POST['name']." <".$_POST['email'].">\n";             $message = wordwrap("This message is from the website.\n\nName: ".$_POST['name']."\nEmail: ".$_POST['email']."\nMessage: ".$_POST['message'], 70);             mail($to, $subject, $message, $from);             $to = $_POST['email'];             $subject = "Thankyou!";             $from = "FROM: Site Admin <bob@hotmail.com>";             $message = wordwrap("Thankyou ".$_POST['name'].", blah blah blah", 70);             mail($to, $subject, $message, $from);         ?>         <p>Thank you for contacting us. Please check your Inbox.</p>     </body> </HTML>[/code] Try this...
  13. NO, i do not want to create a database using cPanel, i was making a forum that is dynamic and can be put on a website easily.
  14. Ok, i made a very simple test... [code]<?php     mysql_connect("localhost","electri_ryan","*********");     mysql_query("CREATE DATABASE `forums`") or die(mysql_error()); ?>[/code] When i run this i get the error: Access denied for user: 'electri_ryan@localhost' to database 'forums' Do i have to set privileges or something? 'electri_ryan' has all privileges...
  15. [code]<?php     // ----------     $host = "localhost";     $user = "electri_ryan";     $pass = "*********";     // ----------     mysql_connect($host, $user, $pass) or die("Error Connecting: ".mysql_error());     $dbs = mysql_list_dbs();     if(mysql_num_rows($dbs) > 0){         while(list($db) = mysql_fetch_row($dbs)){             if($db == "forums"){                 $exists = true;             }         }     }     if(!$exists){         echo("Database does not exist!");         // Create database...         mysql_query("CREATE DATABASE `forums`");     } ?>[/code] Ok, when i run this code, no errors, and it echoes out "Database does not exist!", but when i look in cPanel, there is not a database calles forums... Anybody know what is wrong? [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /]
  16. ok, i was going to post something but it said "Not Acceptable" so here is the post which i was going to post... [a href=\"http://ryan.electric-monkey.com/phpfreakspost.txt\" target=\"_blank\"]http://ryan.electric-monkey.com/phpfreakspost.txt[/a]
  17. i have this code: (for some reason it says error every time i try to post it) [a href=\"http://ryan.electric-monkey.com/phpfreaks.txt\" target=\"_blank\"]http://ryan.electric-monkey.com/phpfreaks.txt[/a] but i want to make the days in february dependant upon the year chosen in the 3rd selectbox, not just the current year thanks in advance
  18. Why does closing the [code]</form>[/code] tag sometimes make a new line, and sometimes not? Also, how do i stop it from creating a new line? one day, my website was fine, then the next day, (nothing had been changed/edited) a new line appears
  19. ... connect(host', ... that should be connect('host', ... *EDIT* also add a semicolon at the end of the first line...
  20. Randy

    Submit Button

    Is it possible to make a submit button just look like a normal link... if i was to use whatever.php?msg=This is the message and it would probably be too long to use GET
  21. thanks! *EDIT* ah... i also have a year select so that means that the days in february will have to be dependant on that too :(
  22. how would i do some sort of leap year detector, then it changes the february days in thought something like if(round((Year+1900)/4) != ((Year+1900)/4)){
  23. [code]Date = new Date(); Year = parseFloat(Date.getYear()); if((round((Year+1900)/4)) == ((Year+1900)/4)){     leap = 29; }else{     leap = 28; }[/code] something seems to be wrong, i don't really know what... thanks in advance
  24. ok, i would like to make a set of drop-down boxes where people can select the date but say, if you selected March, the second dropdown box would automatically have 31 days or if you selected April, there would only be 30 is this possible with php / how would i do it... thanks in advance :)
×
×
  • 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.