PDA

View Full Version : Poll



getchagame
11-07-2008, 01:54 PM
i set up a poll using that advanced poll software.
i put the code in and now the poll is working correctly.
the only problem is that it is in the wrong spot.
http://www.getchagame.com

see how it's in the top left corner, how do i move it around?

pghcollectibles
11-07-2008, 07:28 PM
remember the position:absolute;left:???;top:???;z-index:???;

the div id='html1... is gone but the </div> is still there. put the <div... in front of your table.

put all of your <style></style> in the same tag and put it in between the <head></head> tags. (this is a separate issue)

it might be time to learn more (http://www.w3schools.com/css/default.asp)

getchagame
11-08-2008, 11:36 AM
yeah i remember the positioning information you gave me. but you said that you didn't like absolute positioning. So i'm looking for more information on how to postion my object. That link you posted was great, but i think it was for CSS. Correct me if i'm wrong, but doesn't positioning my table deal with HTML?

pghcollectibles
11-08-2008, 12:27 PM
What is CSS?



CSS stands for Cascading Style Sheets
Styles define how to display HTML elements
Styles are normally stored in Style Sheets
Styles were added to HTML 4.0 to solve a problem
External Style Sheets can save you a lot of work
External Style Sheets are stored in CSS files
Multiple style definitions will cascade into one

i dont like it because i dont know how to use it properly (probably).

my main issue is the ability to spread the page to fit the window and i think you would need to incorporate some script to determine window size and have it edit absolute position numbers, but like i said, i dont know css that well. im lazy. im a quick learner and i have started to incorporate css into my code but i still use tag attributes out of habit.

you have already started with the absolute possition why edit all of your pages now? just learn how to use it to your advantage. something i have not yet done.


doesn't positioning my table deal with HTML? yes it does

What is an HTML File?



HTML stands for Hyper Text Markup Language
An HTML file is a text file containing small markup tags
The markup tags tell the Web browser how to display the page
An HTML file must have an htm or html file extension
An HTML file can be created using a simple text editor

those definitions were both from the w3schools website.

The HTML DOM defines a standard for accessing and manipulating HTML documents.

you should start with the two (http://www.w3schools.com/htmldom/default.asp) basics (http://www.w3schools.com/html/default.asp) then css.

then scripts: javascript, php, ajax, how far do you want to go is up to you... perl, python, etc


by the way if you dont want to use absolute possitioning, you will need to remove it from the rest of your elements then you can see what info is displayed in order and you can decide where you want it. i use a lot of tables some people use a lot of divisions

getchagame
11-08-2008, 02:05 PM
thank you so much. your response was very informational. now i know what to research. but i've been trying to use those absolute positioning things to move my poll and it isn't working

i forgot to tell you that my poll is a piece of php code that i copied and pasted. How do i go about moving the php code, is it the same thing?

pghcollectibles
11-08-2008, 03:42 PM
the php is code to manipulate certain things (im sure i could quote the definition of php here but...) it means nothing to the browser until it has some kind of output. it all takes place on the server where the php file is stored. an output is like: echo, print etc... it is the output that needs to be in the right place but if it is a block of code you generally move the whole block. the output is what the browser (and therefor you) will see at the end. ill give you an example brb i need to restart firefox to use this extension

pghcollectibles
11-08-2008, 04:37 PM
uncompensated marketing---if you dont use firefox you should and an add-on i had on my other computer was called firebug. i had a different one too but... its a good tool to have.

anyway, lets take this section:

<div id="image1" style="position: absolute; left: 210px; top: -12px; z-index: 4088;" name="image1"><img class="twisty"><a id="ilinkid1" target="_self" href="http://www.getchagame.com">
<img style="border: 0pt none ; width: 157px; height: 111px;" src="_wizardimages/button.png"/>


</a>


</div>it starts at -12px and it has a picture in it that is 111px in height so the top would want to be 109 if you wanted a 10px space between them so lets change this line:


<table width="170" border="0" cellspacing="0" cellpadding="1" bgcolor="#666699">
to this line:


<table width="170" cellspacing="0" border="0" bgcolor="#666699" 1="" style="position: absolute; top: 109px; left: 10px;">


if you could see how your divisions overlap like i can with firebug, you might not like it. they shouldnt overlap unless you want them to. with position:absolute; you can basically lay everything out on graph paper then use the grid to determine top and left using height and width of each element and your spacing in between

getchagame
11-08-2008, 05:32 PM
Thank you so much!!! Fire bug is awesome!
it's perfect for a beginner.
it tells me exactly what code section outputs what. thank you for the information.
but i still have a small problem. using firebug, i see the code i need to edit. so i go into my file manager and open index.php
but i can't find the code that firebug tells me to edit. where is it?
you know that code you told me to replace... well if i look at my website through fire bug, i see the code i need to replace.
but if i go into my file manager and look at my index.php so i can actually edit the code, i can't find it?
what am i doing wrong?

pghcollectibles
11-08-2008, 09:21 PM
you are looking at the html output from your php code. why dont you paste your code here from your index page. dont forget to wrap the php brackets around your code (click go advanced, then click the php icon if you dont know what im talking about)

getchagame
11-09-2008, 07:38 AM
is this what you wanted?


<div Id="image10" name="image10" style="position:absoluteleft:210;top:-42;z-index:4088">
<?php
include_once "/home7/getchaga/public_html/booth.php";
echo $php_poll->poll_process(4); // x = Poll ID
?>
</div>

pghcollectibles
11-09-2008, 08:55 PM
ok now post the code for booth.php

getchagame
11-10-2008, 02:35 PM
<?php

$include_path = dirname(__FILE__);
if ($include_path == "/") {
$include_path = ".";
}

if (!isset($PHP_SELF)) {
global $HTTP_SERVER_VARS, $HTTP_GET_VARS, $HTTP_POST_VARS, $HTTP_COOKIE_VARS;
$PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"];
if (isset($HTTP_GET_VARS)) {
while (list($name, $value)=each($HTTP_GET_VARS)) {
$$name=$value;
}
}
if (isset($HTTP_POST_VARS)) {
while (list($name, $value)=each($HTTP_POST_VARS)) {
$$name=$value;
}
}
if (isset($HTTP_COOKIE_VARS)) {
while (list($name, $value)=each($HTTP_COOKIE_VARS)) {
$$name=$value;
}
}
}

require $include_path."/include/config.inc.php";
require $include_path."/include/$POLLDB[class]";
require $include_path."/include/class_poll.php";

$CLASS["db"] = new polldb_sql;
$CLASS["db"]->connect();
$php_poll = new poll();

?>

pghcollectibles
11-12-2008, 09:16 AM
i still dont see the function that outputs the table info. maybe it is in include/class_poll.php? anyway why dont we skip that and just put the style into the division instead.

change this:

<div Id="image10" name="image10" style="position:absoluteleft:210;top:-42;z-index:4088">

to this:
<div Id="image10" name="image10" style="position:absolute;left:10;top:109;z-index:4088">


by the way, i just noticed there wasn't a semi-colon after the position:absolute - it was probably just a typo, but that may have been the reason you have been having problems moving it around

getchagame
11-12-2008, 02:04 PM
thanks. do want me to post the code for includes/class_poll.php?

pghcollectibles
11-12-2008, 02:42 PM
there's really no need to put the style in the table and the division

getchagame
11-12-2008, 03:56 PM
okay, so what you're saying is that there are two ways to move my poll. Either move the table, or move the division?

thanks so much for your help.

pghcollectibles
11-12-2008, 06:53 PM
the table is in the div.

think of it kind of like a babushka. the outer container (element) is the html. the head and body containers in that. in your case you have divisions in the body and tables in the divisions. table rows are in the tables and data cells are in the rows.

this is the part you would be studying (you are reading through the entire w3schools website on html at least right? not just skimming) called DOM. think of the outer containers as parents and inner containers as children. many things that affect the parents also affect the child (this would be more comparible to mother child while still pregnant) but things that affect the child do not usually affect the parent.

anyways... sorry about the lecture, as informative as it may have been.