Jump to content

rcorlew

Members
  • Posts

    307
  • Joined

  • Last visited

    Never

Everything posted by rcorlew

  1. Could you just insert the time using a timestamp generated by php, then to make it easier for the users to understand how long ago that was to a time comparison to the current time. THe comparison would make it look something like this: Posted ----->4 hours and 30 minutes ago<---------- 1:43 pm (GMT) That may be the best and easiest way to do what you are wanting to do I think.
  2. You would have to use either a very complicated ip location script to get the timezone based on ip location or javascript to get the time on the users comuter. Since php exists only on the server, the time would have to come from a use of startoftime adjusted for the timezone differences on the users end. The only way to do that would be to make them set their timezone using sessions and then doing the startoftime adjustments from there. Or just use a central timezone and report that on the page like 12:00 am (GMT) I think that most people could figure it out.
  3. It would go right here, I changed the code for you somewhat: $username = "$_POST[\"username\"]"; $filename= "$username.php" $supplier1 = "$_POST[\"supplier1\"]"; if($_POST["submit"]) { $handle = fopen($username, 'a+'); fwite($handle,$supplier1); fclose($handle); } //I think you should get the idea from that. if (is_writable($filename)) { if (!$handle = fopen($username, 'a')) { echo "Cannot open file ($filename)"; exit; } if (is_writable($filename)) { if (!$handle = fopen($username, 'a')) { echo "Cannot open file ($filename)"; exit; }
  4. Oops I missed a few at the top, I'm sorry.
  5. Imageopen is javascript. To pass it to another page just make it a string like this: <?php $iopen = " ImageOpen.document.open() ImageOpen.document.write('<html><head><title>Downloads:'+downloadtype+' ~ '+imgpath+':.</title>'); ImageOpen.document.write('<link href="/main.css" rel="stylesheet" type="text/css" /></head>'); ImageOpen.document.write('<body '+bodyattribute+'>'); ImageOpen.document.write('<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" align=\"center\">'); ImageOpen.document.write('<tr><td><img src=\"downloads/'+downloadtype+'/'+imgpath+'/sample1.gif\" /></td>'); ImageOpen.document.write('<td><img src=\"downloads/'+downloadtype+'/'+imgpath+'/sample2.gif\" /></td></tr>'); ImageOpen.document.write('<tr><td><img src=\"downloads/'+downloadtype+'/'+imgpath+'/sample3.gif\" /></td>'); ImageOpen.document.write('<td><img src=\"downloads/'+downloadtype+'/'+imgpath+'/sample4.gif\" /></td></tr></table>'); ImageOpen.document.write('<center class="main">This is a screenshot of '+imgpath+'</center><hr color=\"#8e8989\" size=\"1px\" />'); ImageOpen.document.write('</body></html>') ImageOpen.document.close() ImageOpen.focus() "; //Then when you need the function to be called after the variables are filled echo "$iopen"; ?>
  6. Try this part of code, it looks like you are not even writing or opeing the file, only checking to see if it is false to get errors. $filename = "$username.php"; $handle = fopen($filename, 'a+') Looked like you were not using a file, rather using a username only to open.
  7. You need to remove the , here: Tijd, Titel, Forum)"."VALUES ('NULL', 'uhu', 'Test', '2007-04-18'(--->,)'17:15:13','Ja dit en dat','2') It is creating another input column Just append the time to the date like this by creating a variable that combines the two into one string with whatever seperator you want: $timedate = "$date , $time"; Tijd, Titel, Forum)"."VALUES ('NULL', 'uhu', 'Test','$timedate','Ja dit en dat','2') '$timedate'
  8. It is using a form of css and javascript. Here is a sample of what it can look like and you can play around with it. <div id="MENU" style="position:relative; width:480px; text-align:center; background-color:#c9cfcb; color:#333633; cursor:hand" onclick="document.getElementById('ITEMS').style.visibility='visible'" ondblclick="document.getElementById('ITEMS').style.visibility='hidden'"> <b>Click Here For Picture Zoom</b> </div> <div id="ITEMS" style="position:absolute; visibility:hidden; width:480px; text-align:center; background-color:#DEB887; color:#FFFFFF" onmouseover="this.style.visibility='visible'" onmouseout="this.style.visibility='hidden'"> <div style="background-color:#f6ebd7; color:#333633;" mouseover="this.style.backgroundColor='#f6ebd7'"> This is the layer that would be visible on click. You would put a img src= here and make the layer the <div> the same size as the pic. You would also have to change cursor to whatever clever item you would like </div> </div>
  9. YOur header problem is becuase you are starting your code on line 2 instead of line 1.
  10. YOu are using $_GETS instead of $_GET that could be the problem.
  11. use 'a+' here (!$handle = fopen($username, 'a')) { The + will create the file if it does not exist and put the cursor at the end of the file.
  12. Couldn't you combine the Imageopen function into a string and then post that to the next page by echoing it as a variable?
  13. use & (&) once not twice. THe & is the html code for & and will keep the page valid html.
  14. You could simply mail a link that would run a sql query to the item id of what was just put into the db. Then would would not have to use html at all until the link is clicked if that is possible.
  15. You may want to use sessions in your control panel if you are not already doing so. They are easy to use and a fairly powerful way to check variables if they exist. That way you would have to login before going to the next page.
  16. No you will only need to call this once, it will go through every vaiable until all are put into the array and ready for sending: foreach($_POST as $fld => $val) if ($fld != 'submit') // or whatever your submit button is named $tmp[] = $fld . ': ' . stripslashes($val); The foreach really does mean foreach, whether it is 1 or 100 variable items, they will all be input with that simple code.
  17. I just did something like that here is what I used, it may or may not work but it is worth a shot: <?php $page = $_GET["page"]; $row_max = 20; //or how many results you want per page if(!isset($page)) { $page = 1; } if($page == 1) { $pagein = 0; $pageout = $row_max; } if($page > 1) { $pagein = $page * $row_max - $row_max; $pageout = $pagein * $row_max; } $query = "SELECT * FROM tablename WHERE thing = '$thing'"; $result = mysql_query($query); $num = mysql_num_rows($result); $query2 = "SELECT * FROM tablename WHERE thing = '$thing' LIMIT $pagein, $pageout"; $result2 = mysql_query($query2); while ($row = mysql_fetch_array($result2)) { //show table results here } $pagecount = ceil($num / $row_max); echo "Page "; $x = 1; $y = $pagecount; for( $i = $x; $i <= $y; $i++ ) { print "<a href='index.php?page=$i'><b>[$i]</b></a> "; } ?> I hope you get the idea
  18. I would recommend using the mysql native date format yyyy-mm-dd, you can do some fairly powerful comparisons easily with it stored that way, as long as the column is set to 'date' type.
  19. Replace "and" with "&&" or "|" they will both work
  20. Glad I could help. I was trying to give you a good starting point to work from. There are two really good reasons to do a row count and hashed password. 1)SQL injection 2)SQL injection Just my oinion though.Good job getting it to go though.
  21. Your welcome and good luck on your project.
×
×
  • 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.