Jump to content

FinalFrontier

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

FinalFrontier's Achievements

Member

Member (2/5)

0

Reputation

  1. I am using this for my background: background: rgba(127,127,127,0.25) This isn't valid CSS and I am wanting to use: background: rgb(127,127,127); opacity: 0.25 The problem with using the second one is that the opacity also effecting everything inside the DIV container. Does anyone have a solution for just getting the background at 25% opacity, whilst being CSS compliant (no transparent image as background please )?
  2. I have a row in a MySQL table called id, which auto-increments. I was wondering if anyone knows a PHP solution to find out what the highest number in the row is? I am thinking perhaps execute a MySQL query that will list the highest number, and then echo the result, like $row[id] in PHP?
  3. Its OK. I have finally found a cool tutorial.
  4. I have an image gallery that has 10 images on it. Its a very simple image gallery, basically you have "A" "B" "C" "D" etc, and for each letter you click on, JavaScript changes the relative image from hidden to block. The problem I have is that all of the 10 images load in the background, despite the user not clicking on the corresponding letter, which wastes a ton of bandwidth (because most users won't view all of the images). I am wondering if someone could show me a very simple example (if its possible to do) using JavaScript and onClick, so that the image loads on demand.?
  5. Ah yeah..! That makes more sense. Thank you, Adam.
  6. Is it possible for JavaSscript to toggle a submit button (toggle meaning as though I clicked it)? I will be using it in this code: <SCRIPT type="text/javascript"> if (document.forms["form"]["quantitys"].value > '.$row['quantity'].') { alert ("The quantity you wanted for product '.$row['id'].' is no longer available and will be changed to the highest available quantity."); document.forms["form"]["quantity"].value = '.$row['quantity'].'; // JAVASCRIPT TOGGLE SUBMIT } </SCRIPT> The submit button: <INPUT name="submit" type="submit" value="UPDATE QUANTITY">
  7. Ah, I needed this: if ($row['laybypassword'] == $_POST['lay-bypassword'] && ($row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C")) This problem is now solved.
  8. I have a rule of conditions for access into an area of my site. The problem is, that when the wrong password is given, its still giving access to the area of the site. It is happening because I am using conditions wrong, and ask if someone could help me out by pointing out the correct way to do it. When I say "conditions", I am referring to things such as && and || if ($row['laybypassword'] == $_POST['lay-bypassword'] && $row['status'] == "A" || $row['status'] == "B" || $row['status'] == "C") So, if the correct password is given, and the row status equals A, B, or C, then do foobar.
  9. I forgot how to write multiple conditions with if(). if (A == B || C == D) {foobar;} I know the above is if any of the conditions is true, then do foobar, but what is it again so they both have to be true? I have forgotten, but I'm guessing either if (A == B && C == D) {foobar;} if (A == B ++ C == D) {foobar;} ?
  10. I use: $query = "SELECT * FROM orders WHERE customeremail = joe@example.com"; $result = mysql_query($query); $row = mysql_fetch_array($result); mysql_query ($query); I then use: while ($row = mysql_fetch_array($result)) { $random = rand(10000000, 99999999); $query = "UPDATE orders SET laybypassword = ".$random." WHERE id = ".$row['id'].""; mysql_query ($query); } The first of the two rows updates, but the second doesn't. Why is that? Am I suppose to be using something like foreach()?
  11. Problem solved: $query = "SELECT * FROM orders WHERE customeremail = '".mysql_real_escape_string($_POST['customere-mail'])."'"; $result = mysql_query($query); mysql_query ($query); while ($row = mysql_fetch_array($result)) { echo "LOL"; } $query = "SELECT * FROM orders WHERE customeremail = '".mysql_real_escape_string($_POST['customere-mail'])."'"; $result = mysql_query($query); $row = mysql_fetch_array($result); mysql_query ($query); if ($row['customeremail'] != "") {
  12. This is beyond a fricken joke!!!!!! Ok, here is the code. And a friendly note. Please don't criticize my 'inefficiency' of code. I really don't care right now and all it does is frustrate me. I won't respond to critisizsm that is not in relation to this problem. I am just trying to find out why this isn't working. Here is the full source code of the entire page and the problem is at line 6. The problem is that "LOL" is not echoing. If I remove the while() the $row echo's fine. But why isn't it working in a while() string?: <?php session_start(); $link = mysql_connect('localhost', 'testusr', 'testpw'); mysql_select_db('testdb', $link); $query = "SELECT * FROM orders WHERE customeremail = '".mysql_real_escape_string($_POST['customere-mail'])."'"; $result = mysql_query($query); $row = mysql_fetch_array($result); mysql_query ($query); if ($row['customeremail'] != "") { while (mysql_fetch_array($result)) { echo "LOL"; } $subject = "Lay-by password recovery"; if ($row['customertitle'] != "") { $customer = $row['customertitle']." ".$row['customerlastname']; } else { $customer = $row['customerfirstname']; } $body = " Dear ".$customer." I received a request from the IP address ".$_SERVER['SERVER_ADDR']." for lay-by access recovery on your lay-by. Your lay-by access information: ".$accessinformation." Kind regards,"; $header = 'From: A B <me@example.com>'; // mail($_POST['customere-mail'], $subject, $body, $header); $result = ' <FORM action="../" style="left: 50%; margin-left: -22px; margin-top: -5px; position: absolute; text-align: center; top: 50%"> <DIV> Done. <BR> <BR> <INPUT class="verdana" type="submit" value="OK"> </DIV> </FORM> '; } else { $result = ' <FORM action="../" style="left: 50%; margin-left: -160px; margin-top: -5px; position: absolute; text-align: center; top: 50%"> <DIV> '.$_POST['customere-mail'].' was not found in the lay-by database. <BR> <BR> <INPUT class="verdana" type="submit" value="OK"> </DIV> </FORM> '; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <TITLE>My Site</TITLE> <META content="charset=windows-1252;text/html" http-equiv="content-type"> <LINK href="../../css/body.css" rel="stylesheet" type="text/css"> <STYLE type="text/css"> A.gold { color: rgb(255,215,0) } DIV.path { left: 50%; margin-left: -565px; margin-top: -266px; position: absolute; top: 50% } </STYLE> <DIV> <IMG alt="" class="logo" src="../../images/structural/logo.png"> <DIV class="customermenu"><?php include '../../rawcode/menus/customermenu/payofflay-by'; ?></DIV> <DIV class="mainmenu"><?php include '../../rawcode/menus/mainmenu/mainmenu'; ?></DIV> <DIV class="topseparator"></DIV> <DIV class="path">> <A class="gold" href="../../">Payoff lay-by</A> > <A class="gold" href="../accessrecovery">Access recovery</A> > Result</DIV> <?php echo $result; ?> <DIV class="bottomseparator"></DIV> <DIV class="informationmenu"><?php include '../../rawcode/menus/information/information'; ?></DIV> <DIV class="copyright"><?php include '../../rawcode/menus/copyright/acopyright'; ?></DIV> </DIV>
  13. Thanks for the effort, but it seems a real long way round. What I've done is echo these with > the results: $row > Array $result > Resource id #3 So, it seems something is up with the actual MySQL query. I will investigate some more..
  14. Ahhhh. That idea came accross my mind before! Why didn't I try it!! dumb! Thanks dude!
×
×
  • 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.