Jump to content

dptr1988

Members
  • Posts

    372
  • Joined

  • Last visited

    Never

Everything posted by dptr1988

  1. Yes I tried exec() later and it works now
  2. I'm trying to make a PHP script that will restart my Apache webserver. But when I use shell_exec() it doesn't return any results. And Apache prints the help message and says 'apache.exe: illegal option -- k' Is the '-' character something special, like the backslash, in PHP? The PHP manual says that shell_exec() returns a string, but the string was empty and the output was the the main error log of Apache. Can a program that you call with shell_exec() redirect it's output somewhere else? Here is the code that I'm using. Note that there is a space between the shell_exec and the brackets (). Thats because phpfreaks.com tells me '403 forrbidden You don't have permission to access /forums/index.php on this server.' if I don't have that space there. [code] // This is the code $cmdline = $server_exe.' -k stop'; $rslt = shell_exec ($cmdline); print_r($GLOBALS); echo '<HR>Result<HR>'.$rslt; [/code] This is the result that I get from print_r($_GLOBALS); [code]     [include_file] => C:\FTB\dptr1988.mooo.com\htdocs\local\sample.conf     [apache_dir] => C:/Program Files/Apache Group/Apache2/conf/     [current_file] => C:/Program Files/Apache Group/Apache2/conf/dptr1988.mooo.com.conf     [server_exe] => "C:/Program Files/Apache Group/Apache2/bin/apache.exe"     [cmdline] => "C:/Program Files/Apache Group/Apache2/bin/apache.exe" -k restart     [rslt] => [/code] The command line works when I enter it in the command prompt, so it's a good command line. Is there a better way to run programs instead of using shell_exec()? Thanks
  3. Yes it will slow down the server some because of the extra script it has to read. But it shouldn't slow it down much if your include file is small. I don't know exactly how much it would slow it down. You would need to run a benchmark on your server to see exactly how much it does slow it down. Just guessing, an include file under 100Kb should be no problem.
  4. If you could post some details on what you are doing when you get that error, I might be able to help
  5. It looks like that PHP code was depending on 'register_globals' to be on. Try using $_POST['var_name'] instead of $var_name
  6. So you want to find the absolute path of your include files? The filenames in PHP need to be based on the real filesystem of your server rather then the virtual one that HTML uses. Does you $_SERVER['SCRIPT_FILENAME'] variable work? If it does then you can use that varible in your include files to find the absolute path to them. Then you could use the full path every time you included those files in the pages. I don't know what else to do ( in my limited knowledge ) if you can't use the $_SERVER['SCRIPT_FILENAME'] variable.
  7. In my understanding, the \n escape sequence is converted to a number (0Ah) during the execution of your script. Plain text editors will normally go to a new line when they read that number. The < BR/> is a tag the tells the browser to make a newline because HTML browsers do not make new lines when the read the number 0Ah. So '\n' represents a newline for text editors, < BR/> represents a new line for HTML browsers.
  8. I don't think I understand what you are trying to do. If I have it right, you have a include file that is always moving around and file1.php and file2.php are staying in the sampe place? Or are file1.php and file2.php moving around? It would help me if you could post the which files are moving, which ones are not.
  9. If you have access to your 'php.ini' you could try setting the include_path variable If you don't have access to 'php.ini' you could try using the $_SERVER['SCRIPT_FILENAME'] variable to determine the location of the script you are running and then adjust you include path.
  10. So I guess that 'Warn (0%)' means I'm ok. Thanks
  11. On the left side of the post where the user iformation is displayed (name, # of posts, etc..) at the bottom, it says "Warn: (0%)" and then 5 bars after it. What does that mean? Thanks
  12. I would suggest that you create 3 tables. One for the user_accounts, like you have, one for the e-mails, and one for the attachements. Then add a UserID column in the e-mail and attachment tables so you can connect the users with there emails. That way you only need 3 tables for all of your users. I'm new to MySQL myself so don't believe what is say! [img src=\"style_emoticons/[#EMO_DIR#]/smile.gif\" style=\"vertical-align:middle\" emoid=\":smile:\" border=\"0\" alt=\"smile.gif\" /] But that is the way I would do it. For me, posting the tables your are using helped me understand what you are trying to do. Thanks dptr1988
  13. Before you start designing table structures, I've found it's good to decide, in detail, all of the data you want to store. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] users have inbox limited to 10 MG, each user can send and recieve messages.. attachments are also allowed.. each user can send and receive more than one attachment. each user has a profile with picture, if that's possible.. each user has favorite contacts.. user email.. consists of inbox messages, sent items, drafts, and trash bin.. [/quote] There are many ways to store e-mail data. And your description is pretty vague. Take the time to plan out your data that you want stored and it will make it easier to help you. dptr1988 BTW This forum is kind of slow. So be patient.
  14. No, your can't decrypt MD5, but you can crack short passwords with a brute force attack. About 25 seconds for a four letter password. And maybe 2 days for a 12 letter password. About the website part. Are you wanting a free webhost? One that runs PHP and MySQL? I didn't understand your post. But think I could help. dptr1988
  15. [!--quoteo(post=383999:date=Jun 14 2006, 03:00 PM:name=kenrbnsn)--][div class=\'quotetop\']QUOTE(kenrbnsn @ Jun 14 2006, 03:00 PM) [snapback]383999[/snapback][/div][div class=\'quotemain\'][!--quotec--] You can initialize your check boxes to a known value like this: [code] <input type="hidden" name="box2" value="no"> <input type="checkbox" name="box2" value="yes"> [/code] When this code is processed by the browser, if the box isn't checked your script will see the "no" value, if it is checked, the "yes" value will be passed. Ken [/quote] That's a great solution to the checkbox problem!! The way I always did it was to set all your checkbox vars to 'no' and then only set them to 'yes' if you found your checkbox in the $_POST array.
  16. Thank you, fenway, for helping me!! That third table is what I couldn't figure out. dptr1988
  17. I have a list of users and a list of files and I want to use MySQL to decide which user can access which file. I was thinking of create one table for the users and another one for the files. Then each entry in the file table would say which user could access it. But how can I make it so I can have multiple users in each file table entry? Do you have any suggestions on the basic structure of the tables? Thanks
  18. readfile() was sending NTFS stuff. So I replaced it with fopen() fread() print() and now it works. Thanks poirot for helping me with my headers!
  19. I sent the Content-Length header and now the files are the right size. But now there is garbage in the files. I made a file full of zeros and tried downloading it and there are a whole lot of other numbers besides zero. And it's not readable text or anything that looks good. It just looks like random numbers. Am I useing the wrong content type for a binary file? BTW here's the way I'm sending the Content-Length header: [code] header('Content-Length: '.filesize($filedir.$_GET['fname'])); [/code] Thanks
  20. I made a php script for sending a file but it only sends the first 24,576 bytes. This is the code: [code] header('Content-type:  application/binary'); header('Content-Disposition: attachment; filename='.$_GET['fname']); readfile($filedir.$_GET['fname']); [/code] Then run the script with "send_file.php?fname=filename.jpg" and everything is normal except that the file is limited to 24,576 bytes. Do I need to change a setting in my php.ini? Thanks
×
×
  • 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.