Jump to content

cwncool

Members
  • Posts

    50
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

cwncool's Achievements

Member

Member (2/5)

0

Reputation

  1. How can I create urls like '/index.php/blog/comments/' without mod_rewrite? I know how to do urls with GET statements and I know how to make my urls such as I ask with mod_rewrite, but I've seen some frameworks like CodeIgniter that create urls like '/index.php/blog/comments/' without mod_rewrite. I'd like to know possibly how to do this. Thanks!
  2. Okay. That makes sense. Sorry about that dumb mistake. I should've noticed that one easily. Thanks!
  3. Oh, haha. Whoops. Anyway, that still doesn't solve my problem though. Now that I go to my index.php page, it just shows nothing. It just pulls up a blank page. Do you have an idea why that could be?
  4. Well, if you just want to change the file extension, why? Is it because you want to include PHP on those pages? If so, just rename them to .php instead of .htm and then you can put PHP on them. Even if you don't want to add PHP, you can still rename them as .php and they'll still work. To answer your question though, if you still want to do a mod rewrite - here are some tutorials: http://www.webforgers.net/mod-rewrite/basic-tutorials.php
  5. I'm trying to learn some more OOP, and am trying a simple template system. These are the files I have right now: class.php <?php class template { var $template; function load($filepath) { $this->template = file_get_contents($filepath); } function replace($replace, $string) { $this->template = str_replace("#".$replace."#", $string, $this->template); } function display { return $this->template; } } ?> index.php <?php include 'class.php'; $template = new template; $template->load('index.html'); $template->replace('name', 'My name here'); $template->replace('dadname', 'My dads name here'); $template->display(); ?> index.html <html> <body> <h1>My name is: #name#</h1> <h2>My dad's name is: #dadname#</h2> </body> </html> It ends up just displaying this: My name is: #name# My dad's name is: #dadname# I guess that means it's obviously fetching the template data correctly, but it's not replacing and/or outputting correctly. Can someone see what the problem is in this situation?
  6. Ohh. Okay. Thanks for clearing that up. I'll just stick with 'var' for possible server issues. Thanks!
  7. Can someone please tell me the different class variable types, and when to use them? Like what's the difference between just stating "var $hello" and "public $hello" or "private $hello". I know what public and private mean, but like to what does the public and private apply to, etc.? Thanks!
  8. Okay. Thanks. I sort of thought that, but I wasn't sure. I guess I've been using associative arrays all along anyway. lol. Thanks!
  9. I did look both of them up in the php manual before posting here. The only thing I noticed different, was fetch_array, can fetch any type of array, while fetch_assoc only fetches associative arrays. I don't know what the different type of arrays mean though. I guess a better question to ask would have been: What's the difference between a MYSQL_ASSOC and a MYSQL_NUM array?
  10. I've always used mysql_fetch_array to get arrays for data, but I'm wondering what the difference between mysql_fetch_array and mysql_fetch_assoc is... Thanks!
  11. If I am understanding your question correctly, couldn't you do that with something like this in an .htaccess file in the directory your site is at: Options +FollowSymlinks RewriteEngine On RewriteRule ^users/(.*)/(.*)/?$ /users.php?user=$1&section=$2 ...and just repeat rewrite rules like for each different thing you want to do?
  12. I tried adding the error checker, but it did not show any errors. What I'm thinking is that the new host has some feature in PHP or MySQL enabled or disabled that is doing something to prevent it from working. I really can't figure this out. haha.
  13. Yes, I can echo the $q fine and it works. Yes, I did change that information. My whole site is based around MySQL and everything else is being called and displayed correctly, so the connect page works. The queries I'm running with this script are insert queries, and they aren't working. I've ran the insert queries from PMA though and they worked fine...
  14. I have a script to run SQL queries on my site. It's always worked before, but all the sudden it isn't working. I haven't done anything to the file. I did switch hosts a little while ago, but I can still run the queries through PHPMyAdmin, just not through my script. (No, I won't run them through PMA for this, I'd much rather use this script for speed. I have NO idea why it's not working. Can someone please tell me why? It's probably something simple that I'm just missing here. form.html: <form method="post" action="q2.php"> <textarea name="q" cols="70" rows="5"></textarea> <input type="submit" value="Send Query"> </form> q2.php <?php include '../connect.php'; // yes, this is the right connect file. it's a directory above this file. It's worked before. $q = $_POST['q']; mysql_query($q); //I've also tried this line like this: mysql_query("$q"); and it didn't make a difference header("location:form.html"); ?> I really just don't know why it's not working anymore. It's probably really simple. 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.