Jump to content

avo

Members
  • Posts

    148
  • Joined

  • Last visited

    Never

About avo

  • Birthday 01/20/1975

Contact Methods

  • MSN
    mark.a2@ntlworld.com

Profile Information

  • Gender
    Not Telling
  • Location
    staffordshire uk

avo's Achievements

Member

Member (2/5)

0

Reputation

  1. avo

    looping

    Thank you both Appriciated works a treat..
  2. avo

    looping

    Hi all Can anyone help me out please Im looping and echoing an array foreach ($colours as $hex) { echo '<td bgcolor="'.$hex.'"><input type="radio" name="bcolour" id="bcolour" value="'.$hex.'"></td>' ; } but within the loop i need to echo the table elements <tr> (4 td's from above) </tr> so at the start of the loop i need <tr> loop four times then </tr> continue doing this untill the loop is finished if the loop is finished after only two <td></td> (for example echo </tr> hope this makes sense Help appriciated.
  3. Hi Check this line mysql_connect(mysql,$username,$password); Your missing $ should be mysql_connect($mysql,$username,$password);
  4. hi Lets get this right then you have a form when the form is filled in and submitted the page that the page submits to is this one. if thats it then yes use some thing like and use the variable within the code your writing to the file. e.g
  5. Hi Have a look at this page hopefully this will get you on your way. if i understand correct you need to read the txt file then add to the end of it. http://www.tizag.com/phpT/filewrite.php Regards.
  6. sorry my mistake i get where your coming from now Interesting never tried that. Try placing the page you want to execute within a IFRAME. That way it should run as if you typed the url in the address bar on your browser. Cheers.
  7. Hi That should work just fine silly question but you sure the url is correct ? Cheers.
  8. Hi Try this <?php /*Program: email.php *Desc: PHP program that sends an email address to the DB for a mailing list. */ if(ini_get("magic_quotes_gpc") == "1") { $email = stripslashes($_POST['email']); } else { $email = $_POST['email']; } $host="localhost"; $user="removed"; $password="removed"; if(!empty($_POST['email'])) { $con = mysql_connect($host,$user,$password); $sel = mysql_select_db('thinksna_email'); //$result = mysql_query($_POST['email']); if(!$con) { echo "<h4>Error: ".mysql_error($cxn)."</h4>"; } else { mysql_query("INSERT INTO email (email, email_id, dateTime) VALUES ('$email', '' , NOW())") or die(mysql_error()); echo "$email was added to the list"; } } ?>
  9. Hi Are you reading an old session that did have a value stored .This will remain set if you have not unset it and can cause confusion. Regards.
  10. Hi There is but you would need to use javascript to do this. Regards.
  11. Hi Hope this helps put this on your main page <? for ($c = 1; $c <= 4; $c ++) {?> <form name='friends' action='thankyou.php' method='post'> <table> <tr> <td><?=$c?> Name: <input name='name<?=$c?>' type='text' size='20'> Address: <input name='address<?=$c?>' type='text' size='25'></td> </tr> <tr> <td>City: <input name='city<?=$c?>' type='text' size='15'> State: <input name='state<?=$c?>' type='text' maxlength='2' size='2'> Zip: <input name='zip<?=$c?>' type='text' maxlength='5' size='5'> </td> </tr> <tr> <td>Email: <input name='email<?=$c?>' type='text' size='20'> Phone: <input name='phone<?=$c?>' type='text' maxlength='12' size='10'><small> 555-555-5555</small> </td> </tr> </table> <? if($c != 4) { echo "<hr />"; } } //added ?> <input name="count" type="hidden" value="<?=$c?>" /> <label> <input type="submit" name="Submit" value="Send to next page" /> </label> </form> put this on your thank you page. <? for($i=1;$i< $_POST['count'];$i++) { echo 'Name :'.$_POST['name'.$i] ; echo '<br/>' ; echo 'Address :'.$_POST['address'.$i] ; echo '<br/>' ; echo 'City :'.$_POST['city'.$i] ; echo '<br/>' ; echo 'State :'.$_POST['state'.$i] ; echo '<br/>' ; echo 'Zip :'.$_POST['zip'.$i] ; echo '<br/>' ; echo 'E-Mail :'.$_POST['email'.$i] ; echo '<br/>' ; echo 'Phone :'.$_POST['phone'.$i] ; echo '<br/>' ; echo '<hr/>' ; } ?> cheers
  12. Hi Hope this starts you on what you need . <form id="form1" name="form1" method="post" action="<?=$PHP_SELF?>"> <select name="select0"> <option value="1"<? if ($_POST['select0']==1) {echo 'selected="selected"' ;} ?>>1 to 5</option> <option value="2" <? if ($_POST['select0']==2) {echo 'selected="selected"' ;} ?>>6-10</option> </select> - <select name="select1"> <? if ($_POST['select0']==1) { for($i=1;$i<=5;$i++) { echo '<option>'.$i.'</option>' ; } } if ($_POST['select0']==2) { for($i=6;$i<=10;$i++) { echo '<option>'.$i.'</option>' ; } } ?> </select> <br /> <br /> <input type="submit" name="Submit" value="Submit" /> </form>
  13. Hi Thank you Appreciated.
  14. Hi This looks like it is working well can anyone just have a quick look to see if im missing anything You was correct i did need two statements. This is what i ended up with //check to see if there any over due dates $date_query = mysql_query ("SELECT cal_due FROM serials WHERE cal_due < NOW() ORDER BY cal_due ASC LIMIT 1") or die (mysql_error()); $cal_due=mysql_fetch_array($date_query) ; if(empty($cal_due['cal_due'])) { //if not do the future dates and select the closest to NOW() $date_query = mysql_query ("SELECT cal_due FROM serials WHERE cal_due >= NOW() ORDER BY cal_due ASC LIMIT 1") or die (mysql_error()); $cal_due=mysql_fetch_array($date_query) ; } echo $cal_due['cal_due'] ; [code/]
  15. Hi All if i have lots of dates in a sql table formated like 2008-10-01 How would i write a sql function please to allow me to get the closest date to NOW() or if there is one the date in the past and forget the future date closest to NOW() Thanks in advance.
×
×
  • 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.