Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. You could try using ../upload/ as the path, eg: <img src="../uploads/image.jpg"> ../ means go up one level higher in the directory tree.
  2. Only one path needs to be true. This one is duff: Configuration File (php.ini) Path C:\WINDOWS However this one is correct: Loaded Configuration File C:\PHP\php.ini When PHP reports C:\WINDOWS that means it cannot find a php.ini file. But on your setup PHP is reading the correct .ini file. Ok what I need you to do now is to go into the php.ini and turn a setting called display_startup_errors on. By changing its default value from Off to On. Save the php.ini and restart Apache. If PHP is having trouble loading extensions that you have uncommented in the php.ini it will notify you when Apache starts up again. Can you post the error messages you get.
  3. Mod rewrite wont help here. If you don't want the PHPSESSID to be displayed in the url and cookies is not available then I guess it would be best for you to write your own custom session handler by saving session data to a database and tracking the user via their IP address rather than a cookie. Have a read of the manual on setting your own session handler rather than using PHP's default handler.
  4. In header.php you are calling session_start() when you have outputted HTML. You cannot call session_start() when any form of output has been made. I recommend you to add session_start() as the first line in login.php and main.php. Remove session_start from header.php. You don't need it in header.php as you are including this file.
  5. Try: <?php echo '<th class="iteamcell">Asset Owner:</th> <td class="itextcell"> <select name="assetowner">'; //Retrieve valid values from the DB and populate the drop down list $queryb = "SELECT ASSETOWNER FROM newcheckvalues WHERE ASSETOWNER <> 'XX' "; $resultb = mysql_query($queryb); if (mysql_num_rows($resultb) == 0) { echo '<p><em>Error 200 - database in wrong state. Please try again.<em></p>'; } else { // echo '<p><em>Query $queryb ran and produced $numRowsb rows<em></p>'; while ($row = mysql_fetch_assoc($resultb)) { $myassetowner = $row['ASSETOWNER']; $selected = ($myassetowner == $assetowner) ? 'selected' : ''; echo '<option value="' . $myassetowner . '"' . $selected . '>' . $myassetowner . '</option>'; } } echo '</select></td>'; ?> You must surround html attribute values with quotes. Otherwise if attribute values contains spaces the the browser will treat each ground of characters after spaces as separate attributes and not a whole string and thus you think your spaces are being lost.
  6. Is your php.ini in C:\PHP? If so PHP is reading your php.ini Also did you manage to find a MySQL section/heading when you ran phpinfo? You didn't reply when I asked you that question earlier. If you cannot find a MySQL section/heading then it looks like PHP is having trouble loading the mysql extension - even though you have enabled the extension in the php.in If you answer Yes and No for the above questions then I may know what the problem could be.
  7. Did you restart the MySQL server? You must restart the MySQL server when you modify the my.ini file
  8. Where in the manual does it say that? isset is not case sensitive In fact all functions within PHP are case insensitive.
  9. Not sure if my corrections fixed it or not: <?php Class Media_handler { function Convert_Media($filename, $rootpath, $inputpath, $outputpath, $width, $height, $bitrate, $samplingrate) { $outfile = ""; // root directory path, where FFMPEG folder exist in your application. $rPath = $rootpath . '\ffmpeg'; // which shows FFMPEG folder exist on the root. // Set Media Size that is width and hieght $size = $width . 'x' . $height; // remove origination extension from file adn add .flv extension, becuase // we must give output file name to ffmpeg command. $outfile = $filename; // Media Size $size = $width & "x" & $height; // remove origination extenstion from file and add .flv extension, becuase // we must give output filename to ffmpeg command. $outfile = 'out_file.flv'; // Use exec command to access command prompt to execute the following FFMPEG Command // and convert video to flv format. // exec('command',output array,int return value) $command = 'C' . $rootpath . '\ffmpeg -i "' . $inputpath . '\\' . $filename. ' -acodec mp3 -ar ' . $samplingrate . ' -ab ' . $bitrate . '-f flv -s ' . $size . ' ' . $outputpath . '\\' . $outfile; // return output file name for other operations return $outfile; } // Becuase FFMPEG can't set Buffering for flv files , so i use another tool that is FLVTool // to set buffering of flv file. You must put all files with root folder into the main folder // of your web application. function set_buffering($filename, $rootpath, $path) { // root directory path $_rootPath = $rootpath . '\flvtool'; // Execute FLV TOOL command also on exec , you can also use other tool for executing command // prompt commands. // exec('command',output array,int return value) $command = '/C' . $rootpath . '\flvtool2 - U' . $path; // Execute this command to set buffering for FLV } // This function is used to Grab Thumbnail Image from Generated Flv files , to be display on the list, // Note that, FFMPEG can create thumbnail only from FLV Files.. function grab_image($filename, $rootpath, $inputpath,$outputpath, $no_of_thumbs, $frame_number, $image_format, $width, $height) { // root directory path $_rootpath = $rootpath . '\ffmpeg'; // Media Size $size = $width . 'x' . $height; // I am using static image, you can dynamic it with your own choice. $outfile = 'sample.png'; // exec('command', output array, int return value) $command = '/C' . $rootpath . '\ffmpeg -y -i ' .$inputpath. '"' . $filename . ' -vframes ' . $no_of_thumbs . ' -ss 00:00:03 -an -vcodec ' . $image_format . ' -f rawvideo -s ' . $size . ' ' . $outputpath . '"' . $outfile; // Execute this command using exec command or any other tool to grab image from converted flv file. Return $outfile; } } ?> I tried my best but it is very poorly coded. Corrections are untested. If you continue to get errors then I would suggest you to look for a working script.
  10. Do you see a mysql heading/section when you run phpinfo() on its own: <?php phpinfo(); ?> If you can't find a mysql heading/section then check that PHP is reading the php.ini file you are editing. You can check this by searching for either Configuration File (php.ini) Path or Loaded Configuration File (when you have ran phpinfo function) and seeing what they are set to. If either of the paths stated is not correct then PHP is not reading your php.ini
  11. Your configuration appears to be fine. What is the file name this code is in? You must place PHP code within a .php file. You cannot place PHP code in .html files or any other file extension unless the server is configured to parse these files with PHP interpreter.
  12. Not too bad. You could just shorten it fully using regex. But for now you could just tidy the function up abit with using a foreach loop: <?php function line_stripper($url, $checker, $filter) { $file = file_get_contents($url); $lines = explode("\n", $file); $list = array(); foreach($lines as $line) { if( strpos($line, $checker) === 0 ) { $short = strpos($line, $filter); if( empty($short) ) { $list[] = trim(strip_tags($line)); } } } return $list; } $result = line_stripper('http://crappytools.com/pingurls/list.asp', 'http', 'fails'); echo '<pre>' . print_r($result, true) . '</pre>'; ?> I used trim and strip_tags function as you code was returning the <br> tag. ANd trim to just remove any whitespace characters at the beginning/end of the url.
  13. Add the following two lines of code at the top of the page which gives a blank page: display_errors('1'); error_reporting(E_ALL); Retest. Do you get any error messages now? If you do post all errors here in full.
  14. I don't think PHP supports visibility keywords (public, protected or private) when defining a class. Only for properties and methods. Also these keywords are only available in PHP5.
  15. It doesn't really matter whether you use / or \ in file paths. However really for Windows you are supposed to use \ in paths. Also I generally stay clear of the installer. IMO it is best to manually configure Apache instead. Also make sure any changes you make to Apaches config file (httpd.conf or even php's (php.ini) make sure you restart Apache for the changes to take effect.
  16. If you get a blank screen I would recommend you to go into the php.ini and turn a setting called display_errors on. Save the php.ini and restart Apache/WAMP If there is any errors PHP will now spit them out to the screen.
  17. How do you mean your can't access localhost? Can you post more info on how you are trying to connect to localhost. Have you tried http://127.0.0.1 instead?
  18. Can you post the full error message you get. Also how are you using this code? Are you using it on its own or are you including this within a script somewhere?
  19. Looks like you don't have the mysql extension enabled in the php.ini. Have a read of this FAQ for enabling the MySQL extension. Also I recommend you to turn display_errors on to within the php.ini aswell as setting error_repotting to E_ALL too.
  20. Have you enabled the mod_rewrite module within the httpd.conf file and have you set AllowOverride directive to either All or FileInfo in order for Apache to read .htaccess files
  21. On Windows you cannot create/rename files to .htaccess by right click > Rename. Instead you have to open the file up into a text editor - such as notepad. Once opened in notepad Go to File > Save As... Type ".htaccess" (minus the quotes) in to the Filename box and make sure File Type is set to All Files. When you click save a file will be created with name you specified in the Filename box
  22. huh! the action attribute submits the data to the specified file. So when you submit the form the browser will go to and submit the form data to the url specified in the action attribute.
  23. Your configuration is incorrect if you are getting that error. Could you post what lines you have added to the httpd.conf file when you installed PHP.
  24. Where are you saving test.php to? By default Apache servers the htdocs/ folder within Apache's installation folder. This is where you should be saving test.php to. Unless you have modified the document root in Apaches configuration file
  25. Nothing to do with PHP. It's to do with your MySQL password for the user you are using to log onto the MySQL server with.
×
×
  • 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.