Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. Okay. Post the full path to where you have zend framework and the layout of your zend framework folder.
  2. Whats wrong with just calling the function?
  3. You have to define the location. window.location="http://yoursite.com/path/to/script.php";
  4. Use window.location instead. window.reload will resend the POST data.
  5. What are you using to refresh the page?
  6. Change this define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application/')); set_include_path(APPLICATION_PATH . '/../library' . PATH_SEPARATOR . get_include_path());[ to define('BASE' , realpath(dirname(__FILE__).'/../')); define('APPLICATION_PATH', BASE . '/application')); set_include_path(BASE. '/library' . PATH_SEPARATOR . get_include_path());
  7. Juding by what your urls are. Your code relies on an outdatted setting called register_globals (which has been disabled since 2002 and is soon to be removed completely as of php6). You should update your code so it doesn't rely on this setting. Doing this allows your code to be more portable and improve security. To help suggest what to do you should post your code inful.
  8. You'll want to setup virtual hosts for this. You can add virtualhost definitions at the bottom of the httpd.conf VirtualHost documentation
  9. Why are using mysqli_error here / Debugging message: echo '<p>' . mysqli_error($db_name) . '<br /><br />Querey: ' .$q. '</p>'; } //End of it ($res1) IF. when in the rest of your code you're using the standard mysql library functions? mysqli_* and mysql_* functions are not cross compatible. You should also realise session_is_registered or session_register are depreciated and should only be used if register_globals is enabled. You should change if(!session_is_registered(myusername)){ header("location:index_Staff.php"); } to if(!isset($_SESSION['myusername'])){ header("location:index_Staff.php"); }
  10. Change while ($qry = mysql_fetch_array($result)) { $c = 1; while($c < 5) { echo '<a href="'.$qry[album].'/'.$qry[picture].'"><img src="'.$qry[album].'/thumbs/'.$qry[picture].'"></a><br >; $c++; } to $i = 1; while ($qry = mysql_fetch_array($result)) { echo '<a href="'.$qry[album].'/'.$qry[picture].'"><img src="'.$qry[album].'/thumbs/'.$qry[picture].'"></a>'; if($i == 4) { echo '<br />'; $i = 0; // reset counter } $i++; }
  11. have a ead up on the following functions fopen fwrite fread fclose. Try out the code examples provided and see if you can do what you're asking.
  12. Change <div align="center"><form method=post action="<?php echo $_SERVER['PHP_SELF'] ?>"> to <div align="center"><form method=post action="<?php echo $_SERVER['REQUEST_URI'] ?>"> The problem is when the form is submitted it is cleaning the fileid and site from the url.
  13. Woops I missed of your form. Sorry about that. <?php if(isset($_GET['fileid'], $_GET['site']) && is_numeric($_GET['fileid']) && is_numeric($_GET['site'])) { $fileid = $_GET['fileid']; $siteid = $_GET['site']; $username = $_COOKIE['username']; $user_id = "SELECT id FROM users WHERE username = '$username'"; $user_id_result = mysql_query($user_id); list($userid) = mysql_fetch_row($user_id_result); $findsite = "SELECT site FROM site WHERE site_id = '$siteid'"; $find_result = mysql_query($findsite); list($sitename) = mysql_fetch_row($find_result); $findfile = "SELECT filename FROM file WHERE fileid = '$fileid'"; $find_file_result = mysql_query($findfile); list($file) = mysql_fetch_row($find_file_result); $loadcontent = 'sites/'.$username.'/'.$sitename.'/'.$file; //Start loading file if(isset($_POST['save_file'])) { echo 'EDITING '.$loadcontent.'<br />'; echo 'READABLE: '.(is_readable($loadcontent) ? 'true' : 'false') . '<br />'; echo 'WRITABLE: '.(is_writable($loadcontent) ? 'true' : 'false') . '<br />'; $savecontent = stripslashes($_POST['savecontent']); if ($fp = fopen($loadcontent, "w")) { echo 'OPENED: '.$loadcontent.'<br />'; fwrite($fp, $savecontent); fclose($fp); echo 'CLOSED'; } else { echo 'Could not save changed to '.$loadcontent; } } $loadcontent = htmlspecialchars( file_get_contents($loadcontent) ); } ?> <div align="center"><form method=post action="<?php echo $_SERVER['PHP_SELF'] ?>"> <textarea name="savecontent" class="editor_box"><?php echo $loadcontent ?></textarea></div> <br> <div style="float: right;"><input type="submit" name="save_file" value="Save"></div> </form>
  14. You already have a topic open here LOCKED
  15. Cleaned your script up try <?php if(isset($_GET['fileid'], $_GET['site']) && is_numeric($_GET['fileid']) && is_numeric($_GET['site'])) { $fileid = $_GET['fileid']; $siteid = $_GET['site']; $username = $_COOKIE['username']; $user_id = "SELECT id FROM users WHERE username = '$username'"; $user_id_result = mysql_query($user_id); list($userid) = mysql_fetch_row($user_id_result); $findsite = "SELECT site FROM site WHERE site_id = '$siteid'"; $find_result = mysql_query($findsite); list($sitename) = mysql_fetch_row($find_result); $findfile = "SELECT filename FROM file WHERE fileid = '$fileid'"; $find_file_result = mysql_query($findfile); list($file) = mysql_fetch_row($find_file_result); $loadcontent = 'sites/'.$username.'/'.$sitename.'/'.$file; //Start loading file if(isset($_POST['save_file'])) { echo 'EDITING '.$loadcontent.'<br />'; echo 'READABLE: '.(is_readable($loadcontent) ? 'true' : 'false') . '<br />'; echo 'WRITABLE: '.(is_writable($loadcontent) ? 'true' : 'false') . '<br />'; $savecontent = stripslashes($_POST['savecontent']); if ($fp = fopen($loadcontent, "w")) { echo 'OPENED: '.$loadcontent.'<br />'; fwrite($fp, $savecontent); fclose($fp); echo 'CLOSED'; } else { echo 'Could not save changed to '.$loadcontent; } } $loadcontent = htmlspecialchars( file_get_contents($loadcontent) ); } ?> It should output some debug messages to see whats going on
  16. You only need to enable forward port 80 if you are wanting to serve your website from your computer. However if all you're using it as a local test/developement machine then you dont need to forward port 80. Just use http://localhost/ instead.
  17. Oh! I didn't check over your code correctly here I corrected your code <?php $artist = array("Amen Ra", "Anaal Nathrakh", "Eminem", "Hellas Mounds"); $album = array("Mass I: Prayer I-VI", "The Codex Necro", "Marshall Mathers LP", "The Last Ferry to Cydonia"); $url = array("amen1", "anaal1", "eminem1", "hellas1"); $header = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">"; $footer = "\n</table>"; $tables = null; for($i=0;$i<count($artist);$i++) { $tables .= "\n <tr> <td align=\"right\" width=\"20%\"> $artist[$i] </td> <td align=\"right\" width=\"30%\"> <a href=\"$url[$i]\">$album[$i]</a> </td>"; // increment $i to get the next record in the array $i++; $tables .= "\n <td align=\"right\" width=\"20%\"> $artist[$i] </td> <td align=\"right\" width=\"30%\"> <a href=\"?music=$url[$i]\">$album[$i]</a> </td> </tr>"; } echo $header; echo $tables; echo $footer; ?>
  18. You can solve it by clicking the Solve Topic link just above the Quick Reply box. I have marked it solved for you.
  19. $b->$language; Should be $b->language;
  20. What do you get when you view source code? I have tested your code and it is error free and works fine. You must be doing something wrong somewhere. Post a screenshot of how your running your script.
  21. Yes you should be able to go to http://localhost/ or http://your-ipaddres/ However you may need to configure your router to forward port 80 to your computers LAN address and setup your firewall to allow external connections to port 80.
  22. If short tags is disabled then your code wont run and thus you'd get a blank page. You can tell if short tags is disabled as your source code will be present when you view your pages source code. Also you saving your PHP code within .php files?
  23. Tried clearing your browsers cache or simply do Ctrl + F5? Maybe its caching an old page.
  24. I see they are used on this line $loadcontent = 'sites/'.$username.'/'.$sitename.'/'.$file; But where are they defined/coming from? Variables must be defined before using them. Also you should avoid using short tags always use the full PHP syntax for tags (<?php ?>) and not <? ?>. The full syntax for <?= ?> is <?php echo ?>
×
×
  • 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.