-
Posts
295 -
Joined
-
Last visited
Never
Posts posted by pixy
-
-
<?php
echo $_COOKIE['val1'];
?> -
Back on topic:
I'm a girl. And I'm 16, started learning PHP at 15 and HTML when i was like 10.
-
You could just put each different language in a folder like so:
website.com/eng/index.php
and on the main website.com allow them to choose a language. That way they will index the main page where you choose the language thus allowing whoever finds your website the option of changing the language. -
Chris isn't going to record a song because people sign a petition, but whatever. I kind of "out grew" that band two years ago, but I'll sign the petition anyways. :)
-
I just looked them up, and they're okay. They sound "emo" to me. xP
You should try 30 Seconds to Mars' S/T album. The lead singer is a Pink Floyd fan. Try "Echelon" and "Buddha for Mary." It's deep, I tell you. Deep. -
You're going to want to take out your password and just so you know, using buffers is not the way to go. There is a limit to how much data can be stored in them, and if your page is too big you will encounter errors.
I'll edit this post after I go through the script. -
^ You need three at the end: ))).
-
I love Queen. My dad's a huge pink floyd fan, but their songs put me to sleep (as in--they're boring).
-
Here's basically how you'd do it:
<?php
// Connect to database
$query = "SELECT id, name FROM fields";
$result = mysql_query($query);
echo '<select name="fields">';
while ($row = mysql_fetch_array($result, MYSQL_NUM)) {
echo '<option value="'.$row[0].'">'.$row[1].'</option>';
}
echo '</select>';
?>
Of course, replace the values you're working with to make it work. -
[code]
<?
include 'db.php';
$username = $_SESSION['username'];
$query = ("SELECT * FROM children, spouse, sibling, aboutMe, users WHERE children.username = '$username' AND spouse.username = '$username' AND sibling.username = '$username' AND aboutMe.username = '$username' AND users.username = '$username'");
$result = mysql_query($query) or die(mysql_error());
$num = mysql_numrows($result);
while ($row = mysql_fetch_array($result, MYSQL_ASSOC) or die(mysql_error())) {
echo '<p class="'.$row['spousesex']."><b>First Name:</b> '.$row['spousefirstname'].'<br>
<b>Last Name:</b> '.$row['spouselastname'].'<br>
<b>DOB:</b> '.$row['spousedob'].'<br>
</p><br>';
}
mysql_close();
?>[/code]
Try that. There was a missing ' mark and some ))) at the end. -
Try this...(make sure that the column names correspond to the ones you have)
[code]
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<p class=".$row['spousesex']."><b>First Name:</b> '.$row['spousefirstname'].'<br>
<b>Last Name:</b> '.$row['spouselastname'].'<br>
<b>DOB:</b> '.$row['spousedob'].'<br>
<b>Age:</b> '.$row['spouseage'].'<br>
<a href="Updatespouse.php?id='.$row['userid'].'">Edit</a>
<a href="deleteSpouse.php?id='.$row['userid'].'">Delete</a>
</p><br>';
}
?>
[/code] -
I could drop the quick links at the top, but if I do it would just take another click to get to those pages. Plus they could always just go to those pages and add them to their dog-eared links.
Thanks for your comments! I really appreciate the input. -
1. If you MUST have a black background, I think you should use some brighter colors to compliment them. I don't really see a colorscheme, only a header image and a bunch of boxes below. I think you should select some colors that go well together and work on implimenting them throughout the site.
2. One great example of a website similar to yours is purevolume.com (which you, no doubt, have seen). I think you should group together and rearrange the boxes. Honestly, I really don't like how they're big and grey--they look a little empty.
On that same note: it seems like headlines should be towards the top and that the calendar doesn't need to be so big--maybe just make a little calendar that tells what's happening on a day when you hover the mouse over the date?
3. I like the "top of the page" link. You could do that easily with anchors.
4. That is all. Most importantly: choose a color scheme.
(I think maybe you should go with a dark grey background instead of black...I think the black is a little too intense looking, I've never been a fan of black backgrounds) -
Dude, you did it fan more difficult than it needs to be. You can just do something like...
[code]
<?php
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo "<p class='$row['spousesex']'><b>First Name:</b> $row['spousefirstname']<br>
<b>Last Name:</b> $row['spouselastname']<br>
<b>DOB:</b> $row['spousedob']<br>
<b>Age:</b> $row['spouseage']<br>
<a href='Updatespouse.php?id=$row['userid']'>Edit</a>
<a href='deleteSpouse.php?id=$row['userid']'>Delete</a>
</p><br>";
}
?>[/code]
Whatever is inside the brackets [] is the name of the column you're drawing information from, while $result is your mysql_query() variable. -
I haven't implimented this yet, but I wanted to know what you all think before I take all the time to create it.
The colors aren't what I'm going to use and all, but I was wondering what your opinions are on the navigation and site layout.
[img]http://img.photobucket.com/albums/v72/vanillachick/scan0001.gif[/img]
(ignor all the random scribbles...I got bored) -
It is visually unattractive, IMO. You should invest some time in getting a decent design and focus on making navigation easy. The main page should be visually apealing, or no one is going to want to look at it.
-
Looks good--but a little boring. It's a little too simple, IMO. Maybe some graphics somewhere? Instead of only gradients, and it's a lot of blue. I prefer layouts that have several colors that work well together instead of one that is all one color.
-
Sessions are stored on the server, so my guess is no.
-
The escape_data() function has never caused problems before. Basically it only checks to see if magic quotes is on so that it doesn't over-escape data.
I'll fix all of those things and edit this. Thanks for your reply. -
I'm completely lost at this. This is my first time using a file-upload script, so bear with me.
Whenever I submit this, I get a huge error message which shows me all the arrays that are set. So I look at the query that is run, and it says something like:
INSERT INTO table (column, column2, column3) VALUES ('', '', '');
Even though I know all variables are set. Can anyone help here? This is the code I wrote:
[code]
<?php
// Date: July 24, 2006
// Description: Add a new Shop
$page_title = 'Add a New Item';
session_start();
$user = $_SESSION['user'];
$user_id = $_SESSION['id'];
// Includes header + database variables + Stuff
require_once('config.inc.php');
require_once('connect.php');
include('functions.php');
include('header.php');
loggedin();
if ($user !== 'lifeonmars') {
echo 'You are not allowed to use administrative tools.';
include('footer.php');
die();
}
if (isset($_POST['submitted'])) {
$errors = array();
if (!empty($_FILES['upload'])) {
$allowed = array('images/gif');
if (in_array($_FILES['upload']['type'], $allowed)) {
$image = "../items/{$_FILES['upload']['name']}";
if (move_uploaded_file($_FILES['upload']['tmp_name'], "$image")) {
echo 'File uploaded!';
}
else {
switch ($_FILES['upload']['error']) {
case 1:
print 'The file exceeds the upload_max_filesize setting in php.ini.';
break;
case 2:
print 'The file exceeds the MAX_FILE_SIZE setting in the HTML form.';
break;
case 3:
print 'The file was only partially uploaded.';
break;
case 4:
print 'No file was uploaded.';
break;
case 6:
print 'No temporary folder was avaliable.';
break;
default:
print 'A system error occured.';
break;
}
}
}
else {
echo 'Image must be in GIF Format.';
unlink($_FILES['upload']['tmp_name']); // Deletes the file
}
if (empty($_POST['name'])) {
$errors[] = 'You did not specify a name for the item.';
}
else {
$name = escape_data($_POST['name']);
}
if (empty($_POST['descr'])) {
$errors[] = 'You did not supply an item description.';
}
else {
$desc = escape_data($_POST['descr']);
}
if (empty($_POST['value'])) {
$errors[] = 'You did not supply a value!';
}
else {
$val = escape_data($_POST['value']);
}
if (empty($_POST['rarity'])) {
$errors[] = 'You did not specify the rarity for this item.';
}
else {
$rarity = escape_data($_POST['rarity']);
}
if (empty($_POST['who_own'])) {
$errors[] = 'You did not specify who can own this item.';
}
else {
$who = escape_data($_POST['who_own']);
}
}
else {
echo 'Please upload a file';
}
if (empty($errors)) { // No problems with the upload...
$query = "INSERT INTO items (name, descr, value, rarity, image, who_own) VALUES ('$name', '$desc', '$val', '$rarity', '$image', '$who')";
$result = mysql_query($query) or die(mysql_error());
if ($query) {
echo 'The item '.stripslashes($name).' has been added sucessfully!';
}
else {
echo mysql_error();
}
}
else {
foreach ($errors as $msg) {
echo '<li> '.$msg.'</li>';
}
}
}
?>
<form action="<?php echo $file; ?>" method="post" type="multipart/form-data">
<table border="0" class="Tablestyledark" align="center" valign="top" cellpadding="7px" cellspacing="7px">
<tr><td align="center" colspan="2"><div class="title">Add a new item</div></td></tr>
<tr><td class="tablestylelight"><b>Item Name:</b></td><td class="tablestylelight"><input type="text" name="name"></td></tr>
<tr><Td class="tablestylelight"><b>Item Description:</b></Td><td class="tablestylelight"><textarea name="Descr" rows="5" cols="25"></textarea></td></tr>
<tr><td class="tablestylelight"><b>Upload Image</b></td><td class="tablestylelight"><input type="file" name="upload"></td></tr>
<tR><td class="tablestylelight"><b>Rarity:</b></td><td class="tablestylelight"><input type="text" size="3" maxlength="3" name="rarity"> %</td></tR>
<tr><td class="tablestylelight"><b>Value:</b></td><td class="tablestylelight"><input type="text" name="value" size="10"></td></tr>
<tr><td class="tablestylelight"><b>Who can own it?</b></td><td class="tablestylelight"><input type="radio" name="who_own" value="1"> Students Only<br>
<input type="radio" name="who_own" value="2"> Adults Only<br>
<input type="radio" name="who_own" value="3"> Everyone</td></tr>
<tr><td class="tablestylelight" colspan="2"><center><input type="submit" name="submit" value="Create Image"></center></td></tr>
</table>
<input type="hidden" name="submitted" value="TRUE">
</form>
<?php
include('footer.php');
?>
[/code] -
OOh, okay. I did look and they were in a tmp file--but I assumed that was the tmp file on my computer. Thanks for clarification!!
-
Wow, some metal fans! I LOVE metallica myself, too. Alice in Chains is classic...but inreference to steelmanronald's post, the Casualties make me want to kill myself. They sound terrible, IMO. XP
-
Seriously, every topic in this forum is about computers. Geez, lets talk about something interesting. :D
[b]Umm, so what kind of music does everyone listen to? [/b] Got any recommendations? Or maybe post some links and we'll all check them out!
My recommendations for you all:
- [url=http://www.cs.uri.edu/~whittakt/public/music/Mountain%20Goats,%20The%20-%20The%20Sunset%20Tree/]The Mountain Goats[/url] - the Sunset Tree (dance music is my favorite song on the record)
http://www.asjohnson.com/~katie/music/15%20Sheena%20Is%20a%20Punk%20Rocker%20[Original%20ABC%20Single%20Version].wma
The Ramones - Sheena is a Punk Rocker
- [url=http://www.asjohnson.com/~katie/music/Def%20Leppard%20-%20Pour%20Some%20Sugar%20On%20Me.mp3]Def Leppard[/url] - Pour Some Sugar on Me
- [url=http://www.asjohnson.com/~katie/music/03%20The%20Future%20Freaks%20Me%20Out.wma]Motion City Soundtrack[/url] - The Future Freaks Me Out
- [url=http://texas.clubsi.com/Josh/music2/30%20Seconds%20to%20Mars%20-%20The%20Kill.mp3]30 Seconds to Mars[/url] - The Kill
Yea, I'm bored. Soo...what kind of music do you like? -
It's simple...but maybe a little too simple? And I get these errors on the main page:
Array ( )
--------------------------------------------------------------------------------
Array ( )
--------------------------------------------------------------------------------
STATUS is 0
REF is
LEVEL is
Warning: array_keys(): The first argument should be an array in /srv2/www3/magistri.net/subdomains/blacksun/scripts/home.php on line 24
Warning: Wrong parameter count for max() in /srv2/www3/magistri.net/subdomains/blacksun/scripts/home.php on line 24
NUM_ITEM +1 is 1
--------------------------------------------------------------------------------
CLEAR $_S[cart]
Table Fields in a dropdown
in PHP Coding Help
Posted