Jump to content

legohead6

Members
  • Posts

    434
  • Joined

  • Last visited

    Never

Everything posted by legohead6

  1. heres a tutorial on pagination which is what i think you are trying to do http://www.phpfreaks.com/tutorials/43/0.php
  2. well ive finished the code but cant get the layout to appeal, can someone please give me ideas to make it more attractive... http://www.zelocalz.com username: test password: member Please dont list or post on the site itself thanks
  3. http://www.w3schools.com is also a good reference.
  4. an efficent site should be able to run without those browser buttons..
  5. thats just something your going to have to live with, or you could make another query that checks if its been posted.
  6. to make a varible you $variable=8-3; some will also put the math in brackets.. but its up to you
  7. php is easy to learn but hard to master. Lots of it is common sence. and if you already to coding in other languages it will make it that much easier. but of you dont want to learn then people arent just going to make your site for you.
  8. you can use that varible to fetch from a database or whatever you want..
  9. something like this maybe.. i dunno ive never tested or done a script like this, the only thing i know works is the minusing hours( the $time variable) $hours=-10 //10 hours ago $time=date("U", strtotime($row[3]))+($hours*3600); //makes the 10 hour ago date based off a timestamp($row[3]) $time2 = date() //cuurent time if($time2 > $time+($hours*3600)){ //do whatever to old files }else{ //do something else }
  10. just copy the code onto the forum, it makes it esier for everyone to help you.
  11. use a switch and echo the script to include different style sheets.... users could also incript other code in those pages which could be deadly
  12. if you have auto_icrepment(im not a good speller) set up in your database then just have the open and closeing quotes beside eachother... ( '' , 'somethingelse','other','etc') for that feild....
  13. this <?php require_once('db.php'); if (isset($_GET['view'])) { $sql = "SELECT * FROM beaches"; $data = mysql_query($sql); while($record = mysql_fetch_assoc($data)) { $id = $record['id']; $name2 = $record['name']; $picture = $record['picture']; $rating = $record['rating']; $desc = $record['desc']; echo "$id, $name2, $picture, $rating, $desc"; } } ?>
  14. remove the action in the html in the <form> tag, it messes with the php.
  15. how do i minus hours/minutes from a timestamp?
  16. sorry, what are you tryin to achive?
  17. lol..what do you expect the users to do if your site freezes or something local stops your page, if there is no x button...
  18. this is a good goal to work toward when learning, tutorials will tell how to do it once but never teach you how to do it forever. I would suggest you try yourself to build one, and if you run into a glitch you can ask for help, but by doing it yourself you learn how to do it forever.
  19. here is a script i have for a fileing service, it links to all the files in a specific folder.. i dunno how much of the code is good for you, but there is alot of good stuff in here... if(isset($_POST['submit2'])){ $first=$_POST['new']; $end=$_POST['end']; $name="$first.$end"; $types = array('gif', 'jpeg', 'jpg', 'pjpeg','bmp','txt','doc','php','html','mpg','css','mpeg','png','xls'); $parts = explode('.', $name); $key = count($parts) - 1; $ext = strtolower($parts[$key]); if (in_array($ext, $types)) { $page = fopen("userfolders/$folder/$name", 'x+'); $content=" "; fwrite($page, $content); $cpage="INSERT INTO files VALUES('','$name','$end','$user','0')"; $result = mysql_query($cpage) or die ("Error in query: $cpage. ".mysql_error()); }else{ echo "Sorry Your File is not supported, Please The administrator"; } if(isset($_POST['upload'])){ $dest="userfolders/$folder/".$_FILES['ph']['name']; copy($_FILES['ph']['tmp_name'],"$dest"); $filer=$_FILES['ph']['name']; $type=$_FILES['ph']['type']; $cpage="INSERT INTO files VALUES('','$filer','$type','$user','0')"; $result = mysql_query($cpage) or die ("Error in query: $cpage. ".mysql_error()); print "File has been successfully uploaded!<br>"; } } $dir = "userfolders/$folder/"; $dh = opendir($dir); while (false !== ($filename = readdir($dh))) { $files[] = $filename; } $delete = array(); echo "<table align=center cellspacing=0 cellpadding=5>"; $bg = '#eeeeee'; echo "<tr><td>File</td><td>Download</td><td>Delete</td><td>Public</td></tr><form method=POST>"; $re = array_search('..', $files); $rem = array_search('.', $files); unset($files[$rem], $files[$re]); $totalp = count($files); foreach($files as $id => $file){ $file1 = str_replace(" ", "_", "$file"); $file2 = str_replace(".", ".", "$file1"); $nfile = base64_encode("$file1"); echo '<tr>'; echo "<td align=left><a href=page.php?f=$nfile>$file2</a></td><td><a href=download.php?f=$nfile><b><font color=black>Download</font></b></a></td><td><input type=checkbox name=delete[] value=$file></td><td><a href=public.php?f=$nfile>Make Public</a></td></tr>"; echo '</tr>'; } echo "<tr><td>Total Files: $totalp</td><td></td><td><input type=submit name=subm value=Delete></td></tr></table></form>"; if(isset($_POST['subm'])){ $delete=$_POST['delete']; foreach($delete as $rfiles){ @unlink("userfolders/$folder/$rfiles") or die ("The file doesnt exist!"); $rem="DELETE FROM files WHERE Name='$rfiles'"; $result = mysql_query($rem) or die ("Error in query: $rem. ".mysql_error()); } } }
  20. put your session_start(); at the very top of your page right below your <?php
  21. Well ive recently noticed afew sits (including this one) have a picture in the address bar where the explorer page pic normally is, can someone please tell me how i do this, its been bugging me for awhile.
  22. will the php thingy update or will we have to wait 3 weeks for our times on sites to be correct again....
  23. ok, well i have a registration for an event and the user needs to enter how many items he needs and then it need to times that by the price, etc, but how do i make it so when the user changes the number of supplies it automaticly updates the total(without a submit button) i know how to do all the math just need the onchange code..
×
×
  • 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.