Jump to content

vikela

Members
  • Posts

    44
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

vikela's Achievements

Member

Member (2/5)

0

Reputation

  1. Have managed to get the other selected options shown but now the selected options are being repeated any workaround.Whats the best way forward <select multiple="true" name="user_id[]" id="the_user_id" size="6"> <?php $repeat; $finder=unserialize($info[0]['user_id']); foreach($allusers as $rows){ foreach($finder as $value){ $bigg=($rows['user_id']==$value)?'selected':NULL; if($repeat!='<option value ="'.$rows['user_id'].'" '.$bigg.'>'.$rows['user_name'].' </option>') { echo $repeat; $repeat='<option value ="'.$rows['user_id'].'" '.$bigg.'>'.$rows['user_name'].' </option>'; } } } ?> </select>
  2. Have managed to get the other selected options shown but now the selected options are being repeated any workaround? I am still fresh on PHP <select multiple="true" name="user_id[]" id="the_user_id" size="6"> <?php $repeat; $finder=unserialize($info[0]['user_id']); foreach($allusers as $rows){ foreach($finder as $value){ $bigg=($rows['user_id']==$value)?'selected':NULL; if($repeat!='<option value ="'.$rows['user_id'].'" '.$bigg.'>'.$rows['user_name'].' </option>') { echo $repeat; $repeat='<option value ="'.$rows['user_id'].'" '.$bigg.'>'.$rows['user_name'].' </option>'; } } } ?> </select> > :shrug: :o ;D :'( :'(
  3. Thanks. Did try but its no longer duplicating however its showing only 1 selected option instead of say 3.
  4. Here is the scenario..I have a database with 2 tables 1 for users contact details and the other has user comments and preferences.In the table of comments I have one field I want to contain multiple values.However, I am able to upload the multiple values(through serialize and unserialize) and retrieve them but the problem I am now having is on editing the multiple values.I am using multiple select.The following code is duplicating the users in the select menu. <select multiple="true" name="user_id[]" id="the_user_id" size="6"> <?php $finder=unserialize($info[0]['user_id']);//from comments table foreach($finder as $value) foreach($allusers as $rows){ $bigg=($rows['user_id']==$value)?'selected':NULL; echo '<option value ="'.$rows['user_id'].'" '.$bigg.'>'.$rows['user_name'].'</option>'; } ?> </select>
  5. its showing me the php server configuration settings its a PHP Version 5.2.9.
  6. now its showing a blank page..
  7. I developed a small php application and is running perfect on my local xampp server.The problem is that when i uploaded to the online(internet) server everything is not alright.I have been trying to configure the online (internet)server but no success yet.For example the following simple code.. <?php //session_start(); //error handler function function customError($errno, $errstr) { echo "<b>Error:</b> [$errno] $errstr<br />"; echo "Ending Script"; die(); } //set error handler set_error_handler("customError",E_ALL); //trigger error $prove=5; if ($prove>1) { trigger_error("Value must be 1 or below",E_ALL); } ?> is producing something like this... Error: [$errno] $errstr "; echo "Ending Script"; die(); }//set error handlerset_error_handler("customError",E_ALL);//trigger error$prove=5;if ($prove>1) { trigger_error("Value must be 1 or below",E_ALL); } >:
  8. That was the first thing before the $sendto and got no joy..
  9. I would like to send an email using the php email() function then if it does execute i.e sends i would like to update a particular field in my db.however no matter how hard i try to the code seem to defy simply logic.here is the original code i have include_once("mailer.php"); $thesend=mail($toto1,$subject1,$message,$headers); if($thesend) { $mail_went=1; $_SESSION['msgstatus']= "Mail sent to ".$toto1."<br>"; }else{ $mail_went=0; $_SESSION['msgstatus']= "Mail send failure - message not sent <br>"; } the funny part is that the code executes the else and actually gives me the Mail send failure message yet i do receive the mail in my box???? However if i do change this to be like this include_once("mailer.php"); $thesend=mail($toto1,$subject1,$message,$headers); if(!$thesend) { $mail_went=1; $_SESSION['msgstatus']= "Mail sent to ".$toto1."<br>"; }else{ $mail_went=0; $_SESSION['msgstatus']= "Mail send failure - message not sent <br>"; } ........all works perfect what am i missing.The $message is an HTMl doc and the MIME and content-type are ok. Damn
  10. from what you are saying i must say you have a trick scenario but from my research and little exprience you should try Kohana or Yii which i feel have a not so steep learning curve than Zend.
  11. Thanks you are a star!i must admit i did try my best to decode the syntax but then my best was not enough but then my php experience is growing!!
  12. still throughing Parse error now its :Parse error: syntax error, unexpected '{' in... on line 30 and lines 20- 33 and is $used_ranks = array(); foreach($news as $record) { if (!in_array($record['rank'],$used_ranks)) { $used_ranks[] = $record['rank']; } } //Get the diffrence of $all_ranks and $used_ranks (i.e. the unused ranks) $unused_ranks = array_diff($all_ranks,$used_ranks); //Create the options for select list $unused_rank_options = '';
×
×
  • 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.