Jump to content

Image not uploading


ChrisMartino

Recommended Posts

Ok, Sorry for being a pain haha, Well this time, I have this script, And what its supposed to do is change the picture url in the DB when its submit then give them that echo saying its complete this is supposed to happen at this url: profile.php?change=picture&complete but it isn't its just going to that url and not doing the contents of the if statement, Its this if statement: "if ($actionTWO == $Complete)", Could somebody try figure this out for me?, Thanks!.

 

<?php include "Main/Database/base.php"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>

<meta name="Description" content="Information architecture, Web Design, Web Standards." />
<meta name="Keywords" content="your, keywords" />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="Distribution" content="Global" />
<meta name="Author" content="Erwin Aligam - [email protected]" />
<meta name="Robots" content="index,follow" />

<link rel="stylesheet" href="images/MarketPlace.css" type="text/css" />

<LINK REL="SHORTCUT ICON"
       HREF="favicon.ico">

<title>Musicians Village - <?=$_SESSION['Username']?>'s Profile</title>

</head>

<body>

<!-- wrap starts here -->
<div id="wrap">

<!--header -->
<div id="header">			

	<div id="header-links">
	<p>
	<?php
		if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']))
		{
 	?>
    				<p>Logged in as: <a href="profile.php"><b><?=$_SESSION['Username']?></a></b> | Account: <?=$_SESSION['AccountType']?> | <a href="logout.php">Logout</a> </p>

	<?php
		}
		else
		{
	?>
			<p>Welcome <b>Guest</b>, Please <a href="login.php">Login</a> or <a href="register.php">Register</a></p>
	<?php
		}
	?>

    

	</p>		
	</div>		

<!--header ends-->					
</div>

<div id="header-photo"></div>		

<!-- navigation starts-->	
<div  id="nav">
	<ul>
		<li><a href="index.php">Home</a></li>
		<li><a href="login.php">Login</a></li>
		<li><a href="register.php">Register</a></li>			
		<li><a href="track.php?action=upload">Submit Track</a></li>
		<li><a href="track.php?action=listen">Listen To Tracks</a></li>
		<li><a href="/forums">Forums</a></li>
		<li><a href="contact.php">Contact</a></li>		
	</ul>
<!-- navigation ends-->	
</div>					

<!-- content-wrap starts -->
<div id="content-wrap" class="three-col"  >	

	<div id="sidebar">


		<h1>Sponsors</h1>
		<ul class="sidemenu">				
			<li><a href="index.html">Home</a></li>
			<li><a href="#TemplateInfo">Template Info</a></li>
			<li><a href="#SampleTags">Sample Tags</a></li>
			<li><a href="http://www.styleshout.com/">More Free Templates</a></li>	
			<li><a href="http://www.4templates.com/?aff=ealigam">Premium Templates</a></li>	
		</ul>	


	<!-- sidebar ends -->		
	</div>

	<div id="rightcolumn">

		<h1>Forum Stats</h1>
		<p>Top poster stuff here</p>

		<h1>*Newest track</h1>
		<p>it is here too! </p>				

	</div>


	<div id="main">

		<a name="MainHead"></a>



	<?php

	if(!empty($_SESSION['LoggedIn']) && !empty($_SESSION['Username']))
	{
	?>

		<h1><?$_SESSION['Username']?>'s Profile</h1>

	<?php


		$Administrator = "Administrator";
		$AccountQurey = $_SESSION['AccountType'];

		$User = $_SESSION['Username'];
		$Email = $_SESSION['EmailAddress'];
		$AccTyp = $_SESSION['AccountType'];
		$AccountIP = $_SESSION['AccountIP'];


		$action = $_GET['change'];
		$Picture = "pic";
		$Password = "password";
		$Start = "";


		if ($action == $Start) {
		?>
			<center>
				<img src="<?=$_SESSION['AccountPic']?>" width="130" height="130">
				<br />
				<a href="profile.php?change=pic">[Change Picture]</a>
				</center>
				<br />

				<?php
				echo "<b>Username:</b> $User";
				?>
				<br />
				<?php
				echo "<b>IP Address:</b> $AccountIP";
				?>
				<br />
				<?php
				echo "<b>Email Address:</b> $Email";
				?>
				<br />
				<?php
				echo "<b>Account Type:</b> $AccTyp";
				?>
				<br />

		<?php
				if($AccountQurey == $Administrator)
				{
					echo "<b>Administrator:</b> Yes";
				}
				else
				{
					echo "<b>Administrator:</b> No";
				}


		}

		// Ending the profile main profile.php.


		// Starting the Picture upload area (profile.php?change=picture

		elseif ($action == $Picture) {

			$username = mysql_real_escape_string($_SESSION['Username']);
			$checklogin = mysql_query("SELECT * FROM users WHERE Username = '".$username."'");
			$row = mysql_fetch_array($checklogin);
			$AccountPic = $row['ProfilePic'];
			$_SESSION['AccountPic'] = $AccountPic;

			$actionTWO = $_GET['&'];
			$Complete = "complete";


			if ($actionTWO == $Complete)
			{
				$picUPDATE = mysql_real_escape_string($_POST['picture']);
				$picUPDATEUSR = mysql_real_escape_string($User);
				$changepic = mysql_query("UPDATE  `a7331843_account`.`users` SET  `ProfilePic` =  '".$picUPDATE."' WHERE  `users`.`Username` = '".$picUPDATEUSR."' LIMIT 1 ");
				echo "Account picture changed,<a href=\"profile.php\"> Click here to return to profile</a>";
			}

		?>

		<center>

				<p>Current Picture:</p>

				<img src="<?=$_SESSION['AccountPic']?>" width="130" height="130">
				<br />
					<form method="post" action="profile.php?change=pic&complete" name="registerform" id="registerform">
					<fieldset>
						<label for="picture">Picture URL:</label><input type="text" name="picture" id="picture" /><br />
						<br />
						<input type="submit" name="register" id="register" value="Change Picture" />
					</fieldset>
					</form>

		</center>

		<?php
		}
		?>

				<?php
	}
	else
	{

		echo "<h1>Error</h1>";
		echo "<p>You need to be logged in to see your profile!</p>";

	}
	?>

		<br />

		</p>  


	</div>

<!-- content-wrap ends-->	
</div>

<!-- footer starts -->			
<div id="footer-wrap"><div id="footer">				

		<p>
		© 2006 <strong>Your Company</strong> | 
		Design by: <a href="http://www.styleshout.com/">styleshout</a> | 
		Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a> | 
		<a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>

   		      

		<a href="index.html">Home</a> | 
   		<a href="index.html">Sitemap</a> | 
   	<a href="index.html">RSS Feed</a>
		</p>		

</div></div>
<!-- footer ends-->	

<!-- wrap ends here -->
</div>

</body>
</html>

 

Link to comment
https://forums.phpfreaks.com/topic/188693-image-not-uploading/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.