Jump to content

synstealth

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

synstealth's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I am having trouble trying to pass the swf movie and images via headers to hide the path from the client when they are viewing a member's only movies or images. here's my code that im trying to do.. <? switch($request){ case 'movie': $file = 'movie.swf'; $filename = "videos_members/movies/movie.swf"; header('Content-type: application/x-shockwave-flash'); header('Content-length: '.(filesize($file)) ); break; case 'image': $file = 'image.png'; $filename = "images/image.png"; header('Content-type: image/png'); header('Content-length: '.(filesize($file)) ); break; } $contents = @ fopen($filename, 'rb'); if ($contents) { fpassthru($contents); exit; } ?>
  2. ive created members section with sessions to view images and movies. my problem is that once a member pays to view the image or movies, they are able to view the source and find the absolute path that points to an image. even if the directory listing is denied but it still gives access to the user who is trying to view the image or movie from a different location.. I want to hide the path that is visible in the source.. how do i do this. I was told to use http headers to pass the image using fpassthru.. im concerned abt security of using the fopen.. any idea or suggestions. I need to secure my site!!!
  3. user submits the hours they worked in db. there will be more than 5 rows of hours they submitted. I want to pull the rows of hours they submitted and add them up all to find out how many hours they have worked. the values will be in 0:00 format. how do I do calculation part (I know how to connect,pull records and get the times but i dont know how to add them up and total it in time format) help would be appreicated
  4. if you uploaded it as binary.. the text is just the same what is the code. may we see it.
  5. you have undefined varibale $searchtype <-- is it called from $_POST['searchtype']; ??
  6. I didnt realize I posted the old code.. here's the updated one. hope this is clear to understand what Im trying to do. function get_num($tbl,$value){ connect(); $total = mysql_num_rows(sql("SELECT * FROM $tbl")) or die(' <br /><center> <table border="1" bordercolor="red" cellpadding="0" cellspacing="0" width="450" height="100"> <tr> <td align="center"><b>There are no task to graph</b></td> </tr> </table> </center><br /> '); $query = sql("SELECT * FROM $tbl WHERE agenda_resource_id='$value'"); while($t = mysql_fetch_array($query)){ $fix = explode(":",$t['etw']); $h = $fix[0]; $m = $fix[1]; $h =+ $h; $m =+ $m; // how do I count the times without going past 60.... $clock = $h.':'.$m; } $result = mysql_num_rows(sql("SELECT * FROM $tbl WHERE agenda_resource_id='$value'")); $res_bar=''; $num = 5 - $result; for($bar=0; $bar<$result; $bar++){ $res_bar .= '<td bgcolor="orange" align="left">0</td>'; } for($b=1; $b<$num; $b++){ $res_bar .= '<td bgcolor="yellow" align="left">y</td>'; } $res_bar .='<td bgcolor="yellow">'.$clock.' Hours Remaining</td>'; $output = $res_bar; return $output; }
  7. I seem to have trouble counting the time pulled from database.. for example one record has 5 rows of clocked in times when pulled. it looks like this... 0:30 0:30 1:30 1:15 0:45 now I want to sum it all up and output the total time elapsed. I cant seem to stop the script from counting past "60" it just increments like a standard number.. I am little confused using the maketime() function. anyone glad to help ?? I just need to "see" the script to understand how to count the times so I can play around with it. (on my project I am making an progress bar that will output how much time is left - records pulled from db with users that has input # of hours they worked on a task. ) this is my example snippet using get_num() to gather the user's hours they clocked in. function get_num($tbl,$value){ connect(); $total = mysql_num_rows(sql("SELECT * FROM $tbl")) or die(' <br /><center> <table border="1" bordercolor="red" cellpadding="0" cellspacing="0" width="450" height="100"> <tr> <td align="center"><b>There are no task to graph</b></td> </tr> </table> </center><br /> '); $result = mysql_num_rows(sql("SELECT * FROM $tbl WHERE agenda_resource_id='$value'")); $res_bar=''; $num = 5 - $result; // maximum 5 hours they are allowed to work // calculates the remain time for($bar=0; $bar<$result; $bar++){ $res_bar .= '<td bgcolor="orange" align="left">0</td>'; } for($b=1; $b<$num; $b++){ $res_bar .= '<td bgcolor="yellow" align="left">y</td>'; } $res_bar .='<td bgcolor="yellow">'.$clock.' Hours Remaining</td>'; // undefined variable - $clock is the calculated time they have left return $res_bar; } it outputs as orange background indicates the time used. yellow background is the "progress bar" to show how much time is left with the value ($clock) hope I am clear..
  8. here, i will make things alot easier for you guys. just go here [a href=\"http://deafglobetrotterstravel.com/show.php\" target=\"_blank\"]http://deafglobetrotterstravel.com/show.php[/a] it will show a edit button and a form for you to upload an image, once you do that. it throws an error saying its not there code is on the bottom of the site itself. very simple code and yet it wont cooperate.. i had it working before and now it refuses.. what is up.. what am I doing wrong here?? [a href=\"http://deafglobetrotterstravel.com/show.php\" target=\"_blank\"]http://deafglobetrotterstravel.com/show.php[/a]
  9. I created two sql tables (tours and cabinrates) and insert data to tours, then get tourid, and use it to insert the cabinrates data .. while it inserts the cabinrates, it inserted names and tourid. but the prices will not work. it only inserted the last row and im struggling and trying to find out why and how to fix this. I might be blind. please help. [code] if(isset($_POST['add_tour_final_button'])){     $cn = $_POST['tnam'];     $ch = $_POST['thig'];     $cm = $_POST['tmap'];     $ci = $_POST['tinf'];     $cc = $_POST['tcod'];     $cd = $_POST['tdur'];     $cs = $_POST['tsta'];     $ce = $_POST['tend'];     $ca = $_POST['taut'];                              $cabins = array('Inside'     => $_POST['Inside Cabin'],                     'Ocean'     => $_POST['Ocean View'],                     'Junior'     => $_POST['Junior Suite'],                     'Penth'        => $_POST['Penthouse']);      // INSERT INTO tours     connect();                                // this is a fucntion to connect to sql     $check = sql("SELECT * FROM tours WHERE tourcode='$cc'");   // another function to run mysql_query     if($tchk = @mysql_fetch_assoc($check)){         echo 'tour info already inserted!<br />';         $inserted = true;     }else{             $query = "INSERT INTO tours (tourname, tourhighlights, tourmap, tourinfo, tourcode, duration, startdate, enddate, tourauth)                   VALUES ('$cn','$ch','$cm','$ci','$cc','$cd','$cs','$ce','$ca')";         $addtour = sql($query);         @mysql_affected_rows($addtour);         $inserted = true;     }     if($inserted){         $gettourid = sql("SELECT tourid FROM tours WHERE tourcode='$cc'");         while($trow = @mysql_fetch_array($gettourid))    {$tourid = $trow['tourid'];}     }     echo 'your tourID is: '.$tourid.'<br />';      // INSERT INTO cabinrates                 <--- this section below is where Im having the problem.     $num = 0;     foreach($cabins as $size => $cost){         $query2 = "INSERT INTO cabinrates (cabinname, cabinprice, tourid) VALUES ('$size', '$cost', '$tourid')";         $addcabins = sql($query2);         @mysql_affected_rows($addcabins);         $num = $num + 1;     }     echo 'you have added '.$num.' rows of cabinrates<br />';     mysql_close(); blah. nothing here. ?> [/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.