Jump to content
Larry Ullman's Book Forums

michiel

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About michiel

  • Rank
    Newbie
  1. Ok, maybe I'm just making it unnessarily difficult for myself. Thanks for your reply.
  2. The idea I had was this: have the website in a directory (in this case called html, but it could be named anything.) and put other files 'above' it, namely the .htpasswd file I quote: ...This is the file that contains all the usernames and encrypted passwords for your site. It's extremely important that you place this file outside of the web root. You should only be able to access it by FTP, not over the web...
  3. I want to redirect a my site url to a directory on the server.. I ftp the site to a folder: html/myfiles... (not directly in the root, so that I can place other files there htaccess pswds etc) my host says I should use this code: RewriteEngine On Options +FollowSymlinks RewriteBase / RewriteCond %\{HTTP_HOST\} site.com RewriteCond %\{REQUEST_URI\} !^/html/? RewriteRule ^(.*)$ html/$1 [L] But when I place the htaccess file in the root (that is the area when I arrive when I ftp?) I get a internal server error. (site.com is an example) I tried mod alias aswell... It shouldn't be t
  4. Hi, I installed pear on my computer and built a site using html_QuickForm2. All very nice. Then I upload the site to my shared webhost and the pages that have the quickform in it are not showing. Pear is installed (I can see this in the php info file.) The path would be: .:/usr/share/pear:/usr/share/php My code now is like this (but still no show ;-( $path = '.:/usr/share/pear:/usr/share/php'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); require('HTML/QuickForm2.php'); Do I have to upload the quickform files aswell? And where would I put them?
  5. Hi, This works ... if (!$user->canEditPage(new Page($id))) { header("Location:index.php"); exit;}
  6. is this what we want? if (!$user->canEditPage(new Page($_GET['id']))) { header("Location:index.php"); exit;}
  7. Hi, one last question regarding this code. Specifically this snippet: if (!$user->canEditPage(new Page)) { header("Location:index.php"); exit;} Is this the right way to make the object from the page class? The parameter works, but it doesnt seem right to me. I havent seen this before. The site is coming along fine otherwise.
  8. Succes! Thank you for the lead. I went for the hidden form input method. It works now. Now up to the next task: delete the page ;-) Michiel
  9. Still having trouble :-( The problem is the UPDATE .... WHERE...statement. I dont know how to retireve the page id. I tried with $page->getId( ) ; $_GET['id']. Etc. Now: with the code below I can edit and update the data base, except: I update all the rows (as expected, but hey: the connection works). Any suggestions? <?php # edit page.php require('includes/utilities.inc.php'); //code is dubious!!!!!!!!! if (!$user->canEditPage(new Page)) { header("Location:index.php"); exit;} //-----------------------------------------
  10. Solved it! But new problem arises: the edits are 'updated' in the form but not in the database..
  11. Hi, I try to create the edit_page.php I am able to to retrieve the data from the data base and populate the new html quickform using addDataSource method. This is my pdo statement: $stmt = $pdo->prepare('SELECT title, content FROM pages WHERE id=:id'); $stmt->execute(array( ':id' => $_GET['id'])); $stmt->setFetchMode(PDO::FETCH_CLASS, 'Page'); $result=$stmt->fetch(); //then I create new form (I dont paste the whole code here) and pull content from database in form using addDataSource. So far it works: $form->addDataSource(new HTML_QuickForm2_DataSource_Array(array(
×
×
  • Create New...