Jump to content

ajsuk

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

ajsuk's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Sorry for the delay, life got busy. Anyway, this didn't seem to work unfortunatly. :( Anything else I can do?  :-\
  2. Hey there, another nooby question I'm sure but again I'm stuck so I shall have to ask. ;) As the title says really, I'm looking to grab email addresses from a database to make up a recipients list for this email script... I've got this which does the job but having a script run 500 times over sending emails doesn't sound the best of ideas... [code] <db connect code etc...> while($row = mysql_fetch_array($result)) { $to = $row['email']; $subject = "Test Email"; $message = "Test Email Message"; $from = "someone@mydomain.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); } mysql_close($con); ?>[/code] Is there some way I can store the results in a variable to be used as the mail-to value for sending to all at once rather than one by one? Thanks for any help you can give! :)
  3. Here there, I'm _very_ new to MySQL (as in started today) so please be gentle hehe. I'm playing around with making a simple login system using a form to check login details and display results belonging to that user if login is correct. I've got this all working fine but ofcourse if the details are wrong it'd be nice if I could get it to print something rather than the user being left with a blank page. I'm guessing I need to check the form results (user and pass) against the the database records. I've tried this with an if statement but it doesn't seem to want to know. Any help would be great, thanks in advance! =) Heres my poor n00b attempt: [code]<?php $nameresult = $_POST['name']; $passresult = $_POST['pass']; $con = mysql_connect("localhost","<dbnamehere>","<dbpasshere>"); if (!$con)   {   die('Could not connect: ' . mysql_error());   } mysql_select_db("db_testing", $con); $result = mysql_query("SELECT * FROM info WHERE name='$nameresult' && pass='$passresult'"); while($row = mysql_fetch_array($result))   {   echo "Welcome ".$row['name'] . " - " . $row['email'] . " - " . $row['pass'];   echo "<br />";   if ($nameresult != $row['name'] && $passresult != $row['pass'])   echo "login Bad";   } mysql_close($con); ?>[/code]
  4. [quote author=genericnumber1 link=topic=121297.msg498394#msg498394 date=1168119008] why not just parse the information before the mail()? [/quote] Well, because that'd be too simple/smart for this poor php noob. ;) Thanks alot! :)
  5. Well I would of posted something but its all in my head at the moment. I havn't really a clue what how to do what I want and so havn't got any examples however I'll throw in what little I think is right... [code] function agecheck()   { if ($age < 21) echo $age."(Under age)"; else echo $age;   } $to = "someone@hotmail.com"; $subject = "Test mail"; $message = "Here are the results: $firstname $lastname of agecheck() years old..."; $from = "someonelse@hotmail.com"; $headers = "From: $from"; mail($to,$subject,$message,$headers); echo "Mail Sent."; [code][/code][/code]
  6. Hey there, I'm having trouble doing what I want to do with emailing some form results. I know that you can include results as variables with no trouble but the problem comes for me because some of my form results have to be processed with if statements and so on meaning its not always just a direct dump from the form field for example. I'm guessing I need to be using a function or something? I've tried messing with them but I can't seem to get the email message to accept/include anything other than variables and static text. Any help would be greatly appreciated! Thanks in advance, Andy. =)
  7. Ok, after some playing I've found that the get form method will produce the URL for me and display what I want. The only problem is that form forgets whats been filled in when submited, which is a pain if the user perhaps wants to keep most of  the outfit as is and only edit one or two clothing options... Is there a way I can get the form to recall the submited info, or even pull back the values from the newly generated url..? Thanks, A
  8. Yeah, thats along the right lines and how I thought about doing it at first but I like the idea of using PHP so that it can generate the custom URL which people can then copy and pass on to generate their custom outfit without selecting all of the options again to rebuild it.
  9. Hey, I'm looking to make up a dressing room builder type system with custom clothing parts to select from. I'm thinking of doing it using a form which then hopefully generates the correct address to display the custom outfit. I'd somehow like to produce the page so it displayed: [u]The output area[/u] {tshirt} {pants} [u]Builder[/u] {form} [hr] Just as a simple example the form could consist of two sets of radio buttons with red, green & blue options for shirts and pants... Once the form was completed and submited it'd need to tell the address bar to generate something like this: http://mydomain.com/?shirt=green&pants=blue Which would then change the output display on the page and also the URL would be there to copy incase anybody wanted to directly link to an outfit. Thats me pretty much done, thanks for any help or suggestions I get. I'm no good at this stuff at all so it'd be much appreciated! -A
  10. Ok heres the deal...  :) I'd like to add a subdomain which includes the page from the main domain but not displaying the default page. So effectivly... Going to -> subdomain.mydomain.com -> collecting page from mydomain.com -> then changing to -> subdomain.mydomain.com?pageid=blah Any help would be great! Thanks. (I still want to be able to navigate once there btw)
  11. This looks like one of the many standard countdown scripts for a specific date. (New year for example) Doesn't do what I'd like...
  12. Good point, I should of mentioned I don't care about it really acting as a live counter, just giving a static output when the page has been loaded would be fine. :)
×
×
  • 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.