|
FAQ | Members List | Calendar | Today's Posts | Search |
Topic Review (Newest First) |
Jan 22nd, 2007 07:21 AM | ||
Chojin | BTW you can see the fruits of these labors on http://www.wiikitty.com/wiikitties.php ;> | |
Jan 22nd, 2007 04:51 AM | ||
MetalMilitia |
Quote:
|
|
Jan 21st, 2007 12:44 PM | ||
Chojin |
Cool! All right! Cool cool! All right! I think I'm out of questions! Thanks, everybody! |
|
Jan 21st, 2007 10:20 AM | ||
AChimp |
I think that if you assign a value attribute to the checkbox, it will return that value rather than the name of the checkbox. Either way, just outputting the checkbox won't really display what you want. Your friend is correct. You need to check for the checkbox value, then do something based on that value (or no value) with an if-statement. Password protecting a folder can probably be done through your host. It's safest to do it at the server level rather than making a complicated login system. You should check out what kinds of things they offer in their control panel thing. |
|
Jan 20th, 2007 07:11 PM | ||
Chojin |
oaky a friend of mine helped me out already. at the top of the entry page I had to change it to: Code:
if(isset($_POST['favorite'])) $favorite = 'y'; else $favorite = 'n'; Now, how do I password-protect a file or folder? I don't want other people to use my wiikitty submitter app. |
|
Jan 20th, 2007 04:54 PM | ||
Chojin | also thanks to metal and chimp for helping me THUS FAR! | |
Jan 20th, 2007 04:46 PM | ||
Chojin | i wasn't aware you did that. | |
Jan 20th, 2007 04:30 PM | ||
FartinMowler | I never got a thanks for promoting your Wiikitty site :/ | |
Jan 20th, 2007 04:06 PM | ||
Chojin |
Okay I'm starting to get a better hang of PHP and MySQL. I now have a lil form that I made where I fill out information: And it outputs to an archive file: Most of these don't have 'description' information, so that's why that's missing. But the error there is from when I try to output the 'Favorite' information. On the input form, the favorite is defined like so: Code:
<label for="favorite">Favorite Kitty?</label></td><td><input type="checkbox" value="favorite" name="favorite[]" id="favorite" /> Code:
$favorite = htmlspecialchars(strip_tags($_POST['favorite'])); ... $sql = "INSERT INTO wiikitty_archive (timestamp,catname,location,catfilename,favorite,description) VALUES ('$timestamp','$catname','$location','$catfilename','$favorite','$description')"; Code:
<?php foreach ($favorite as $f) {echo $f;} ?> Code:
<?php echo $favorite; ?> Where it just says 'Array' on the favorited WiiKitties. ("First submitted WiiKitty" is the description info) So, how do I make it show the checkbox information? Also, due to an oversight on my part, it wasn't adding the favorite information until that cat in the upper left. How would I go into the database manually to add that? Or to fix anything, really? I have phpMyadmin. |
|
Jan 18th, 2007 11:36 PM | ||
AChimp | You can do that, but file I/O on webservers can be dangerous. | |
Jan 18th, 2007 07:48 PM | ||
MetalMilitia |
Yeah should be. Take a look at this: http://www.tizag.com/phpT/fileread.php |
|
Jan 18th, 2007 12:04 PM | ||
Chojin |
Yeah, I've got cpanel, so I'll try that when I get home today. Also, is it possible to do a php include on a txt file, but only have it return a certain number of characters instead of the whole document? |
|
Jan 17th, 2007 07:25 PM | ||
MetalMilitia |
You need to open PHPMyAdmin ('servername/phpmyadmin' should work if it's installed). It should look like this: Then you can just put a database name into one of the places I circled and click create. You'll then see this screen: Where you can add a table with however many fields (columns) you want. The rest is pretty self explanitory. Phpmyadmin takes a bit of getting used to but you should be able to pick it up quickly. If it's not installed on your server you should have something similar which will do the same thing. |
|
Jan 17th, 2007 06:01 PM | ||
Chojin |
Metal, how do I set up the database's values for "authname", "datesub", etc.? As in, how do I add those categories and then put entries under them? |
|
Jan 6th, 2007 02:24 PM | ||
Chojin |
Thanks metal, I'll look into that when i have more time. Whoreable, how does their speed compare with other hosters? Do they monitor content at all? Could I just host a shitfuckton of videos there and link remotely to them? |
|
Jan 1st, 2007 11:59 PM | ||
FartinMowler | I'm completely shitfaced | |
Jan 1st, 2007 11:56 PM | ||
sadie | i don't know crap about this stuff, but hello to whoreable! | |
Dec 31st, 2006 11:50 PM | ||
whoreable |
i have had bluehost like a year now, its pretty ok. they do have phpmyadmin and you could code that shit like metal milita showed, or just look for an already made script to change from sourceforge. |
|
Dec 30th, 2006 12:30 PM | ||
MetalMilitia |
Assuming the server supports PHP you should be able to access something like 'phpmyadmin' which allows you to create and edit a database and the tables within your database. Once you have the database set up it's suprisingly simple to grab data out of the database and format it however you want. Here is a page I made some time ago while I was learning how to do it: The following code is for the main news page Code:
<link rel="stylesheet" type="text/css" href="style_main.css" media="all" /> <html> <body class="section-1"> <?php include 'head.php'; include 'tabMenu.php'; include 'newsContent.php'; ?> </body> </html> The 'newsContent.php' file contains all the code to perform the following actions: 1. Set up the database connection string 2. Select the database we wish to access 3. Create a query 4. Perform the query 5. Copy the results into an array 6. Format and output whatever parts of the array we want to use 1. Set up the database connection string Code:
$dbcnx = mysql_connect("servername e.g. localhost", "username","password"); //set up our connection string //Do some validation here to check the connection succeeded Code:
if (! @mysql_select_db("databasename", $dbcnx) ) //select a database, if we cannot find it generate an error. note: @ disables php errors and lets us use our own { echo( " Unable to locate the tablename database at this time.</p>" ); exit(); } Code:
$query=" SELECT * FROM news ORDER BY dateSub DESC "; 4. Perform the query Code:
$result=mysql_query($query); 5. Copy the results into an array & 6. Format and output whatever parts of the array we want to use Code:
while($thenews = mysql_fetch_array($result)) { echo " <div class='newsitem'> "; echo "<div class='header'> $thenews[title] </div>"; echo " $thenews[synop] </p>"; echo " Posted by $thenews[authName] at $thenews[dateSub] </p>"; echo "</div>"; } We then output the contents of this variable with formatting information. In this example the CSS class 'newsitem' contains code to put a box around all the content so each news item appears to be a seperate object. The next interesting part is where you create a link to the whole article in the title of the news item (assuming that's how you want the site to work). In the link it is important that we insert the article's ID so when we click the link we can have some simple PHP code to read the info from the URL, query the database for the article with a corrisponding ID and display this article in a new page. The way I have set up my table is to have a synopsis field which the article's author writes when they submit the article. You could have some clever code which extracts, say, 100 words from the article's main content and displays that but I couldn't be arsed when I wrote this. Here is what it looks like when it's opened in a browser: Now you need the following things: 1. Code to limit the number of articles per page/create new pages when the number of articles increases 2. A login system (for content contributors to use) 3. A webform which allows you to insert data to the database I'm really new to PHP (I've only ever made this one site and never finished it as I had too much else on) so take all this info with a grain of salt. This may not be the best way of doing it but it seems to work well. Oh, and I don't know about the web hosting company. I think there are probably web host review sites floating around the net. Check those out. |
|
Dec 29th, 2006 10:03 PM | ||
Chojin | HEPS ME METULMILISHA | |
Dec 28th, 2006 11:42 PM | ||
kahljorn | :throwshepatitisfecesinyourface! | |
Dec 28th, 2006 08:56 PM | ||
Chojin |
HEPS ME with MySQL and stuff prz Okay so I have this site: http://www.erickandemily.com How would I go about making a real live database to store the reviews and automatically generate tables like the one on the front page? Also, I'm currently hosted with 100megswebhosting, but I found this other group, bluehost.com. Their offer is: 200 GB Storage 2,000 GB Bandwidth/mo 50 MySQL databases Among other things, for something stupid like $7.95/mo, but you have to pay a year in advance. Their website looks a little sketchy though, and having to pay for a year up front screams 'scam' at me. The whole thing sounds a little too good to be true, as my current host is comparatively cheap and is charging me $40/mo for 240GB bandwidth. Looking at archive.org, the site was founded in 2000 as some crazy dotcom virtual office bullshit, then stolens away in 2003 by its current owner, who's been doing web hosting since then. What do you guys think? And please answer both questions: HOW MYSQL DATABASE DURR and BLUEHOST SCAM? |