Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. cnange list($email,$password) = explode(" ",$b); to list($email,$password) = explode(" ",trim($b));
  2. cen you post 3 lines of code before this line
  3. can you post your form code
  4. .change $brandID = $this->input->post('brand[]'); to $brandID = $this->input->post('brand');
  5. change $insert = "UPDATE `users` (`UID`, `PWD`) VALUES ('{$_POST['UID']}', '{$_POST['PWD']}') WHERE `ID` =$_POST['ID']"; to $insert = "UPDATE `users` (`UID`, `PWD`) VALUES ('{$_POST['UID']}', '{$_POST['PWD']}') WHERE `ID` =$_POST['ID']";
  6. change line if (!$_POST['username'] | !$_POST['pass'] | !$_POST['pass2'] ) { to if (!$_POST['username'] || !$_POST['pass'] || !$_POST['pass2'] ) {
  7. change this part of code <?php if(isset($_POST['godate'])){ $today=$_POST['today']; $query="SELECT DISTINCT tcl FROM arrastre WHERE today='$today' ORDER BY tcl ASC"; $result=mysql_query($query); while($row=mysql_fetch_array($result)){ $tcl=$row['tcl']; $today=$row['today']; ?> <input type="hidden" name="tcl" value="<?php echo $tcl;?>"> <input type=submit name="tcl" value="<?php echo $tcl; ?>"> <?php } } ?> with <?php if(isset($_POST['godate'])){ $today=$_POST['today']; $query="SELECT DISTINCT tcl FROM arrastre WHERE today='$today' ORDER BY tcl ASC"; $result=mysql_query($query); echo '<form method="POST"><input type="hidden" name="today" value="', $today, '">'; while($row=mysql_fetch_array($result)){ $tcl=$row['tcl']; $today=$row['today']; ?> <input type="submit" name="tcl" value="<?php echo $tcl; ?>"> <?php } } ?> </form>
  8. select COUNT(ID) AS num_of_rows from data this return just number of data (one row)
  9. http://php.net/manual/en/ref.mysql.php
  10. UNIX_TIMESTAMP(STR_TO_DATE(`date`,'%W %b %D %Y @ %h:%i %p'))
  11. SQL looks OK for me
  12. ~^[^-][a-z0-9\-]{1,}[^-](\.[^-][a-z0-9\-]{1,}[^-])?$~D
  13. ttry <?php $test = '/holdcroft-renault-hanley/used-cars/2/4/price-asc/'; $a = perm($test); print_r($a); function perm($a){ $out = array(); $a = explode('/', trim($a, '/')); $a1 = $a; if ($a[0] ){ while (count($a)){ $out[] = '/'. implode('/', $a).'/'; array_pop($a); } array_shift($a1); $c = perm(implode('/', $a1)); $out = array_merge($out, $c); } return $out; } ?>
  14. use thi SQL code SELECT jobs.id, jobtext, jobdate, name FROM jobs LEFT JOIN author ON author.id=jobs.authorid
  15. try <?php // Print out result while($row = mysql_fetch_array($result)){ echo "There are ". $row['COUNT(biddersId)'] ." bidders logged."; echo "<br />"; } $query = "SELECT * FROM bidders ORDER BY biddersId"; $result = mysql_query($query) or die(mysql_error()); echo "<table border='1'>"; echo "<tr>", str_repeat("<td>Bidders</td>",3), "</tr>\n"; // keeps getting the next row until there are no more to get $i=0; while($row = mysql_fetch_array( $result )) { if ($i == 0) echo "<tr>"; $i++; // Print out the contents of each row into a table echo "<td>"; echo"<font face= \"calibri\" size=\"3\">"; echo $row['biddersId']; echo "</font>"; echo "</td>"; if ($i == 3){ echo "</tr>\n"; $i=0; } } if ($i>0){ while ($i++ <3) echo '<td> </td>'; echo "</tr>\n"; } echo "</table>"; ?>
  16. time return number of seconds from jan 1st 1971 to now jan 1st 1971 is thusday and i add 3 days (3*7*24*3600) to move to monday as start ofr week
  17. <?php //echo date('D', strtotime('71/1/1')); $staff = array('Branda', 'Tara', 'Tom'); echo $staff[((time()+3*24*3600)/(7*24*3600)) % 3]; ?>
  18. <?php $test = '<a href="test.test"></a>'; $test = preg_replace('/^.*(href="[^"]*").*$/','$1',$test); Echo $test; ?>
  19. can you post your form code
  20. <?php //let's start our session, so we have access to stored data session_start(); include 'db.inc.php'; $db = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD) or die ('Unable to connect. Check your connection parameters.'); mysql_select_db(MYSQL_DB, $db) or die(mysql_error($db)); //let's create the query $query = 'INSERT INTO subscriptions (name, email_address, membership_type, terms_and_conditions, name_on_card, credit_card_number, credit_card_expiration_data) VALUES ( "' . $_SESSION[$name] . '", ' . $_SESSION[$email_address] . '", ' . $_SESSION[$membership_type] . '", ' . $_SESSION[$terms_and_conditions] . '", ' . $_POST[$name_on_card] . '", ' . $_POST[$credit_card_number] . '", ' . $_POST[$credit_card_expiration] . ')'; if (isset($query)) { $result = mysql_query($query, $db) or die(mysql_error($db)); } ?> <p>Done!</p> </body> </html> ?>
  21. 1st and 3rd are same (parse error)
  22. $patern = '/<div class="spoiler"><input type="button" onclick="showSpoiler\(this\);" value="Show\/Hide" \/><div class="inner" style="display:none;">(.+?)<\/div><\/div>/is';
  23. try to change $sql = "SELECT * FROM users WHERE uid=".$uid; with $sql = "SELECT * FROM users WHERE uid='".$uid."'";
  24. change this lines $loop = (int)(count($vendors_states) / 5); if(count($vendors_states) % 5 > 0) $loop++; with $loop = count($vendors_states);
  25. $message = "This is to confirm that the following message was sent to our sales department:\n\n" + $message; you mean dot not plus $message = "This is to confirm that the following message was sent to our sales department:\n\n" . $message;
×
×
  • 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.