Jump to content

sstangle73

Members
  • Posts

    288
  • Joined

  • Last visited

Everything posted by sstangle73

  1. I may just not be understanding the file reader api, but When I try to run: for (var i = 0, f1, f2; f1 = files[sorted_index[i]], f2 = files[sorted_index[i+1]]; i=i+2) { var file_one; var file_two; if(f1.size < f2.size){ file_one = f1; file_two = f2; } else { file_one = f2; file_two = f1; } var file_one_contents; var file_two_contents; var reader = new FileReader(); reader.readAsText(file_one); reader.onload = readSuccess; function readSuccess(evt){ file_one_contents = evt.target.result; } var reader = new FileReader(); reader.readAsText(file_two); reader.onload = readSuccess2; function readSuccess2(evt2){ file_two_contents = evt2.target.result; } console.log(file_one_contents); console.log(file_two_contents); The console log only contains *undefined* in it. The goal of the script it two read in two CSVs and take the data from the pair of files and do some computations. Thanks!
  2. Hi, onClick on a select element, I am trying to hide or show two different table rows. It does not seem to be working on internet explorer Thanks for any help! function showMe (a, box) { document.getElementById(a).style.display = "table-row"; document.getElementById(a+"2").style.display = "table-row"; } function hideMe (a, box) { document.getElementById(a).style.display = "none"; document.getElementById(a+"2").style.display = "none"; } <tr><td><b>Account Type:</b><br><small>(If you are both a club and college coach, please select college coach)</small>:</td><td><SELECT NAME="type" size="3"><OPTION VALUE="coach" onClick="hideMe('hide', this)" >Coach/Manager</OPTION><OPTION VALUE="college_coach" onClick="showMe('hide', this)">College Coach</OPTION> </SELECT></div> </td></tr> <tr id="hide" style="display:none;"><td><b>College:</b></td><td colspan="2"><input type="text" name="college" value=""></td></tr> <tr id="hide2" style="display:none;"><td><b>Title:</b></td> <td><select name="gender" size="1"> <option VALUE="men" >Men's</option><option VALUE="women" >Women's</option><option VALUE="both" >Men's and Women's</option> </select></div> </td> <td><select name="title" size="1"><OPTION VALUE="head" >Head Coach</OPTION><OPTION VALUE="assistant" >Assistant Coach</OPTION> </select></div> </td></tr> here is the live demo if you would like to see it: http://new.maddogmania.com/application/register.php
  3. What would the headers have to be? this is what im using: $to = $email; $subject = "Mad Dog Mania Email Validation"; $message = "Test"; $from = "Mad Dog Mania <validation@maddogmania.com>"; $reply = "Steven Stangle <sstangle@maddogmania.com>"; $headers = 'From: ' . $from . "\r\n"; $headers .= 'Reply-to: ' . $reply . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; @mail($email,$subject,$message,$headers); and i get these headers on gmail:
  4. i get this as the from on gmail when trying to use php's mail is there a way to avoid this?
  5. would php mail() be the best route?
  6. I would like to do it through my site though. Many of the emails are just going to be registration conformation, but there are also emails to all the active registered people.
  7. What is the best way for sending email from PHP pages? I have two different cases, the first of single emails and then I also send bulk emails to many people at once, say 100. Obviously need to hide the email addresses from the other people. Looking for the best way to get it passed spam filters and delivered with headers that dont cause red flags. Also efficient is always preferred :]
  8. sstangle73

    email

    What is the best way for sending email from PHP pages? I have two different cases, the first of single emails and then I also send bulk emails to many people at once, say 100. Obviously need to hide the email addresses from the other people. Looking for the best way to get it passed spam filters and delivered with headers that dont cause red flags. Also efficient is always preferred :]
  9. What do you think of my new site? new.maddogmania.com It is definitely an improvement over the old maddogmania.com
  10. nevermind i just realized i had ob_end_clean(); at the end. Thanks everyone!
  11. hey all, When running this page there is no output (and no errors) not sure what is happening. any help is appreciated <?php $bigquery = "SELECT * FROM `" . $table . "` WHERE `age_group` LIKE '" . $_GET[id] . "' AND `status` LIKE 'Accepted%' ORDER BY print_name ASC"; $bigresult=mysql_query($bigquery) or die(mysql_error()); while($bigarray=mysql_fetch_assoc($bigresult)){ $id = $bigarray['id']; $result = mysql_query("SELECT * FROM `" . $roster_table . "` WHERE `id` = '" . $id . "'"); $array = mysql_fetch_array($result); $team_name = $array['team_name']; $organization = $array['organization']; $team_color = $array['team_color']; $website = $array['website']; $coach1_name = $array['coach1_name']; $coach1_phone = $array['coach1_phone']; $coach1_email = $array['coach1_email']; $coach2_name = $array['coach2_name']; $coach2_phone = $array['coach2_phone']; $coach2_email = $array['coach2_email']; for($i=1; $i<=$roster_max; $i++){ ${"player" . $i . "_number"} = $array['player' . $i . '_number']; ${"player" . $i . "_name"} = $array['player' . $i . '_name']; ${"player" . $i . "_grade"} = $array['player' . $i . '_grade']; ${"player" . $i . "_phone"} = $array['player' . $i . '_phone']; ${"player" . $i . "_email"} = $array['player' . $i . '_email']; ${"player" . $i . "_parents"} = $array['player' . $i . '_parents']; } ?> <table width="850px"> <tr><td class="title" style="width:50%;"><big><b>Team Name:</b></big></td><td class="dark"><big><? echo $team_name; ?></big></td></tr> <tr><td class="title"><big><b>Organization:</b></big></td><td class="light"><big><? echo $organization; ?></big></td></tr> <tr><td class="title"><big><b>Team Color:</b></big></td><td class="dark"><big><? echo $team_color; ?></big></td></tr> <tr><td class="title"><big><b>Club or Team Website:</b></big></td><td class="dark"><big><? echo $website; ?></big></td></tr> <tr><td colspan="2"><hr></td></tr> </table> <table width="850px"> <tr><td class="title"><b>Coach's Name</b></td><td class="title"><b>Phone Number</b></td><td class="title"><b>Email Address</b></td></tr> <tr><td class="light"><? echo $coach1_name; ?></td><td class="light"><? echo $coach1_phone; ?></td><td class="light"><? echo $coach1_email; ?></td></tr> <tr><td class="dark"><? echo $coach2_name; ?></td><td class="dark"><? echo $coach2_phone; ?></td><td class="dark"><? echo $coach2_email; ?></td></tr> <tr><td colspan="3"><hr></td></tr> </table> <table width="850px"> <tr><td class="title"><b>#</b></td><td class="title"><b>Player's Name</b></td><td class="title"><b>Graduation<br>Year</b></td><td class="title"><b>Phone<br>Number</b></td><td class="title"><b>Email Address </b></td><td class="title"><b>Parents' Names</b></td></tr> <?php for($i=1; $i<=$roster_max; $i++){ if ($i%2==0){ echo "<tr><td class=\"light\">" . ${"player" . $i . "_number"} . "</td><td class=\"light\">" . ${"player" . $i . "_name"} . "</td><td class=\"light\">" . ${"player" . $i . "_grade"} . "</td><td class=\"light\">" . ${"player" . $i . "_phone"} . "</td><td class=\"light\">" . ${"player" . $i . "_email"} . "</td><td class=\"light\">" . ${"player" . $i . "_parents"} . "</td></tr>"; } else { echo "<tr><td class=\"dark\">" . ${"player" . $i . "_number"} . "</td><td class=\"dark\">" . ${"player" . $i . "_name"} . "</td><td class=\"dark\">" . ${"player" . $i . "_grade"} . "</td><td class=\"dark\">" . ${"player" . $i . "_phone"} . "</td><td class=\"dark\">" . ${"player" . $i . "_email"} . "</td><td class=\"dark\">" . ${"player" . $i . "_parents"} . "</td></tr>"; } } ?> </table> <?php echo "<br><br>"; //$mpdf->AddPage(); } ?> Note: When the line "//$mpdf->AddPage();" is uncommented, the script will run through the big array once before throwing the error to a call to an undefined function (because $mpdf is undefined ;P) Thanks!
  12. I need the script to be accessible by non tech savy people (plus 1 and 1 does give me command line access anyway) Is there a way to make that possible?
  13. I am confused what that means?
  14. use an html meta refresh?
  15. Hey, I have a system set up where it selects from a database and sends an email to everyone. But the problem I am having is that it sends every email twice. I am not quite sure why it does that. Also, it takes the page FOREVER to load. Could someone help me to fix/optimize this code? Thanks! edit: Sometimes the browser comes back with this instead of a success message: $query="SELECT * FROM `" . $table . "` WHERE status LIKE 'Accepted%'"; $result=mysql_query($query); while($array=mysql_fetch_assoc($result)){ $coach_email = $array['coach_email']; $contact_email = $array['contact_email']; $to = $coach_email . ", " . $contact_email; $subject = $_POST["subject"]; $message = $_POST["message"]; $message = stripslashes($message); $from = "Mad Dog Mania Showcase Tournament <nstangle@maddogmania.com>"; $reply = "nstangle@maddogmania.com"; $headers = 'From: ' . $from . "\r\n"; $headers .= 'Reply-to: ' . $reply . "\r\n"; $headers .= 'BCC: blast@maddogmania.com' . "\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; mail($to,$subject,$message,$headers); } $success=true;
  16. Yeah I know it is a mess. That will have to be a project for the next rainy day. It would help if i had ever learned CSS (haha only kinda kidding) Thanks for the help!
  17. David's post seems right the -2 is because when you did the first section for next you already incremented the value by one
  18. weird for kicks try changing $yearly-- to $yearly=$yearly-1 idk thats weird why it wouldnt work
  19. the php manual has if(){ } http://php.net/manual/en/control-structures.if.php but the commenters have both. I think it is probably just a preference for easibility to read
  20. im not the best at php but shouldnt $list = $_POST["listNames"]; use ' instead of " $list = $_POST['ListNames'];
  21. what happens when you press it? What is the url of the new page?
  22. echo "<option value\"$id\">$name </option>"; needs an equal sign and the actual varible echo "<option value=\"" . $id. "\">$name </option>";
  23. name the second submit button submit 2 name="submit2" and do if(isset($_POST['submit'])){ code for first form } else if(isset($_POST['submit2'])){ code for 2nd form }
  24. the html fails on the facebook connect and alt values on images the css fails on link colors neither would effect this problem im looking at chrome, ff, safari all on win7 for some reason the copyright seems to want to beunder the box on the right so how ever low that box goes is where the navigation is. how do i get it to switch to the lowest point
  25. you could use if statements if(country=='A'){ echo "person A"; } else if(country == 'B'){ echo "person B"; } else { echo "person C"; } or are you trying to change the website? if so then use headers with if statements: http://php.net/manual/en/function.header.php
×
×
  • 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.