Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. preg_match('|href="mailto:([^"]*)"|', $result, $email);
  2. try preg_match('/<div class=\"c\">(.*?)<\/div>/i', $result, $name);
  3. try <?php $images = "gallery/"; # Location of galleries $cols = 4; # Number of columns to display $max = 6; # Maximum number of updates to show per page $page = 2; # Page Number, if you have 9 tumb, on 2nd page is just 3 if ($handle = opendir($images)) { while (false !== ($file = readdir($handle))) { if ($file != "." && $file != "..") { $files[] = $file; } } closedir($handle); } $colCtr = 0; echo "<div><table><tr>"; rsort($files); $files = array_chunk($files, $max); $files = $files[$page - 1]; foreach ($files as $file) //$i = $c, $i is greater than the array count minus $max, $i de-increments on each loop. This will give us a countdown for the number of updates required. { if($colCtr == 0) echo "<tr>"; echo "<td><img src=\"" . $images . $file . "/thumb.jpg\" width=\"240px\" height=\"180px\" alt=\"" . $alt . "\" /></td>"; $colCtr++; if ($colCtr == $cols){ echo '</tr>'; $colCtr = 0; } } if ($colCtr > 0) echo '</tr>'; echo "</table></div>" . "\r\n"; ?>
  4. <?php $test ='<P>bla</p><P >bla</p><P>bla</p><P>bla</p><P>bla</p>'; function my_cnt($a){ static $i = 0; return "<P class='".$i++."'".$a[1]; } echo preg_replace_callback('/<P(\s|>)/', 'my_cnt', $test); ?>
  5. you newer open form tag (but you close it) values of $_POST['answer'] is 'Yes' or 'No' NOT 1 or 2
  6. $patern = '#<sup class=\'footnote\' value=\'\[<a href="[^"]*" title="See footnote [^"]*">[^<]*</a>\]\'>\[<a href="[^"]*" title="See footnote [^"]*">[^<]*</a>\]</sup>#';
  7. try '/(ht|f)tps?:\/\/[A-Za-z0-9_.-]{3,}\/?\s|$/' not tested
  8. in your code you query another table from database and put result in $scorex but you never use it maybe for($i = 1; $i <= 8; $i++) $count += $score['round'.$i]==$scorex['inx'.$lett[$i]] ? 1 : 0;
  9. this two lines is just copied from your code
  10. $nextVar = 'roundx'; $lett = array(1 => 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'); $count = 0; $queryU = "SELECT * FROM one WHERE username = '".$Var."'"; $result = mysql_query($query); $score = mysql_fetch_assoc($result); //$usera1 = $score['round1']; $nextVar = 'roundx'; $queryx = "SELECT * FROM acs WHERE round1 = '".$nextVar."'"; $resultx = mysql_query($queryx); $scorex = mysql_fetch_assoc($resultx); //$win1 = $score['inxa']; for($i = 1; $i <= 8; $i++) $count += $score['round'.$i]==$score['inx'.$lett[$i]] ? 1 : 0; echo $count; btw for what is $scorex? not tested
  11. if you want to someone help you post source code of page not picture of it
  12. <?php foreach ($_POST['country_data'] as $country_id => $value) { // do something echo 'country_id is ' . $country_id . ' and value of text input field is ' . $value . "<br />\n"; } ?>
  13. try to insert mysql_data_seek($result, 0); before while loop
  14. try to add qvotes around your data echo '<input type="text" name="playername[' . $row['name'] . ']" value="'.$row['playernumber'] . '"></input>';
  15. are you submit your form? is your form use POST method?
  16. 'a.naslov' is not same as 'A.naslov' you use alias A
  17. yes just move playername[ and ] inside qvotes echo '<input type=text name=playername[' . $row['name'] . '] value=' . $row['playernumber']></input>';
  18. change query to $GetTimeTable = "SELECT * FROM timetable WHERE username='$username' AND Subject_date='$today_date' and end_time" > $timeNow ORDER BY end_time; in 1st row of returned data is curren class (if it exist) and in another row(s) is future clasesses for current class just check if start_time is less then current time
  19. try <?php include 'config0.php'; $search=$_GET["search"]; // Connect to server and select database. mysql_connect($dbhost, $dbuser, $dbpass)or die("cannot connect"); mysql_select_db("$dbname")or die("cannot select DB"); $result = mysql_query("SELECT * FROM table1 WHERE plaques LIKE '%$search%' ORDER BY `year`") or die(mysql_error()); // store the record of the "" table into $row //$current = ''; // keeps getting the next row until there are no more to get if($result && mysql_num_rows($result) > 0) { $i = 0; $max_columns = 4; $y = mysql_result($result, 0, 'year'); echo "<table align=center>"; echo "<br>"; while($row = mysql_fetch_array($result)) { // make the variables easy to deal with extract($row); if($y != $year){ $y = $year; if($i >0) { for($j=$i; $j<$max_columns; $j++) echo "<td> </td>"; echo "</tr>\n"; $i = 0; } } // open row if counter is zero if($i == 0) echo "<tr>"; echo "<td align=center>"; ?> <div style="float: left;"> <div><img src="<?php echo $tn; ?>"></div> </div> <?php echo "</td>"; // increment counter - if counter = max columns, reset counter and close row if(++$i == $max_columns) { echo "</tr>"; $i=0; } // end if } // end while } // end if results // clean up table - makes your code valid! if($i > 0) { for($j=$i; $j<$max_columns;$j++) echo "<td> </td>"; echo '</tr>'; } mysql_close(); ?>
  20. are you add [] to the end of $echoarray variable?
  21. are you traying this <?php require_once ('includes/config.php'); require_once ('includes/connect.php'); $echoarray = array(); $resultsql = mysql_query("SELECT * FROM clients")or die(mysql_error()); while($row = mysql_fetch_array($resultsql)){ $echoarray[] = array( 'id' => $row['ID'], 'name' => $row['First_Name'] . " " . $row['Last_Name'], 'price' => $row['Status'], 'number' => $row['Sex'], 'address' => $row['Phys_Street'], 'company' => $row['Agency'], 'desc' => $row['Notes'], 'age' => $row['Date_Birth'], 'title' => $row['Occupation'], 'phone' => $row['Phone'], 'email' => $row['Email'], 'zip' => $row['Phys_Zip'], 'country' => $row['Phys_City'] ); } ?>
×
×
  • 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.