Jump to content

w3sl3y2003

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

w3sl3y2003's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi all, I have a problem with a video i'm allowing browsers to download from my intranet website (using HTTP). It's about 78.5MB in size. People are able to download the entire video to their local machine or just watch it without saving it. The problem is that the complaints i'm getting from people is really strange. Some people download or watch the video and get the error message that says "Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file." , and other people who choose to download the video to their machine get a file that varies in size but is always less than the actual file size (Eg. the size of the file might be 22MB one time and 17MB the next) even though the "download" dialog box shows that the file is 100% downloaded. Does this problem stem from a problem apache might have with large files? Thanks in advance!
  2. sorry for that! The problem I have is the following : After I login (using IE), if I close my browser window and open up another browser window and attempt to go directly to http://localhost/scripts/secure/execute.php I am redirected to http://localhost/scripts/enter.php - which is correct. However if I try to go directly to http://localhost/scripts/secure/execute.php (using firefox) I am allowed to access the page because a cookie has been created on my machine.
  3. Hi all, Excuse the verbosity - I want whoever reads it to be really clear on what my problem is :-) I have a small application that uses sessions as a means of authenticating users to a secure section. The problem is that it works ideally when using Internet Explorer 6 but doesn't work with Mozilla Firefox. I've narrowed the reason down to the way Firefox handles sessions. My application structure is as follows http://localhost/scripts | ------enter.php http://localhost/scripts/secure | -----execute.php A user gains access to execute.php by navigating to the enter.php page where a user is prompted with a username and password field. If the user enters the correct details a session is set indicating that the user is logged in. The user is then transferred to the /secure/execute.php page which checks the session variable to see if the user is logged in. If however, a user navigates directly to http://localhost/scripts/secure/execute.php they are supposed to be redirected to http://localhost/scripts/enter.php The problem I have is the following : After I login (using IE), if I close my browser window and open up another browser window and attempt to go directly to http://localhost/scripts/secure/execute.php I am redirected to http://localhost/scripts/enter.php - which is correct. However if I try to go directly to http://localhost/scripts/secure/execute.php I am allowed to access the page because a cookie has been created on my machine. Any help is appreciated!
  4. Hi all, I have an application that uses a modal dialog window to display a survey, however as soon as i go to the next page of the survey (via a submit button), it opens a new browser window. How do i ensure that as soon as i click on the "next" button, the new page will stay within the dialog window? All help would be appreciated!!
  5. Thanks for the helping hand ProjectFear! "so the problem is your not getting a value from the hidden field?" - every time i click on one of the page numbers it the value of $current_index is reset to null. Unfortunately ; didn't make a difference. Any ideas?
  6. Hi all, I'm pretty much a noob at php and really need some help if someone is willing and able. I'd like to create a self-processing form that uses pagination to traverse a database resultset. I've basically nailed the cause of the problem that i have down to the fact that when i try to read the value i store in a hidden field, it's always null. I've included just a rough skeleton of what i'm trying to do (without the unnecessary db code), to just simulate the problem. This code has the same problem as my original attempt by the way. **************************PHP******************************* <html> <body>         <br>         <div>         Previous news bulletins         </div>         <br> <?php         $current_index = $_POST['current_index'];         printPageNumbers(262);                 for($i=0; $i<10; $i++)         {           print "Current Index = " . $current_index . "<br>";           $current_index++;         }                 print "-------------------------------";                 ?>         <form name="testform" method="POST" action="<?php echo $_SERVER['PHP_SELF'] ?>">             <input name="current_index" value="<?php print $current_index ?>" type="hidden">         </form> <?php     function printPageNumbers($num_rows)   {     $remainder_page_size;     $num_pages = (int) ($num_rows / 10);      //10 is the number of rows per page     if(($num_rows / 10) > (int)($num_rows / 10))     {       $remainder_page_size = $num_rows - (int)($num_rows / 10);       $num_pages++;     }     $page = (is_numeric($_GET['page']) && $_GET['page'] > 0) ? $_GET['page'] : 1;     for($k = 0; $k < $num_pages; $k++)//for($k = ($page - 2); $k <= ($page + 2); $k++)     {             echo ($page == $k) ? "[$k] " : "<a href='{$_SERVER['PHP_SELF']}?option=com_news&ItemId=68&page=$k'>$k</a> ";            } // end for     print "<br>"; //    return $page;   } ?> </body> </html> **************************PHP******************************* Any and all help is greatly appreciated!
  7. okay HuggieBear, [b]frmSubmit.php[/b] [code]<html> <head> <title>Applet Text Editor</title> </head> <body> <form action="frmUpdate.php" method="POST"> <?php $preview_file = "scroller/preview_scroller.txt"; $handle = fopen($preview_file, 'r'); $MAX_DATA = 500; //READ IN 500 BYTES OF DATA $total_data = ''; if(file_exists($preview_file)) { while($data = fread($handle,$MAX_DATA)) { $total_data = $total_data. $data; //APPEND INPUT } echo "<input type=\"hidden\" name=\"current_scroller_text\" value=\"" . $total_data . "\">"; echo "<textarea name=\"txtScrollerText\" rows=8 cols=60>".     $total_data .     "</textarea>"; fclose($handle); } ?> <br> <input type="submit" name="btnSubmit" value="submit"> <br> </form> </body> </html>[/code] [b]frmUpdate.php[/b] [code]<?php if(isset($_POST['btnUpdateSubmit'])) { //header("Location: frmSubmit.php"); //should write "old" text back into preview file if('return confirm("Are you satisfied with the new message?");') {                 //        $txtScrollerText = $_POST['txtScrollerText']; // print("strScrollerText = ".$strScrollerText);         $production_file = "../scroller/scroller.txt";                 $prod_handle = fopen($production_file, 'w');         fwrite($prod_handle,$strScrollerText);         fclose($prod_handle); header("Location: frmSubmit.php"); } else { // $current_scroller_text = $_POST['current_scroller_text']; $preview_file = "scroller/preview_scroller.txt"; $preview_handle = fopen($preview_file, 'w'); fwrite($preview_handle,$strOldPreviewText); fclose($preview_handle); header("Location: frmSubmit.php"); } } else { $strScrollerText = $_POST['txtScrollerText']; $strOldPreviewText = $_POST['current_scroller_text']; // print("current_scroller_text : " . $strScrollerText); $preview_file = "scroller/preview_scroller.txt"; $preview_handle = fopen($preview_file, 'w'); fwrite($preview_handle,$strScrollerText); fclose($preview_handle); } ?> <html> <body> <!-- process data stored in variable --> <form method="POST" action="<? print $_SERVER['PHP_SELF']?>"> <input type="text" name="strScrollerText" value=" <?php print $strScrollerText ?> "> <input type="text" name="strOldPreviewText" value=" <?php print $strOldPreviewText ?> "> <input type="submit" name="btnUpdateSubmit" value="Submit" value='Yes/No' onclick='return confirm("Are you satisfied with the new message?");'> </form> </body> </html>[/code] [b]Please use the code tags when posting code to the forum.[/b]
  8. Hi all, I'm having a problem with self-processing forms (forms that have action=$PHP_SELF) losing their values. What i do is store the values of certain variables in hidden fields. I give the hidden fields the same name as the variables. But as soon as i submit the form, i check the source after the page has been rendered and i see that the values in the hidden fields have disappeared. Eg. [b]Before submit[/b] <form method="POST" action="/app_ed/frmUpdate.php"> <input type="hidden" name="strNewText" value=" This is a test message on the dev webserver "> <input type="hidden" name="strOldText" value=" This is a test message "> <input type="submit" name="btnUpdateSubmit" value="Submit" value='Yes/No' onclick='return confirm("Are you satisfied with the new message?");'> </form> [b]After submit[/b] <form method="POST" action="/app_ed/frmUpdate.php"> <input type="hidden" name="strNewText" value="  "> <input type="hidden" name="strOldText" value="  "> <input type="submit" name="btnUpdateSubmit" value="Submit" value='Yes/No' onclick='return confirm("Are you satisfied with the new message?");'> </form> What could've caused the values to disappear?
  9. Hi all, When ever i try to use $PHP_SELF it fails because its empty. register_globals is turned off. What could be the cause of this? All assistance is appreciated!!
  10. Found the problem! Guess who's the idiot who has a typo in his source  >:( Thanks effort though guys!!!!!!!
  11. Sorry for being rude - thanx for the replies guys!!! i've modified the code and used [b]$_POST[/b] to "initialise" the variables but i still don't get anything. should i set [b]register_globals[/b] to yes?
  12. php variables are dynamic heap variables so they don't need to be declared/defined prior to their use.
  13. Hi all, I'm just starting with form handling and i have a problem with passing variables between forms. I have 2 forms eg9.4.php [b]<html> <head> <title>Listing 9.4 An HTML form including a SELECT element</title> </head> <body> <form action="eg9.5.php" method="POST"> <input type="text" name="user"> <br> <textarea name="address" rows="5" cols="40"> </textarea> <br> <select name="products[]" multiple> <option>Sonic Screwdriver <option>Tricorder <option>ORAC AI <option>HAL 2000 </select> <br> <input type="submit" value="hit it!"> </form> </body> </html>[/b] and eg9.5.php [b]<html> <head> <title>Listing 9.5 Reading input from the form in Listing 9.4</title> </head> <body> <?php print "Welcome <b>$user</b><p>\n\n"; print "Your address is:<p>\n\n<b>$address</b><p>\n\n"; print "Your product choices are:<p>\n\n"; print "<ul>\n\n"; foreach ( $products as $value ) { print "<li>$value<br>\n"; } print "</ul>"; ?> </body> </html>[/b] when i click on the button in eg9.4.php it's supposed to show me what i choose and display it on eg9.5.php. but when i do that nothing comes up on 9.5 except [b]Warning: Invalid argument supplied for foreach() in /srv/www/htdocs/app_ed/eg9.5.php on line 11[/b]. When i run through all of the [b]$HTTP_POST_VARS[/b] it shows me all of the posted variables including what i entered in the textbox and textarea which is what i wanted. Where could i be going wrong?
×
×
  • 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.