Jump to content

sasa

Staff Alumni
  • Posts

    2,804
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by sasa

  1. ok change line $checklogin2 = mysql_query("SELECT * FROM users WHERE username = '{$_POST['username']}'"); to echo '$checklogin2 = ', $checklogin2 = mysql_query("SELECT * FROM users WHERE username = '{$_POST['username']}'"); to see how your SQL string look like 2nd try to print_r($_POST['username']); before this line
  2. for debug try change line $checklogin = mysql_query($checklogin2) ; to $checklogin = mysql_query($checklogin2) or die(mysql_error());
  3. try <?php $variable = "this is some text, avec url= http://www.google.com/image.gif and this http://www.yahoo.com/yahooimage.gif"; preg_match_all('/(http|https):\/\/[^ ]+(\.gif|\.jpg|\.jpeg|\.png)/',$variable, $out); print_r($out[0]); ?>
  4. try[code[<?php $stupidspammer=array("Website","Email","Link"); if (eregi('('.implode('|',$stupidspammer).')', $comment)){ echo "We Are Not Interested"; exit; } else { echo 'good'; } ?>
  5. try if(eregi("^(http|https):\/\/.+(\.gif|\.jpg|\.jpeg|\.png)$",$var))
  6. can we see print_array_inline() function?
  7. you can rearange your array try <?php $new_arr = array(); foreach ($marray as $key => $value) { preg_match('/subscriptionevents_subscriptionfile_([0-9]+)_(.*)/', $key, $b); $new_arr[$b[1]][$b[2]] = $value; } //print_r($new_arr); foreach ($new_arr as $value) echo $value['filename'], "\n"; ?>
  8. try <?php mysql_connect('localhost'); mysql_select_db('test'); $data = mysql_query('select * from names order by name'); $prev_row =''; echo '<table border ="3">'; while($info = mysql_fetch_array( $data )) { $letter = strtoupper(substr($info['name'],0,1)); if ($letter != $prev_row) { if($count % 3) { for ($i = ($count % 3); $i < 3; $i++) echo '<td> </td>'; echo '</tr>'; $count =0; } $prev_row = $letter; echo '<tr><td colspan="3">',$letter,'</td></tr>'; } if ($count % 3 == 0) echo '<tr>'; $count++; echo '<td>', $info['name'], '<br />Phone: ', $info['phone'], "</td>\n"; if ($count % 3 == 0) echo '</tr>'; } if($count % 3) { for ($i = ($count % 3); $i < 3; $i++) echo '<td> </td>'; echo '</tr>'; } echo '</table>'; ?>
  9. you can't insert value lees then 0 in it and you try this
  10. in line $imt++; the value is chenged try to insert line echo 'biodraw(',"$valdrawarray, $maxx, $maxy, $points, $imt",')'; and see
  11. what is type of your column hp?
  12. where you create your SQL string
  13. you don'i echo anything, add echo $verbage;
  14. change $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM multi_file"),0); to $total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM multi_file WHERE mult_id = $temp_go_to"),0);
  15. it's working fine to me
  16. if you have more then 9 pages change line $numpages = preg_match_all('/\[#newpage:(\d)\]/', $text, $pages); to $numpages = preg_match_all('/\[#newpage:(\d+)\]/', $text, $pages); + mean one or more digits
  17. include($_SERVER['DOCUMENT_ROOT'].'/admin/mike.php');
  18. try <?php $a = file_get_contents('pages.txt'); $p = $_GET['page']; preg_match('/\[#newpage:'.$p.'\](.*)/',$a,$b); echo $text = isset($b[1]) ? $b[1] : 'no text to print'; ?>
  19. change line return ( $college['type'] = 'college' ); to return ( $college['type'] == 'college' );
  20. try <?php $a = 1000; echo '$ ', number_format($a, 2, '.', ','); ?>
  21. a:1:{s:2:"cc";a:1:{i:3;s:7:"Name";}} is serialized array but in the end string "Name" is 4 characters long change s:7:"Name"; to s:4:"Name"; and try thorpe's code
  22. something like this ${'image' . $counter} = $_POST['image' . $counter];
  23. look http://hr.php.net/array_combine
  24. try <?$array_homepenalties = array(3, 5, 8, 24); $array_homepenmins = array(2, 2, 5, 4); $len = count($array_homepenalties); for($i = 0; $i < $len; ++$i) { $assoc_array_hpen[ $array_homepenalties[$i] ] = $array_homepenmins[$i]; } print_r($assoc_array_hpen); ?> or use array_combine() function
  25. try <?php mysql_connect('localhost'); mysql_select_db('test'); $row1 = array(); $rows = array(); $res = mysql_query ("SELECT id, title, parent FROM categories ORDER BY title"); while (list($id, $title,$parent) = mysql_fetch_row($res)) { if ($parent) $rows[$parent][$id] = $title; else $row1[$id] = $title; } echo '<table border="15" cellpadding="5">'; echo '<tr><td>', implode('</td><td>', $row1), '</td></tr>'; echo '<tr valign="top">'; foreach ($row1 as $k => $v) { echo'<td>'; if (isset($rows[$k])) { foreach ($rows[$k] as $id => $title) echo "<a href=\"result.php?cat_id=$id\"> $title </a><br>"; } else echo ' '; echo '</td>'; } echo '</tr></table>'; ?> or <?php mysql_connect('localhost'); mysql_select_db('test'); $row1 = array(); $rows = array(); $res = mysql_query ("SELECT id, title, parent FROM categories ORDER BY title"); while (list($id, $title,$parent) = mysql_fetch_row($res)) { if ($parent) $rows[$parent][] = array($id, $title); else $row1[$id] = $title; } echo '<table border="5" cellpadding="5">', "\n"; echo '<tr><td>', implode('</td><td>', $row1), '</td></tr>', "\n"; echo '<tr valign="top">'; $r = 0; while (count($rows)){ foreach ($row1 as $k => $v) { echo "\n", '<td>'; if (isset($rows[$k][$r])) { echo "<a href=\"result.php?cat_id=", $rows[$k][$r][0],'">', $rows[$k][$r][1], "</a>\n"; unset($rows[$k][$r]); if (!count($rows[$k])) unset($rows[$k]); } else echo ' '; echo '</td>', "\n"; } echo '</tr>', "\n"; $r++; } echo '</table>'; ?>
×
×
  • 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.