Jump to content

parts of web page loading on top of webpage


ldb358

Recommended Posts

what this is should do is echo the put the output in the picSelect div but instead they apear on top see what i mean on my site:

 

    username:Lane

    password:enter1

 

 

heres my code:

 


function userPage(){

        $username = $_SESSION['username'];

        $qFirst = mysql_query("SELECT firstName FROM users WHERE username='$username'");

        $qLast = mysql_query("SELECT lastName FROM users WHERE username='$username'");

        $qEmail = mysql_query("SELECT email FROM users WHERE username='$username'");

        $firstb = mysql_fetch_array($qFirst);
	$first = $firstb['firstName'];

        $lastb = mysql_fetch_array($qLast);
	$last = $lastb['lastName'];

        $emailb = mysql_fetch_array($qEmail);
	$email = $emailb['email'];

        $qgetImagesrc = mysql_query("SELECT * FROM ".$username." WHERE id='1'") or die(mysql_error());

        $qImagesrc = mysql_fetch_array($qgetImagesrc);
        //working on designing the page here

echo "<div class='body3'><div style='width:800px; height:20px;'></div><div class='pictureFill'><img src='". $username . "/" . $qImagesrc['name'] ."' style='width:100; height:150;'/></div><div class='userInfo'><blockquote><h3>$username</h3><p>$first $last<br/>$email<h4>$rating</h4></p></blockquote></div><br/><div class='pictureSelect' id='picSelect'>".loadImages($username);."</div><div class='pictureGallery'><img  name='mainImage' /></div></div>";

//add an if(isset(img1) else load upload first page

}

function loadImages($username){
$numberOfImages = mysql_query("SELECT imgNumber FROM users WHERE username='$username'");
$numImages2 = mysql_fetch_array($numberOfImages);
$numImages = (int)$numImages2['imgNumber'];
for( $i=1; $i<=$numImages; $i++){
	echo $i;
	$getName = mysql_query("SELECT name FROM ".$username." WHERE id='$i'");
	$loadName = mysql_fetch_array($getName);
	$name = $loadName['name'];
	echo "<input type='button' value='$name' onClick=\"mainImage.src='" . $username . "/" . $name . "' \"/><br/>";
}
}

Link to comment
Share on other sites

dont use echo's inside your functions

 

function simple()
{
  $blah = format_a(format_b*2));

  return $blah;

}

 

in your script where you want the code call your function

 


echo simple(); //echo the function not from inside the function.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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