Jump to content

Randy

Members
  • Posts

    25
  • Joined

  • Last visited

    Never

About Randy

  • Birthday 05/25/1992

Contact Methods

  • MSN
    r_j@hotmail.co.uk
  • Website URL
    http://

Profile Information

  • Gender
    Not Telling
  • Location
    Newcastle, UK

Randy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  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\" /]
×
×
  • 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.