Jump to content

CasperCaro

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by CasperCaro

  1. OK sorry <?php for($i = 0; $i < $rows; $i++) { ?> <tr> <?php for($j = 0; $j < $columns; $j++) { //$R1[$i]='checked'; echo "<TD><font color='8678E9'>" . $data[$i + ($j * $rows)] . "</font></TD>\n"; ?> <td><input type='checkbox' name="R1[]" method="POST" <?php //if(isset($R1)){$R1='checked'; echo $R1;} //elseif(!isset($R1)){$R1="unchecked"; echo $R1;} ////if($R1[$i]=="checked"){$R1[$i]=="checked"; echo $R1[$i];} ////elseif($R1[$i]=="unchecked"){$R1[$i]="unchecked"; echo $R1[$i];}?> <?php //if(isset($R1[$i])){$R1[$i]="checked"; echo $R1[$i];} //elseif(!isset($R1[$t])){$R1[$t]="unchecked"; echo $R1[$t];} $t++;?> <?php if (!isset($R1)){$Value='unchecked'; echo $Value;} elseif(isset($R1)){$Value='checked'; echo $Value;}?> method="POST"><br></td> <td><?php echo"<TD><font color='3923D6'><font size=4>" . $data2[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data4[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data5[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td align="centre"><input type="checkbox" name="ch1[]" method="POST" value=<?php echo $data3[$i + ($j * $rows)]?>,1 >M<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,2 method="POST">Tu<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,3 method="POST">W<br> <input type="checkbox" name="ch4[]" <?php if (!isset($ch4)){$Value='unchecked'; echo $Value;} elseif(isset($ch4)){$Value='checked'; echo $Value;}?> value=<?php echo $data3[$i + ($j * $rows)]?>,4 method="POST">Th<br></td> <td align="centre"><input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,5 method="POST">F<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,6 method="POST">Sa<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,7 method="POST">Su<br></td> <?php echo"<TD><font color='3923D6'><font size=4>" . $data6[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td style='font-weight: bold; text-align: left;'><font color='8678E9'>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</font></td> <?php } echo "</TR>\n"; } echo "</TABLE>\n"; echo "<br>"; if(isset($R1)){ echo "R1 chkbox set - havent gone into submitok check"; echo "<br>"; echo $R1; echo "<br>"; //echo $value; //echo "<br>"; echo $size=count($R1); echo "<br>"; $i = 0; while ($i < $size) { echo $R1[0]; echo "<br>"; ++$i; } } echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; if (isset($ch4)){ echo "CHECKBOX SET"; echo "split the RN and DC - havent gone into submitok check"; echo "<br>"; echo $ch4; echo "<br>"; echo $size=count($ch4); echo "<br>"; $i = 0; while ($i < $size) { echo $ch4[$i]; echo "<br>"; ++$i; } //$ch4==checked; } echo "<br>"
  2. I have been mucking around for ages with this and still cant work out what im doing wrong! Please if anyone can see whats wrong, or may have suggestion id really appreciate it. I changed code slightly to <?php for($i = 0; $i < $rows; $i++) { ?> <tr> <?php for($j = 0; $j < $columns; $j++) { //$R1[$i]='checked'; echo "<TD><font color='8678E9'>" . $data[$i + ($j * $rows)] . "</font></TD>\n"; ?> <td><input type='checkbox' name="R1[]" method="POST" <?php //if(isset($R1)){$R1='checked'; echo $R1;} //elseif(!isset($R1)){$R1="unchecked"; echo $R1;} ////if($R1[$i]=="checked"){$R1[$i]=="checked"; echo $R1[$i];} ////elseif($R1[$i]=="unchecked"){$R1[$i]="unchecked"; echo $R1[$i];}?> <?php //if(isset($R1[$i])){$R1[$i]="checked"; echo $R1[$i];} //elseif(!isset($R1[$t])){$R1[$t]="unchecked"; echo $R1[$t];} $t++;?> <?php if (!isset($R1)){$Value='unchecked'; echo $Value;} elseif(isset($R1)){$Value='checked'; echo $Value;}?> method="POST"><br></td> <td><?php echo"<TD><font color='3923D6'><font size=4>" . $data2[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data4[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data5[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td align="centre"><input type="checkbox" name="ch1[]" method="POST" value=<?php echo $data3[$i + ($j * $rows)]?>,1 >M<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,2 method="POST">Tu<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,3 method="POST">W<br> <input type="checkbox" name="ch4[]" <?php if (!isset($ch4)){$Value='unchecked'; echo $Value;} elseif(isset($ch4)){$Value='checked'; echo $Value;}?> value=<?php echo $data3[$i + ($j * $rows)]?>,4 method="POST">Th<br></td> <td align="centre"><input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,5 method="POST">F<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,6 method="POST">Sa<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,7 method="POST">Su<br></td> <?php echo"<TD><font color='3923D6'><font size=4>" . $data6[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td style='font-weight: bold; text-align: left;'><font color='8678E9'>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</font></td> <?php } echo "</TR>\n"; } echo "</TABLE>\n"; echo "<br>"; if(isset($R1)){ echo "R1 chkbox set - havent gone into submitok check"; echo "<br>"; echo $R1; echo "<br>"; //echo $value; //echo "<br>"; echo $size=count($R1); echo "<br>"; $i = 0; while ($i < $size) { echo $R1[0]; echo "<br>"; ++$i; } } echo "<br>"; echo "<br>"; echo "<br>"; echo "<br>"; if (isset($ch4)){ echo "CHECKBOX SET"; echo "split the RN and DC - havent gone into submitok check"; echo "<br>"; echo $ch4; echo "<br>"; echo $size=count($ch4); echo "<br>"; $i = 0; while ($i < $size) { echo $ch4[$i]; echo "<br>"; ++$i; } //$ch4==checked; } echo "<br>" and the output is array(3) { ["R1"]=> array(1) { [0]=> string(2) "on" } ["ch4"]=> array(1) { [0]=> string(4) "56,4" } ["submitok"]=> string(28) "SAVE Days and Recipes Chosen" } R1 chkbox set - havent gone into submitok check Array 1 on CHECKBOX SETsplit the RN and DC - havent gone into submitok check Array 1 56,4 im thinking theres something the matter with my $R1 array - or attempt at array I thought R1 would be 'checked' NOT 'on' ??? also it is checking every checkbox, i thought it would only REPORT a check on the checkbox that i entered a check against??? Would REALLY appreciate any help - thanks
  3. I am wondering how to keep a checkbox checked? I have the folllowing code and it is outputting the correct info, but when i tick checkbox, and then click box "SAVE Days and Recipes Chosen" the checkbox doesn't get set. <?php for($i = 0; $i < $rows; $i++) { ?> <tr> <?php for($j = 0; $j < $columns; $j++) { echo "<TD><font color='8678E9'>" . $data[$i + ($j * $rows)] . "</font></TD>\n"; ?> <td><input type='checkbox' name=$R1 <?php if($R1=="checked"){$R1=="checked"; echo $R1;} elseif($R1=="unchecked"){$R1=="unchecked"; echo $R1;} ?> <td><?php echo"<TD><font color='3923D6'><font size=4>" . $data2[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data4[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <?php echo"<TD align='center'><font color='3923D6'><font size=4>" . $data5[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td align="centre"><input type="checkbox" name="ch1[]" method="POST" value=<?php echo $data3[$i + ($j * $rows)]?>,1 >M<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,2 method="POST">Tu<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,3 method="POST">W<br> <input type="checkbox" name="ch4[]" <?php if (!isset($ch4)){$Value='unchecked'; echo $Value;} elseif(isset($ch4)){$Value='checked'; echo $Value;}?> value=<?php echo $data3[$i + ($j * $rows)]?>,4 method="POST">Th<br></td> <td align="centre"><input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,5 method="POST">F<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,6 method="POST">Sa<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,7 method="POST">Su<br></td> <?php echo"<TD><font color='3923D6'><font size=4>" . $data6[$i + ($j * $rows)] . "</TD>\n"; ?></font></td> <td style='font-weight: bold; text-align: left;'><font color='8678E9'>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</font></td> <?php } echo "</TR>\n"; } echo "</TABLE>\n"; echo "<br>"; It is the following part that i cuurently need help with <td><input type='checkbox' name=$R1 <?php if($R1=="checked"){$R1=="checked"; echo $R1;} elseif($R1=="unchecked"){$R1=="unchecked"; echo $R1;} ?> I haven't looked at the other checkbox part of <td align="centre"><input type="checkbox" name="ch1[]" method="POST" value=<?php echo $data3[$i + ($j * $rows)]?>,1 >M<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,2 method="POST">Tu<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,3 method="POST">W<br> <input type="checkbox" name="ch4[]" <?php if (!isset($ch4)){$Value='unchecked'; echo $Value;} elseif(isset($ch4)){$Value='checked'; echo $Value;}?> value=<?php echo $data3[$i + ($j * $rows)]?>,4 method="POST">Th<br></td> <td align="centre"><input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,5 method="POST">F<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,6 method="POST">Sa<br> <input type="checkbox" name="ch1[]" value=<?php echo $data3[$i + ($j * $rows)]?>,7 method="POST">Su<br></td> Appreciate any suggestions
  4. Never mind - i looked on Javascript forum and can't send emails via JS and what's being sent is a link to page, not the page itself, so it will change. So original question/post is pertinent one. How to automatically get $menu filled in(on Form B) from form A. If any one has suggestion, much appreciated.
  5. I thought this might be tricky - and it's proving to be! I'll ask a related question, but slightly different. I fund the following code <script language="javascript"> function mailpage() { mail_str = "mailto:?subject= Doc JavaScript: " + document.title; mail_str += "&body= I recommend Doc JavaScript's (docjavascript.com) tip -- " + document.title; mail_str += ". You should check this out at, " + location.href; location.href = mail_str; } </script> Somewhere on the page you need to provide a link that calls the above function, like this: <A HREF = "javascript:mailpage()">E-mail This Page</A> E-mail This Page and it would be fine except that my website requires a login. If the user stays logged in then the page from above code is fine and it shows what i want but then it changes when the user logs out. So my question is - not being familiar too much with javascript is there a code like " + location.href; that would give a static page (this one changes as i mention above) ?? thanks
  6. Hi there, ths is my very first post to this site so thanks in advance for reading and suggesting. (And apologies if this is not correct forum) I have a website that generates some output ( onto website File A). I want to email this output that's generated to a users (inputted) email address. I cant quite work out how to get that output into the email. I can cut and paste (into $menu variable in file B) but i want to have it done automatically. So far i have the following code (and maybe there's an easier way/ better way), but this is what i have so far. in file A, I have the PHP/MySQL generated output and an "email" icon that displays ( <input type='image' onClick='myPopup()' img src='email1.jpg' alt='' width='100' height='100' vspace='5' border='10' align='left' ALT='Email' value='Email' /> ) this redirects to file B (which pops up and asks for the email address to send generated output of file A to) when user clicks email button.. It seems from my investigations so far that I somehow have to get it into $menu variable of file B but am unsure how, or if there is another way (to how i'm trying)? In IE7 under Page dropdown, there's an option to 'Send page by -Mail...' this is what i want mine to do Could someone have a look and see if there's something I could try - thanks very much file B = <html> <head> <link rel="stylesheet" type="text/css" media="all" href="style.css"/> <title> Email menu </title> </head> <body> <h3><p align="center"><u>Email menu & nutritional information</u></p></h3> <br><br><br> <?php echo "<br>"; echo "<br>"; echo "<br>"; ?> <p><font color="orangered" size="+1"><tt><b>*</b></tt></font> indicates a required field</p> <form method="post" action="<?php echo $_SERVER['PHP_SELF']?>"> <table border="0" cellpadding="0" cellspacing="5"> <tr> <td align="right"> <p>Email </p> </td> <td> <input name="email" type="text" maxlength="50" size="40" /> <font color="orangered" size="+1"><tt><b>*</b></tt></font> </td> </tr> <tr> <td align="right" colspan="2"> <hr noshade="noshade" /> <input type="reset" value="Reset Form" /> <input type="submit" name="submitok" value="EMAIL menu" onClick="javascript:window.close();"/> </td> </tr> </table> <?php $menu="if i cut and paste file A content, it does send but i want automated"; if (isset($_POST['submitok'])){ $message = "Your menu and the nutritional information for that menu below $menu; Kind regards, "; mail($_POST['email'],"Your menu",$message); Header("Location: print_menu_restrict.php"); } ?> </body> </html>
×
×
  • 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.