Jump to content

gurroa

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by gurroa

  1. use <a href="javascript:if(confirm('Go to next page?')){window.location='nextpage.html';}">Go to next page</a>
  2. To display image you will have to create new php script that will accept pid and output only the image. This new script vary from way you are saving image data into the dbase. I would save images as base64_encode()d raw data. And as long as you store imgdata into your message table don't select this field when you don't need it. Otherwise imgdata is retrieved from your db too. SELECT pid, usrname_email, userID, userstatus, full_message FROM $table_name ORDER BY userstatus ASC <?php //viewimage.php Header("Pragma: no-cache"); Header("Cache-Control: no-cache"); Header("Expires: ".GMDate("D, d M Y H:i:s")." GMT"); if (isset($_GET['pid']) && is_int($_GET['pid'])) { mysql_connect(.... // connection $res = mysql_query("select imgdata from message where pid = ".$_GET['pid']); if ($res) { $row = mysql_fetch_assoc($res); // This is only if you are storing jpeg images Header("Content-type: image/jpeg"); Header("Content-Disposition: inline; filename=img".$_GET['pid'].".jpeg"); echo base64_decode($row['imgdata']); } } ?> To put such image into your messages script while($row = mysql_fetch_array($result)) { $display_block .= " <tr><td>---------------------------------------- <font color=blue><p>User/Email:".$row['usrname_email']." ".$row['userID']."</font> <img src=\"viewimage.php?pid=".$row['pid']."\" align=left ...> ----------------------------------------<p> User Status:$row['userstatus']<p>Date:$row[date]<p>Full Message:$row['full_message'] </td> </tr>"; }
  3. Perhaps try copy/paste into new file and save again. I've copied your code to a local file and it was compiled correctly.
  4. Yes it is the same as with $save_file variable. Read that manual page http://www.php.net/register_globals.
  5. See source of the page that is returned. I think the whole code is displayed. (part that you can't see is in tag and hidden) Check wheter php is installed properly. Check wheter your file has acceptable extension (.php, .php5 etc.)
  6. Your linux php configuration has registry_globals set to false. $save_file is stored in associative array $_POST['save_file'] instead of being global. See http://www.php.net/register_globals.
  7. If you can use javascript then save body.innerHTML var origpage = document.body.innerHTML; function Revert() { document.body.innerHTML = origpage; }
  8. Sorry to miss all the others... $storedata = mysql_query('INSERT INTO liam_database(Username, Password, Email,Favourite Sport,IP,date); VALUES ( "'.addslashes($user).'", "'.md5($pass).'", "'.addslashes($email).'", "'.addslashes($sport).'", "'.addslashes($IP).'", "'.addslashes($date).'")') or die(mysql_error()); Missing , in values set and ) at the end.
  9. Try your sql command without ; sign. See http://dev.mysql.com/doc/. INSERT INTO liam_database(Username, Password, Email, Favourite_Sport, IP, date) VALUES (....)
  10. gurroa

    speed

    Try adding <?php ini_set('max_execution_time', 300); // this should gave you more time ob_start(); // this should speed up outputing data
  11. You should mention... $year = trim($_POST['year']); $datefrom = ''; if (!empty($year)) { $ardate = array($year); if (strpos($year, '.') !== false) $ardate = Explode('.', $year); else if (strpos($year, '-') !== false) $ardate = Explode('-', $year); $c = count($ardate); if ($c == 3) { $datefrom = sprintf("%04d-%02d-%02d", trim($ardate[2]), trim($ardate[1]), trim($ardate[0]) ); $dateto = $datefrom; } elseif ($c == 2) { $datefrom = sprintf('%04d-%02d-01', trim($ardate[1]), trim($ardate[0]) ); $dateto = Date("Y-m-d", strtotime("+1 month -1 day", strtotime(sprintf('%04d-%02d-01', trim($ardate[1]), trim($ardate[0])) )) ); } elseif (is_integer($year)) { $datefrom = sprintf('%04d-01-01', $year); $dateto = sprintf('%04d-12-31', $year); } } if (!empty($datefrom)) { $sql = "SELECT * FROM Temper WHERE Date >= '{$datefrom}' and Date <= '{$dateto}'"; .... }
  12. Simple don't do it. Use session, dbase or plain file. If user can see it but should not change it, use md5 check method $url = 'viewarticle.php?id='.$id.'&check='.md5(md5('my'.$id.'test'.$id)); and test it on the other side.
  13. If you don't want to wait for reply.. http://www.php.net/manual/en/index.php $prod = array(); // creates new empty array reset($arProd); // set array position to the first element while(list(,$row) = each($arProd)) { // this will take element from $arProd array on current position and push position to the next element $prod[] = $row['Name']; // add value from the $row array under the key 'Name' to the $prod array } echo Implode(", ", $prod); // print out all values in the $prod array split by ', ' string You can't use your while statement cause it will be an infinitive loop To print out data as you've mentioned use my previous construct with this output if (count($arProductsByItem) > 0) { reset($arProductsByItem); while(list($Item,$arProd) = each($arProductsByItem)) { echo 'Item: '.$Item.'<br />'; reset($arProd); while(list(,$row) = each($arProd)) { echo 'product'.$i.' '.$row['Name'].' : '.$row['PriceRetail'].'<br />'; ++$i; } echo '<br />'; } }
  14. <?php $arProductsByItem = array(); if ($numProduct > 0 ) { $i = 0; while ($row = dbFetchAssoc($result)) { $arProductsByItem[$row['ItemName']] = $row; } } // example of later output if (count($arProductsByItem) > 0) { reset($arProductsByItem); while(list($Item,$arProd) = each($arProductsByItem)) { echo 'Item: '.$Item.' - Products: '; $prod = array(); reset($arProd); while(list(,$row) = each($arProd)) { $prod[] = $row['Name']; } echo Implode(", ", $prod); } } ?>
  15. Your multi_file table consist at least of fields mult_id synopsis file_picture file_name file_description file_link first row for bleach is mult_id => '1', synopsis => 'Ichigo Kurosaki ... SEE anime', file_picture => 'http://www.mu-anime.com/bleach.jpg', file_name => 'Bleach Episode 1', file_description => 'The day I became a shinigami', file_link => 'http://www.megaupload.com/?d=IASUWFNF' second and others has only filled: mult_id, file_name, file_description, file_link You should change your dbase. My opinion is to split your table into two multi_file - mult_id, synopsis, file_picture sub_files - mult_id, file_picture, file_name, file_description, file_link
  16. And have you put the link to every row? It seems that only first entry has the file_picture field and synopsis field filled.
  17. Make sure you're not missing file_picture values in the db. while($myarray = mysql_fetch_array($sql)){ // Build your formatted results here. echo $myarray['synopsis']."<br /><br />"; if (!empty($myarray['file_picture'])) { echo "<img src='" .$myarray['file_picture']. "' align=\"right\" alt=\"\" />"; } echo "<font color=\"#3399FF\">Episode:</font>" . " " .$myarray['file_name']."<br />"; echo "<font color=\"#3399FF\">Title:</font>" . " " .$myarray['file_description']."<br />"; echo "<font color=\"#3399FF\">Link:</font>" ." ". "<a href=\"".$myarray['file_link']. "\" target=\"_blank\">Click Here To Download</a>"; }
  18. $sql = "SELECT * FROM Temper WHERE Date >= '{$_POST['year']}-01-01' and Date <= '{$_POST['year']}-12-31'"
  19. This construct echo (isset($SireRow) ? $SireRow['RegName'] : ''); is the same as if (isset($SireRow)) echo $SireRow['RegName']; else echo ''; php function isset() returns true/false if the variable is set or not. see http://www.php.net/manual/en/function.isset.php
  20. include('phpthumb.functions.php'); include('phpthumb.bmp.php'); $jpg = imagecreatefromjpeg('test.jpg'); $phpbmp = new phpthumb_bmp(); file_put_contents('test.bmp', $phpbmp->GD2BMPstring($jpg));
  21. See http://phpthumb.sourceforge.net/index.php?source=phpthumb.bmp.php.
  22. Try it with http://phpthumb.sourceforge.net/.
  23. It's because you don't resend your ID value Try http://cristi.prosportequipment.ro/prosportnew/produse.php?id=1&page=2 and you will see second page. Also you should add some tests to prevent sql hacks and never shows query to the user.
  24. http://www.w3.org/TR/CSS21/text.html#propdef-text-decoration
×
×
  • 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.