Jump to content

downah

Members
  • Posts

    127
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

downah's Achievements

Member

Member (2/5)

0

Reputation

  1. download it and upload all contents on your webserver.. should be fine.. show us where you uploaded it so we can see the errors
  2. Got the jquery to work! seemed to be missing the url helper for the base_url I think so I added the full url and voila! this can be closed
  3. Hi guys, finally codeigniter seems to make a little sense when I gave it another go making a simple project and learning individual things to get there as opposed to just following the “blog tutorial”.. However I am trying to submit a form and do it through ajax/jquery so that the other page doesn’t show and everything happens in one page. This is from my view where the form and jquery is: jquery: <script> $(function(){ $("#form-signin").submit(function(){ dataString = $("#form-signin").serialize(); $.ajax({ type: "POST", url: "<?php echo base_url(); ?>index.php/welcome/addmovie", data: dataString, success: function(data){ alert('Successful!'); } }); return false; //stop the actual form post !important! }); }); </script> form: <form class="form-signin" method="post" id="form-signin"> <h4 class="form-signin-heading">Add a Movie</h4> <input type="text" class="input-block-level" placeholder="Movie Title"> <input type="text" class="input-block-level" placeholder="URL"> <input type="number" class="" min="1" max="100" placeholder="Jamies Score"> <input type="number" class="" min="1" max="100" placeholder="Kellys Score"> <button class="btn btn-large btn-primary" type="submit">Add</button> </form> It seems nothing happens when you click the submit button and I’ve put the script at the bottom of the page just before </body> as it seems when I put it under the form it doesn’t load the rest of the code below it? I am very new with jquery so please be kind. I don’t have anything in the script which the jquery should load (public function addmovie in the welcome controller) so it should return successfully I think? I hope someone can help me out! PS Using this tutorial: http://optimiseblog....niter-and-ajax/
  4. make sure you have <?php session_start(); ?> at the top of every page BEFORE anything else
  5. I am getting the same malware warning on your web page, why is it redirecting to verygoods-2014.ru ?? if your files really have nothing to do with that then u might want to call up your host and check your server
  6. You are very lucky! I live in the UK too you must have a VERY impressive CV?
  7. Think about it logically, how does this script work and what do you need? To add news you need a page, with a text input for subject, a text area for content in a form with a submit button, this links up to a php script which then in return takes those values from the previous form, and puts them in the database. You need a page which displays news, this will contain a looper that gets all news out the database and displays it. You need a script on cron job (timed on the server) so that the script will run at a specific time every day (to move news to old news) And from there you can start building more exciting features like editing and deleting news etc a fancy text area maybe?
  8. put somewhere at the end of the script echo $fullname; echo $password; And see if you are actually getting out the right values in the variable
  9. Hi guys, Small (or big) problem once again I am using a simple html form, on submit action calls a php (mail) script.. now this script takes a little while to finish as there are some time limits in there before sending another mail.. I expected it to load a blank page, or at least display everything before loop.. but it didn't, instead it sort of "hangs" at the form stuck (although you can see the url of the script is loading in the browser bar) and once the script is finished it loads all the output on the page.. so I started looking at some ways of how to make this loading image.. or atleast let the user know something is happening, and that the script is working. I saw some stuff on stackover flow and included this, which was supposed to show a loading image where the submit button is, but I don't think it works because it isn't loading the page with the form anymore.. but the running the php loop, although I am going to let you see it anyway in the hope of.. something: $('#loading_image').show(); // show loading image, as request is about to start $.ajax({ url: '..', type: '..', complete: function() { // request is complete, regardless of error or success, so hide image $('#loading_image').hide(); } }); $('#myform').submit(function() { $('#loading_image').show(); // show animation return true; // allow regular form submission }); and my form <form method="post" action="sendeveryone.php" id="myform" onReset="return confirm('Do you really want to reset the form?')"> <fieldset> Please note: All e-mails start with "Dear {MEMBER_NAME}, " If you would like to mention their username in the body of your email, all you have to do is type '{MEMBER_NAME}' and it will replace it to their username.<br><br> <br> <label class="control-label" for="subject">Subject</label> <input id="subject" name="subject" class="span5" type="text"> <label class="control-label" for="body">Body</label> <div class="row-fluid"> <div class="utopia-widget-content-nopadding"> <div class="span12 text-editor"> <textarea id="input" name="input"></textarea> </div> </div> </div> <br><img src="myloadingimage.gif" style="display: none;" id="loading_image"> <button class="btn btn-large btn-primary span5" type="submit">Send</button> <button class="btn btn-large span5" type="reset">Cancel</button> </fieldset> </form> This didn't work.. anyone has any hints or tips for me or other ways of going around this?
  10. I just got my script working.. I'll post it here: <?php // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/mail/config.php'); // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/mail/lib/MailClass.inc'); //set execution time limit to 5 minutes $safeMode = ( @ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1 ) ? TRUE : FALSE; if ( $safeMode === FALSE ) { set_time_limit(300); // Sets maximum execution time to 5 minutes (300 seconds) // ini_set("max_execution_time", "300"); // this does the same as "set_time_limit(300)" } echo "max_execution_time " . ini_get('max_execution_time') . "<br>"; //db connection $con = mysql_connect("xx","xx","xx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xx", $con); // Setup body $textBody = "Dear {MEMBER_NAME},\n\nCheck out PHP Freaks: http://www.phpfreaks.com\n\nSincerely,\nAdmin"; $htmlBody = "Dear {MEMBER_NAME},<br /><br />Check out PHP Freaks: http://www.phpfreaks.com<br /><br />Sincerely,<br />Admin"; // instantiate the class $mailer = new FreakMailer(); // Get the user's Email $sql = mysql_query("SELECT displayname,email FROM engine4_users2")or die(mysql_error()); //lets reset the time limit of the server everytime an email is sent to bypass maximum while (1==1) { set_time_limit(30); // sets (or resets) maximum execution time to 30 seconds) // .... put code to process in here while($row = mysql_fetch_object($sql)) { // Send the emails in this loop. $member_name = $row->displayname; $mailer->AddAddress($row->email); $mailer->Body = str_replace('{MEMBER_NAME}', $member_name, $htmlBody); $mailer->IsHTML(true); $mailer->AltBody = str_replace('{MEMBER_NAME}', $member_name, $textBody); $mailer->Send(); $mailer->ClearAddresses(); $mailer->ClearAttachments(); $mailer->IsHTML(false); echo "Mail sent to: " . $member_name . "<br />"; } usleep(1000000); // sleep for 1 million micro seconds - will not work with Windows servers / PHP4 // sleep(1); // sleep for 1 seconds (use with Windows servers / PHP4 if (1!=1) { break; } } ?> Just change the query, and follow the tutorial in my thread and you'll get it If not let me know and I'll help you!
  11. Got it working, incase anyone else is wondering here is the working code: <?php // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/mail/config.php'); // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/mail/lib/MailClass.inc'); //set execution time limit to 5 minutes $safeMode = ( @ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1 ) ? TRUE : FALSE; if ( $safeMode === FALSE ) { set_time_limit(300); // Sets maximum execution time to 5 minutes (300 seconds) // ini_set("max_execution_time", "300"); // this does the same as "set_time_limit(300)" } echo "max_execution_time " . ini_get('max_execution_time') . "<br>"; //db connection $con = mysql_connect("xx","xx","xx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xx", $con); // Setup body $textBody = "Dear {MEMBER_NAME},\n\nCheck out PHP Freaks: http://www.phpfreaks.com\n\nSincerely,\nAdmin"; $htmlBody = "Dear {MEMBER_NAME},<br /><br />Check out PHP Freaks: http://www.phpfreaks.com<br /><br />Sincerely,<br />Admin"; // instantiate the class $mailer = new FreakMailer(); // Get the user's Email $sql = mysql_query("SELECT displayname,email FROM engine4_users2")or die(mysql_error()); //lets reset the time limit of the server everytime an email is sent to bypass maximum while (1==1) { set_time_limit(30); // sets (or resets) maximum execution time to 30 seconds) // .... put code to process in here while($row = mysql_fetch_object($sql)) { // Send the emails in this loop. $member_name = $row->displayname; $mailer->AddAddress($row->email); $mailer->Body = str_replace('{MEMBER_NAME}', $member_name, $htmlBody); $mailer->IsHTML(true); $mailer->AltBody = str_replace('{MEMBER_NAME}', $member_name, $textBody); $mailer->Send(); $mailer->ClearAddresses(); $mailer->ClearAttachments(); $mailer->IsHTML(false); echo "Mail sent to: " . $member_name . "<br />"; } usleep(1000000); // sleep for 1 million micro seconds - will not work with Windows servers / PHP4 // sleep(1); // sleep for 1 seconds (use with Windows servers / PHP4 if (1!=1) { break; } } ?> I realized it is sending one email by one, so you can add an address without the others seeing one..
  12. So I got further.. mails are sending out, although all the mails are being sent to the first person in the loop, but showing the right names.. <?php // Grab our config settings require_once($_SERVER['DOCUMENT_ROOT'].'/mail/config.php'); // Grab the FreakMailer class require_once($_SERVER['DOCUMENT_ROOT'].'/mail/lib/MailClass.inc'); //set execution time limit to 5 minutes $safeMode = ( @ini_get("safe_mode") == 'On' || @ini_get("safe_mode") === 1 ) ? TRUE : FALSE; if ( $safeMode === FALSE ) { set_time_limit(300); // Sets maximum execution time to 5 minutes (300 seconds) // ini_set("max_execution_time", "300"); // this does the same as "set_time_limit(300)" } echo "max_execution_time " . ini_get('max_execution_time') . "<br>"; //db connection $con = mysql_connect("xxt","xx","xx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xx", $con); // Setup body $textBody = "Dear {MEMBER_NAME},\n\nCheck out PHP Freaks: http://www.phpfreaks.com\n\nSincerely,\nAdmin"; $htmlBody = "Dear {MEMBER_NAME},<br /><br />Check out PHP Freaks: http://www.phpfreaks.com<br /><br />Sincerely,<br />Admin"; // instantiate the class $mailer = new FreakMailer(); // Get the user's Email $sql = mysql_query("SELECT displayname,email FROM engine4_users2")or die(mysql_error()); //lets reset the time limit of the server everytime an email is sent to bypass maximum while (1==1) { set_time_limit(30); // sets (or resets) maximum execution time to 30 seconds) // .... put code to process in here while($row = mysql_fetch_object($sql)) { // Send the emails in this loop. $member_name = $row->displayname; $mailer->AddBCC($row->email); $mailer->Body = str_replace('{MEMBER_NAME}', $member_name, $htmlBody); $mailer->IsHTML(true); $mailer->AltBody = str_replace('{MEMBER_NAME}', $member_name, $textBody); $mailer->Send(); $mailer->ClearAddresses(); $mailer->ClearAttachments(); $mailer->IsHTML(false); echo "Mail sent to: " . $member_name . "<br />"; } usleep(1000000); // sleep for 1 million micro seconds - will not work with Windows servers / PHP4 // sleep(1); // sleep for 1 seconds (use with Windows servers / PHP4 if (1!=1) { break; } } ?>
  13. Haha but I linked that thread to myself.. he is a bit further behind than I am it seems so looking at that thread doesnt really help.. Like I said I can send single emails but now trying this script for sending to all my emails in the database.. the emails are not being sent, although the script says the emails are successfully sent..
  14. Correct me if I'm wrong but something like this is probably done with ajax? Just trying to think logically that you would need to refresh the page some how to create the new text boxes..
  15. You might wanne look at my thread : http://forums.phpfreaks.com/index.php?topic=362077.0 and here http://www.askapache.com/php/phpfreaks-eric-rosebrocks-phpmailer-tutorial.html Good luck!
×
×
  • 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.