Jump to content

Ch0cu3r

Staff Alumni
  • Posts

    3,404
  • Joined

  • Last visited

  • Days Won

    55

Everything posted by Ch0cu3r

  1. I think how some websites send out mass emails is to send them in batches, like 500 emails at a time. The email script will then pause a minute, then send the next batch of 500. This is most probably handled with a scheduled task/cron job. Doing this should reduce the load on the server.
  2. $rows['$access'] should be $rows[$access] (no quotes round $access var)
  3. When giving fields in a form the same name you need to add [] (square brakets) after the name, eg name="file[]". When the form is submitted the the $_FILES superglobal will be an array of uploaded files. If you dont add the [] in the name then only the last file will be uploaded. This is how your file fields should be named <input type="file" name="file[]" id="acceptletter" onchange=checkFile(this) required value=""></td> <input type="file" name="file[]" id="turnitin" onchange=checkFile(this) required value=""></td> <input type="file" name="file[]" id="paperindex" onchange=checkFile(this) > <br />/ Link : <input type="text" name="paperindexurl" size="30" /></td> <input type="file" name="file[]" id="reviewerReport" onchange=checkFile(this) required value=""></td> Now the code for looping over the uploaded files should work.
  4. Post your full code here. The snippet of code you posted doesn't really help to solve the issue you just mentioned.
  5. Ok. Umm,Have you modified form_process.php? As I have tested the code but I cant seem to reproduce that error. I get Email-adressen finns redan! if there is duplicate email address found I have edited form_process.php to output debug information. When the form is submitted a red box should appear post the debug info here <pre style="border:2px solid red;"> <?php //MySQL Information: $mysql_host = "localhost"; //Host Name $mysql_user = "root"; //Username $mysql_pass = "root"; //Password $mysql_db = "test"; //Database //General Configuration: $account_max = "10"; //Maximum size per account (MB) $admin_notify = 0; //1 = yes & 0 = no $admin_email = "email@Website.se"; //Administrators email to send notifications) $admin_default_activate = 1; //1 = yes & 0 = no -> If no, the administrator has to authorise the account $encryption = 2; //Password encryption level //DO NOT EDIT BELOW!// echo "DEBUG: Posted Info\n\nPOST " . print_r($_POST, true); // Protect the Database and MD5 the password. $strName = addslashes( $_POST['name'] ); $strUser = addslashes( $_POST['user'] ); $strDomain = addslashes( $_POST['domain'] ); $strPass1 = addslashes( $_POST['pass1'] ); $strMD5Pass = md5( $strPass1 ); $kod = addslashes( $_POST['kod'] ); error_reporting(E_ALL ^ E_NOTICE); //Next two lines connect to database using information from above. $open = mysql_connect($mysql_host, $mysql_user, $mysql_pass); $select = mysql_select_db($mysql_db); $open = $select = true; IF (!$open || !$select) { echo 'Databasfel! Felkod: "DB_NoConn"'; } ELSE { echo "DEBUG: Querying hm_domains for domain id\n\n"; // DEBUG //#### PAGE IF FORM FILLED OUT ####// $q=mysql_query("SELECT * FROM `hm_domains` WHERE `domainid` = '{$strDomain}' LIMIT 1"); //Load Domain Into memory (internal use) WHILE ($v=mysql_fetch_array($q)) { $temp_domain = $v['1']; echo "RESULT: `domainid` = '{$strDomain}' Found $temp_domain\n\n"; } //Apply information if(!isset($temp_domain) echo "DEBUG: $strDomain (\$strDomain) not found in hm_domains\n\n"; // DEBUG echo "DEBUG: Querying hm_accounts to see if email address exists ({$strUser}@$temp_domain)\n\n"; $q2=mysql_query("SELECT * FROM `hm_accounts` WHERE `accountaddress` = '{$strUser}@$temp_domain' LIMIT 1"); //Check if account exists $v2=mysql_num_rows($q2); //Gets number of accounts that exist with that profile (should be less than or equal to one)*/ IF ($v2 == 1) { echo "DEBUG: email address exists! ({$strUser}@$temp_domain)\n\n"; //DEBUG echo "<span style=\"color:red\">Email-adressen finns redan! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; } ELSE { echo "DEBUG: email address ok!\n\n"; // DEBUG IF (!$_POST['pass1'] || !$_POST['pass2']) { echo "<span style=\"color:red\">Du fyllde inte i båda lösenorden! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; } ELSEIF ($_POST['pass1'] <> $_POST['pass2']) { echo "<span style=\"color:red\">Lösenorden matchade inte varandra! <a href=\"javascript:history.go(-1)\">Tillbaka</a><br /></span>"; } ELSE { echo "DEBUG: Email fine add account to hm_accounts\n\n"; // DEBUG $q3=mysql_query("INSERT INTO `hm_accounts` (`accountdomainid`,`accountaddress`,`accountpassword`,`accountactive`,`accountisad`,`accountmaxsize`,`accountpwencryption`,`kod`) VALUES ('1','$strUser@Website.se','$strMD5Pass','$admin_default_activate','0','$account_max','$encryption','$kod')") or die("DEBUG:\n\tMYSQL Error: " . mysql_error()); } } IF ($q3) { echo "DEBUG: Account created!\n\n"; // DEBUG IF ($admin_default_activate == 0) { echo "<span style=\"color:green\">Ditt konto är skapat, <b>men kräver att administratören aktiverar det.</b> Du får snart en bekräftelse om detta.</span>"; } ELSE { echo "DEBUG: Display modal\n\n"; // DEBUG echo " <div id=\"modal\"> <div id=\"heading\"> Ditt mailkonto är aktiverat! </div> <div id=\"boxcontent\"> <p> <b>Uppgifter:</b><br /> Email: $strUser@Website.se<br /> Lösenord: (Dolt av säkerhetsskäl) </p> <a href=\"#\" class=\"button red close\"><img src=\"popup/images/cross.png\">Stäng</a> </div> </div> "; $subject = "<span style=\"color:green\">Välkommen till Website!</span>"; $message = "<span style=\"color:green\">Detta är en bekräftelse på att ditt email-konto är skapat.</span>"; //mail("$strUser@Website.se", $subject, $message); //Send welcome message } } ELSE { //echo "<span style=\"color:red\">Database fel, kunde inte skapa email-kontot. Kontakta administratören!</span>"; } IF ($admin_default_activate == 0 && $admin_notify == 0) { $admin_mail_subject = "Account Requires Activation!"; $admin_mail_message = "{$_POST['user']}@$temp_domain has been created by {$_POST['name']} and needs to be activated!"; mail($admin_email, $admin_mail_subject, $admin_mail_message); } ELSEIF ($admin_default_activate == 1 && $admin_notify == 1) { $admin_mail_subject = "New Account Created!"; $admin_mail_message = "{$_POST['user']}@$temp_domain has been created by {$_POST['name']}!"; mail($admin_email, $admin_mail_subject, $admin_mail_message); } ELSEIF ($admin_default_activate == 0 && $admin_notify == 1) { $admin_mail_subject = "New Account Created!"; $admin_mail_message = "{$_POST['user']}@$temp_domain has been created by {$_POST['name']}!"; mail($admin_email, $admin_mail_subject, $admin_mail_message); } //#### KOD SOM VISAS OM FÄLTEN INTE ÄR IFYLLDA ####// echo " "; } ?></pre>
  6. If you have your PHP script on your website. Then you shouldn't need to configure the SMTP server, as your webhost should have this all set-up for you. In order for your PHP script to work there is 3 steps it requires you to do. Read lines 52 to line 55. Then set lines 56 - to 58 to what you want them to be.
  7. I assume you have the $fruit = array(...) code wrapped in <?php and ?> tags? If you have then you you've almost got it. The <?php $fruit ?> should be <?php echo $fruit ?>. If you want to set the value="" for each option, eg ap, ba, ga etc. Then the foreach loop construct needs to be foreach ($fruits as $key => $fruit) to retrieve the key value pairs from the $fruits associative array. Now you can do <option value="<?php echo $key; ?>"> to set each options value Corrected code <?php $fruits = array( "--" => "---Please Select a Fruit ---", "ap" =>"Apple", "ba" =>"Banana", "ga" =>"Grapes", "wa" =>"Watermelon", "pe" =>"Pear" ); ?> <fieldset> <legend> Fruits</legend> <select name = "fruits"> <?php foreach ($fruits as $key => $fruit){ ?> <option value = "<?php echo $key ?>"><?php echo $fruit ?></option> <?php } ?> </select> </fieldset>
  8. Because the body= part will override the signature you have defined in Outlook. You'll have to add the signature in manually. The mailto: clause can only set the recipients address(s), bcc/cc address(s), subject and the body. It can't do advanced features like adding signatures you have defined in your email client. That you'll have to do manually before clicking send.
  9. The only query I see using the #__eb_field_values table is this query $sql = 'SELECT registrant_id, field_id, field_value FROM #__eb_field_values WHERE registrant_id IN ('.implode(',', $registrantIds).')'; Not sure but add " field_id=4 AND " (without the quotes) before registrant_id IN
  10. I have no idea? Dreamweaver is good for HTML/CSS etc but when it comes to php code just no. It can do something for you but the code it injects is bloated, not required and makes debugging the php code difficult when the code doesn't work. If you want to code in php click the code/source tab and start coding, dont expect the editor to do everything for you. Stay way from design view when programming your php script. Read the tutorials above, learn the code and try to implement to your script. You'll learn to code much better this way.
  11. In order for an image to display on a webpage you need to use the html image tag (<img src="path/to/image" />). If they are doing this then you cannot make the image a link. You can only display an image with the <img /> tag, not render html. When someone links to an image on another website without your consent this is called image hot linking. You will want to search google for anti image hotlinking techniques to stop them seeing the image and tell them to go to your website instead.
  12. This tutorial is a start http://www.sitepoint.com/form-validation-with-php/ If you're using PHP version 5.2 or greater your can use the built in validation/sanitization filters http://www.php.net/manual/en/book.filter.php
  13. Change this line if ((!$email)) to if (!isset($_POST['email'])) This may prevent the All fields required message from showing but it is not checking if all form fields are filled in to your requirements, such as making sure their entered email address is an email address, phone number is in the valid format etc. You need to check each posted value individually and validate each input and make sure it is safe to use. This is called form validation. There are many tutorials that cover this.
  14. I'd just have it return the user_id and not COUNT(`user_id`). Then mysqli_num_rows should work as expected.
  15. What do you mean by this? What are expecting the formsend.php to do? What is happening when you submit the form. Any errors shown? Where are you running formsend.php? What have done to try and solve the problem?
  16. Why not you make one yourself. We're not going to make stuff for you. There has got literately thousands of these types of scripts floating around.
  17. Everything you need to know about PHP is in the manual. This is the first place you should go for help. The manual
  18. No by smtp i mean the mail server you're using to send emails. PHP needs to configured to use a mail sever to send emails
  19. The line here $.post('data.php', { name: form.name.value }, Specifically the form.name.value part is looking for a form with the id of form and a field within that form named as name. This is how you'll get the selected value from the select menu using JQuery. $.post('data.php', { name: $('select[name=genetics]').val() },
  20. Sorry meant to say the value of $x each time on line 7. Thats why you get long list of numbers. Also not need to spam your post with an image
  21. Add else { $yourname = ''; $youremail = ''; $yourmessage = ''; $answer = ''; } after line 86. For your PHP script to send emails with the mail() function you'll need to configure the php.ini file with your SMTP server address
  22. You need to save the file in C:\wamp\(www or htdocs) folder (which ever one exists) and make sure it has .php extension. Start wampserver, should be an icon in the system tray near the clock, I thinks it a green W or a green semi-colon. if its not green left click it and click start Apache server. If its green then open your browser and go to http://localhost/filename.php to run your php script. Also make sure Widows is not hiding file extensions. Open Windows Exporer window in any folder and go to Organise > Folder and Search options > View > Untick "Hide extensions for known file types". Click Ok.
  23. Need more info. When/Where do you want the sql query to run? What is your script doing at them moment, what do you want it to do? What steps have you taken to implement this yourself
  24. You need to install a http server configured with php to run php code locally. If you're on linux then install Apache and PHP from your linux distros package manager. If you're on mac then you can install MAMP. If you're on windows install WAMP.
  25. Because you're echo'ing out the sum each time.
×
×
  • 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.