Jump to content

beaux1

Members
  • Posts

    55
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

beaux1's Achievements

Member

Member (2/5)

0

Reputation

  1. header("Location:http://www.yoursite.com/yourpage.php"); Should work fine. Edit: Or are you talking about opening a whole new browser window?
  2. Sweet, thanks alot man. I'll do it that way then.
  3. Ehm, hmm, well, I was thinking, having a table called comments, which stores the comments, but how would I go about linking or making them relevent to the blog post itself? I was thinking of making a column called blogid, and when a user submits a comment, it inserts the blogid into that, so therefore I can call all comments WHERE blogid = 2, for example. I'm sure that would work fine, but is it a messy workaround to do what I'm trying to achieve?
  4. Yeah, I know I have a box, the user can enter comments, and the database will retrieve the information and display all the comments, but how do I go about splitting the comments up? Let's say I have: ID name date subject msg comments 1 test 1/1/1 cereal test How would I go about splitting the comments up and knowing which is which etc?
  5. Hey guys. I'm working on my own blog/news script, and I'm about to work on the comments system. My MySQL database is plotted out like so: ID name date subject msg Alright, simple enough. But, what would the best way going about the comments in my script? I'm just not sure about how to go about this, I understand inserting data (in this case the comments) into the database, but how would I go about doing it in general? I'm not making much sense, I know, I know, but could someone please guide me in the right direction? Thanks.
  6. Ah, I see. So are the any other ways around this?
  7. Well a table for each story would be rather unnecessary. I mean, if you have 100 stories then 100 SQL tables it isn't going to be efficient. If I was you I'd have 1 table for all 100 stories, and then sort them on the page you're displaying them on by using a ORDER statement such as: ORDER BY title; 'Title' is the title of the story, so your stories will be listed alphabetically on the page.
  8. Okay, I decided to use file_get_contents : $sql = file_get_contents("sql.sql"); // End Retrieve SQL Query if (mysql_query($sql)) { Now, my sql.sql file works if I import it into phpMyAdmin, or if I only have one of the two SQL Queries in here. Anyway I can somehow format them so it will read the both of them and work? CREATE TABLE admin ( ID int(7) NOT NULL auto_increment, username varchar(15) default NULL, password varchar(32) default NULL, PRIMARY KEY (ID), UNIQUE KEY id (ID) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1; CREATE TABLE posts ( ID int(7) NOT NULL auto_increment, name varchar(15) default NULL, date varchar(100) default NULL, subject varchar(100) default NULL, PRIMARY KEY (ID), UNIQUE KEY id (ID) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  9. I'm not precisely sure which section this is belong to, but I'll put it in MySQL. Basically, I want to be able to run my .SQL file from the PHP script. I know it's possible, as I've seen it been done before, examining other code except I can't exactly work out how it's done. I've googled it, but there's just so many damn ways I've seen of it being done, it confuses the hell out of me. Can anyone share their wisdom with me here? Thans
  10. Fixed. My password field in SQL DB had to be set at varchar(32) where as it was set at varchar(30) before. Reason for this is because MD5 encryption is 32 figures long, therefore it would have to be 32.
  11. I'm having an MD5 problem when logging in with my PHP code. Basically, the registration form encrypts the users password in MD5. That's all fine. Then we have the login form, the password entered is then converted to MD5 so the SQL DB can validate it. I debugged it and the entered password is successfully being encrypted by echoing $password. My problem is that it doesn't validate with the SQL database and instead goes back to login.php (because it failed). Any help would be greatly appreciated, thanks. http://pastebin.ca/433142
  12. Nah, my divs are all closed.
  13. Okay, this is the portion of my code relevant. <div id="menu"> <ul class="ul"> <li class="menu.li"><a href="http://www.beau.ws"> <div class="home"> <br /> <span class="menufont">home</span></div> </a></li> <li class="menu.li"><a href="http://www.beau.ws/portfolio"> <div class="portfolio"> <br /> <span class="menufont">portfolio</span></div> </a></li> <li class="menu.li"><a href="http://www.beau.ws/downloads"> <div class="downloads"> <br /> <span class="menufont">downloads</span></div> </a></li> <li class="menu.li"><a href="http://www.beau.ws/about"> <div class="about"> <br /> <span class="menufont">about</span></div> </a></li> <li class="menu.li"><a href="http://www.beau.ws/contact"> <div class="contact"> <br /> <span class="menufont">contact</span></div> </a></li></ul> </div> And this is the XHTML Validator: Now, I'm not sure what I'm doing wrong here, I'm using the <a> to link the bg image of the div by the way, so I can't remove that/change that around without it messing up. Anyone shed any light on this? Thanks.
  14. Nevermind, solved: Had to wrap it with literal tags: {literal} <CSS> {/literal}
  15. My CSS: <style type="text/css"> body { font-family: tahoma; font-size: 75%; color: #ffffff; background: #454242 } a { text-decoration: none; color: #eebb99 } h1,h2 { margin: 0px; background: #6c5f59 } h1 { font-size: 150% } h2 { font-size: 100%; margin-top: 1em } .hl { font-style: italic } .plus { float: right; font-size: 8px; font-weight: normal; padding: 1px 4px 2px 4px; margin: 0px 0px; background: #eb9; color: #000; border: 1px solid #da8; cursor: hand; cursor: pointer } .plus:hover { background: #da8; border: 1px solid #c97 } ul { list-style: none; padding-left: 0px; margin: 0px } li { margin: 0px } li:hover { background: #2e2a2a; } li a { display: block; width: 100%; } </style> It works, but it doesn't show the body (background color). It's called by PHP like so: echo '<link rel="stylesheet" href="/navcss/' . $_COOKIE['menucss'] . '.css" />'; I know it's working, because it displays some of the css so I'm pretty sure it isn't a PHP problem, it just doesn't display the body. If I were to put it in a normal document though by itself, it would work. Anyone know why/what the solution is?
×
×
  • 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.