sasa
Staff Alumni-
Posts
2,804 -
Joined
-
Last visited
-
Days Won
1
Everything posted by sasa
-
and what you want to mach
-
preg_match('|href="mailto:([^"]*)"|', $result, $email);
-
try preg_match('/<div class=\"c\">(.*?)<\/div>/i', $result, $name);
-
Userlist with button to nextpage with $_Post variable
sasa replied to Ryflex's topic in PHP Coding Help
move open an close form tag inside while loop -
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"; ?>
-
<?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); ?>
-
you newer open form tag (but you close it) values of $_POST['answer'] is 'Yes' or 'No' NOT 1 or 2
-
$patern = '#<sup class=\'footnote\' value=\'\[<a href="[^"]*" title="See footnote [^"]*">[^<]*</a>\]\'>\[<a href="[^"]*" title="See footnote [^"]*">[^<]*</a>\]</sup>#';
-
try '/(ht|f)tps?:\/\/[A-Za-z0-9_.-]{3,}\/?\s|$/' not tested
-
you mean wordwrap() function
-
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;
-
this two lines is just copied from your code
-
$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
-
if you want to someone help you post source code of page not picture of it
-
<?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"; } ?>
-
I need some help with multiple years in my search.
sasa replied to vet911's topic in PHP Coding Help
try to insert mysql_data_seek($result, 0); before while loop -
try to add qvotes around your data echo '<input type="text" name="playername[' . $row['name'] . ']" value="'.$row['playernumber'] . '"></input>';
-
are you submit your form? is your form use POST method?
-
'a.naslov' is not same as 'A.naslov' you use alias A
-
yes just move playername[ and ] inside qvotes echo '<input type=text name=playername[' . $row['name'] . '] value=' . $row['playernumber']></input>';
-
where you setup $message object?
-
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
-
I need some help with multiple years in my search.
sasa replied to vet911's topic in PHP Coding Help
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(); ?> -
are you add [] to the end of $echoarray variable?
-
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'] ); } ?>