Jump to content

jaminxz

Members
  • Posts

    16
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

jaminxz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi guys, i have a problem with my CSS, i think there's something i'm not quite understanding. I should have a header which is one long div separated into three equal sized columns (three divs), each contain text which is inside its own div. Here's my code: HTML <body> <Div class="Header"> <Div class="Left"> <div class="Logo"><img src="Images/ACE.png" alt="Logo" height="36px" width="56px"/> <div class="LeftText"> AIR CHARTER EXPRESS </div> </div> </Div> <Div class="Middle"> <div class="RightText"> Left </div> </Div> <Div class="Right"></Div> <div class="MiddleText"> Right </div> </Div> </body> and css: @charset "utf-8"; /* CSS Document */ .Header { position:relative; height:40px; width:900px; border:solid 1px black; margin-left:200px; /*background-color:#000000;*/ } .Left { position:relative; height:40px; width:299px; /*background-color:aqua;*/ border-right:solid 1px black; float:left; display:inline; } .LeftText { display:inline; Height:38px; width:200; position:relative; top:-11px; border:solid 1px black; } .Middle /* actually right div */ { position:relative; height:40px; width:299px; /*background-color:yellow;*/ float:right; } .MiddleText { display:inline; Height:38px; width:200px; position:relative; border:solid 1px black; margin-left:60px; top:10px; } .Right /* actually middle div */ { position:relative; height:40px; width:300px; /*background-color:green;*/ float:right; border-right:solid 1px black; } .RightText { display:inline; Height:38px; width:200px; position:relative; border:solid 1px black; margin-left:60px; top:10px; } .Logo { Height:36px; width:66px; padding-top:2px; display:inline; } its actually a little confusin seeing as the middle div appears on the right and the right div in the middle but i dont want to change any of the names in case it breaks so i'll live with it! everything works fine except for the middleText div is not appearing inside it parent (right div) but on the outside of the whole header div. Can somebody please tell me why this is happening?thanks.
  2. fixed that and uploaded but it still doesnt work. Does anyone have any idea why the whole page could be white? I'm totally lost.
  3. Hello, firstly this is a bit of a gray area so it could possibly belong in another forum such as PHP, HTML help or something, but since i think the problem is mainly javascript related i'm going to post it here (sorry if i'm wrong!). I have a php page which displays results from a MySQL table if a record's status is set to 'Open'. Every row has a 'close' button whch updates a records status to 'closed', here is the code for that: <input type="submit" value="Close" ID="<?php echo $row_query4['ID']; ?>" onclick="return confirm_delete('<?php echo $row_query4['ID']; ?>')" /> Here is the Jscript: <script type="text/javascript"> var form_id; function confirm_delete(ID) { var cycles = prompt("Close at how many cycles?", " <?php echo $total_cycles ?>"); if(cycles){ var CycleClose = cycles; var id = ID; document.getElementById('IDval').value = id; document.getElementById('CycleClose').value = CycleClose; return true; } else { alert('You didn\'t provide a value for cycles.'); return false; } } </script> and the hidden form code <input type="hidden" name="IDval" id="IDval"><input type="hidden" name="CycleClose" id="CycleClose"> and the php post code that accepts a value on postback: //If IS_PostBack then database is to be updated if(isset($_POST['IDval']) && isset($_POST['CycleClose'])){ // if($_POST) { //echo "BADGERS"; $ID_Val = $_POST['IDval']; $Cycles_Closed = $_POST['CycleClose']; -----------SQL then executed here------------- } Basically on click of a button, the records status should be updated to 'closed', the page should refresh and then the table should be rebuilt (but not contain the row that has just been updated because its status is now 'closed'). this works perfectly in my local environment, but i've uploaded it to my college's webserver and it does not work properly: when the close button is clicked and then a value entered into the prompt box, the page refreshes and its totally white, the SQL update command doesnt get executed and thus the table isn't updated either. I dont even know where to start debugging this, can anybody help? thanks in advance, jaminxz.
  4. ah yeah this should, work. thanks.
  5. yeah sorry. I'm trying to build a table with paging so I need to know how many pages to have.
  6. Hi guys, I have something I need to do which is quite complex for me! i've partly started typing out the code but am tearing my hair out already! i'm not sure if this is even possible so i'm gonna need some advice before i spend another 2 hours on it! ok i have rows from a database being displaid on a php web-page, which are in a form Code: <form action="" method="post" id="Updated_Rows_Form"> each row has a button next to it called close. Code: <input type="submit" ID="<?php echo $row_query4['ID']; ?>" value="Close" onclick="function confirm_delete('<?php echo $row_query4['ID']; ?>')" when this button is clicked, i want to run a javascript function and pass the id of the row in question to it and then do the following actions (please excuse my crude java/pesudo code, i am an ultra newbie!) Code: var form_id; function confirm_delete(ID) { prompt("Close at how many hours?", " <?php echo $TotalHours ?> (note: i want this to be the default but EDITABLE VALUE)"); if(prompt){ var HourClose = inputted data var id = ID <!---- Send these via POST somehow, POST the form --> } } any help would be greatly appreciated as I dont know where to start! Thanks in advance, Jaminxz.
  7. Hello, I have a sql join query which returns a set of records. I need to know how many records are returned, so i guess I need to use COUNT(!) somehow but i dont quite know how. Any suggestions would be warmly welcomed! SELECT ID, t1.AD_No, LineNo, t2.Description, t2.CyclesLimit, t2.HourLimit, t2.DateLimit, t1.CompMethod, t1.Comments, STATUS, (!COUNT_OF_RESULTS!) FROM foo as t1 LEFT OUTER JOIN ad_item as t2 ON t1.AD_No= t2.AD_No WHERE OPEN=1 AND STATUS=1 ORDER BY AD_No, LineNo
  8. great, thanks for the advice - much appreciated!
  9. thats great - works a treat! many thanks.
  10. Hi guys, i have some rows, each with a checkbox on a php webpage. When the 'submit' button is clicked, each row with a checked checkbox has its status field updated. This all works fine but now i have tried to put a simple javascript pop-up box in to ask the user if he/she is sure she wants to update the selected recrod(s). My problem is that if whatever the user selects (ok or cancel) the post still happens and the fields are updated. I'd really appreciated it if someone could look over a newbie's code and point me in the right direction!thanks in advance, Jaminxz. <!----------------in the head <script language="javascript1.2"> var form_id; function confirm_delete(go_url) { var answer = confirm("Are you sure to delete the selected row?"); if (answer) { location=go_url; } } </script> <!---------------the form <form action="<?php echo $_SERVER['PHP_SELF'];?>" method="post" id="Updated_Rows_Form"> <!-----------the button <input type="submit" name="Confirm" value="Close Selected" onClick="confirm_delete('<?php echo $_SERVER['PHP_SELF'];?>')" />
  11. absolute legend! thanks so much, I knew I'd be doing something daft, I think I was working on the logic that if i didn't need it printing in html, i didn't need the echo statement, d'oh!
  12. basically, i have two tables ORDER: Order_ID, Date; and Order_Item:Order_ID, Product_ID, Quantity. I'm just building a simple prototype at the mo so i've hand typed a little bit of data myself. Currently my webb-app allows a user to add and remove order_Items from an order, but when an order has no more order_items that order should no longer exist. I would like some guidence on how to deal with this as I have no idea where to start. thanks again.
  13. Hi everyone, i'm trying to create a page that displays multiple records and a checkbox for each row. When the submit buton is clicked, every record that has its checkbox clicked should have its status fields updated to '0'. I have been following this tutorial http://www.phpfreaks.com/tutorial/working-with-checkboxes-and-a-database/page4 (and trying to tailor it slightly to my needs) but with no joy. My problem is that the value of the checkbox (whcih should be ID) is not getting passed through for some reason - i have been using var_dump to tell this. I'm sure its a rookie mistake i'm making but i've spent hours on this and cant get it to work. Please can comeone cast their eye over it and hopefully help me out? many thanks in advance, Jaminxz. The checkbox code: <td colspan="2" align="left"><span><input type="checkbox" name="Update[]" value="<?php $row_query4['ID']; ?>" /></span></td> /*note $row_query4['ID'] is definitiely pulling through the id The main code block: $updated = FALSE; //If IS_PostBack then database is to be updated if(isset($_POST['Update'])){ $Update = $_POST['Update']; //make sure every ID in the array is an integer to avoid SQL injection! array_map('intval',$Update); $Update = implode(',',$Update); mysql_query("UPDATE Ad_item SET STATUS=0 WHERE ID IN ($Update)") or trigger_error(mysql_error(),E_USER_ERROR); $updated=TRUE; } Output from var_dump------------- array 0 => string '' (length=0) 1 => string '' (length=0) 2 => string '' (length=0) /* It knows how many checkboxes have been checked, but just not the value?? */
×
×
  • 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.