Jump to content

ajsuk

Members
  • Posts

    34
  • Joined

  • Last visited

    Never

Everything posted by ajsuk

  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. :)
  13. Hey there, me again with another request.  :) I'd like to build a special custom countdown timer. What makes it special (and more complicated :() is its not going to countdown to a specified event(time,date) as the 100's of other scripts out there do. Heres what i'd like it to do... Have 4 cycles of 4.5 Days(108 hours) Display how long it is to each new cycle start. - For example "2 Days, 8 hours and 5minutes until cycle#3" Somehow be able to reset/calibrate/specify the countdown and cycle if the webserver went down or something. This is continues btw... (except if the server goes down ofcourse;)) I think thats everything...  :o I'm guessing PHP is the way to go with this as we could still use the server to count with? Thanks a bunch for any help you can give! This ones kicking my backside.  :D
  14. ah, yes, I've got it!! *smacks head on table* Must be one of those days, thanks alot all!
  15. Yeah  :-\ So is there any way to change the "Balblablax" to "<? echo $status[2] ?>" without it getting annoyed? the "<? echo $status[2] ?>" bit is supposed to trigger another script earlier in the include file to produce a server status (from server #3) and I [u]only[/u] want it to display that 3rd server result in this case. So this is why I'm trying to tell it to echo that status in this example. If theres any other way to do it, I'm all ears. Sorry for the confusion, I'm not up on all this.  :(
  16. because it has to act as PHP when its transfered in to the include page.
  17. I think it's this bit thats screwing it up: [code]$text = '<? echo $status[2] ?>';[/code] It'll include whats in there no probs until I put the php tags around it... And putting them in at the other end (in the included file) doesn't work either.
  18. So I'd like to be able to echo php in to an include, but php really doesn't seem to like me trying to include php in an echo. Heres an example of what I've tried, hopefully you can grasp the idea of what I'm trying to do. :) Trying to echo in bit of PHP: [code]<?php $text = '<? echo $status[2] ?>'; include("/blahblah/myinclude.php") ?>[/code] Then output in to the included file: [code]<?php echo "$text"; // Text Inc ?>[/code] It doesn't like being formated like that, could somebody tell me what I'm doing wrong and how to fix it? Thanks in advance!  8)
  19. hmm, well while the file_get_contents worked to an extent it doesn't then seem to want to continue on when I link from that page. It justs sticks to what I linked the file_get_contents echo to includ... Is there a better way to do this, anyone? Thanks again for any help.
  20. Sweet! We're on the same page hehe, thats exactly what I wanted! I don't mind having the code once on the page at all, it was having it over and over again everytime I wanted a result from a different server that was just silly, hehe. Thanks alot! ;D
×
×
  • 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.