Jump to content

m1a2x3x7

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

m1a2x3x7's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey guys, A client of mine would like to be able to turn on and off zip codes for certain states. So on the admin side of things I have two radio buttons on and off one has a value of 1 on the other has a value of off. I want them to be able to set all the zip codes to on and off at one time with one submit. I have everything working except for multiple zip code changes it will only update the first one. Here is my code. ob_start(); //CONNECT TO DATABASE// require_once("connection.php"); //PULL INFORMATION FROM THE DATABASE// $query = sprintf("SELECT * FROM zipCodes"); $result = @mysql_query($query); $row = @mysql_fetch_array($result); //VARIABLES// $active ="green.jpg"; $deactive ="red.jpg"; $radio1 = $_POST['radio1']; $radio2 = $_POST['radio2']; //UPDATES ZIPCODE STATUS// if (isset($_POST['submit']) && $radio1 == 1) { $query =sprintf("UPDATE zipCodes SET active = 1 where test_id = '$zipID[$i]'"); $result = @mysql_query($query); $query = sprintf("SELECT * FROM zipCodes"); $result = @mysql_query($query); $row = @mysql_fetch_array($result); }elseif (isset($_POST['submit']) && $radio2 == 0) { $query =sprintf("UPDATE zipCodes SET active = 0 where test_id = '$zipID[$i]'"); $result = @mysql_query($query); $query = sprintf("SELECT * FROM zipCodes"); $result = @mysql_query($query); $row = @mysql_fetch_array($result); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Admin</title> <script src="SpryAssets/SpryTabbedPanels.js" type="text/javascript"></script> <link href="SpryAssets/SpryTabbedPanels.css" rel="stylesheet" type="text/css" /> <style type="text/css"> <!-- .font { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } #wrapper { margin: auto; height: auto; width: 800px; } .tableItems { margin: auto; height: auto; width: 410px; } .items { height: auto; width: 410px; margin-top: 10px; margin-right: auto; margin-bottom: auto; margin-left: auto; clear: both; } .submit { text-align: right; height: auto; width: 80px; margin-left: 490px; margin-bottom: 10px; } .footer { clear: both; height: auto; width: 600px; } .status { height: auto; width: 80px; float: left; margin-left: 30px; text-align: center; margin-bottom: 10px; } .onOff { height: auto; width: 80px; float: left; margin-left: 30px; text-align: center; margin-bottom: 10px; } .zipcode { text-align: center; height: auto; width: 80px; float: left; margin-bottom: 10px; } --> </style> </head> <body> <div id="wrapper"> <div id="TabbedPanels1" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Indiana</li> <li class="TabbedPanelsTab" tabindex="0">Kentucky</li> <li class="TabbedPanelsTab" tabindex="0">Ohio</li> <li class="TabbedPanelsTab" tabindex="0">Illinois</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="TabbedPanelsContent"> <div id="TabbedPanels2" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Zip Code</li> <li class="TabbedPanelsTab" tabindex="0">County</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="font"> <br /> Indiana Zip Codes<br /> <br /> <div class="tableItems"><div class="zipcode">Zip Code</div><div class="status">Status</div><div class="onOff">On </div><div class="onOff">Off</div> <div class="footer"></div></div><form action="<?php $_SERVER['PHP_SELF'];?>" method="post"> <?php do { ?> <div class="items"><div class="zipcode"><?php echo $row['zip_code'];?></div> <div class="status"><img src="images/<?php if ($row['active'] == 1) { echo $active; }elseif ($row['active'] == 0) { echo $deactive; }?>" /></div> <div class="onOff"> <label> <input name="radio<?php echo $row['test_id'];?>" type="radio" id="radio1" value="1" <?php if ($row['active'] == 1) { echo "checked = \"checked\"";}?> /> </label> </div> <div class="onOff"> <label> <input name="radio<?php echo $row['test_id'];?>" type="radio" id="radio2" value="0" <?php if ($row['active'] == 0) { echo "checked = \"checked\"";}?> /> </label> </div> <div class="footer"> </div></div><?php } while ($row = @mysql_fetch_array($result));?><br /><div class="submit"> <input name="hiddenField" type="hidden" value="1" /> <input name="submit" type="submit" id="submit" value="Submit" /> </div></form> </div> <div class="font">Indiana Counties</div> </div> </div> <p> </p> </div> <div class="TabbedPanelsContent"> <div id="TabbedPanels3" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Zip Code</li> <li class="TabbedPanelsTab" tabindex="0">County</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="font"><br /> Kentucky Zip Codes</div> <div class="font"><br /> Kentucky Counties</div> </div> </div> <p> </p> </div> <div class="TabbedPanelsContent"> <div id="TabbedPanels4" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Zip Code</li> <li class="TabbedPanelsTab" tabindex="0">County</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="font"><br /> Ohio Zip Codes</div> <div class="font"><br /> Ohio Counties</div> </div> </div> <p> </p> </div> <div class="TabbedPanelsContent"> <div id="TabbedPanels5" class="TabbedPanels"> <ul class="TabbedPanelsTabGroup"> <li class="TabbedPanelsTab" tabindex="0">Zip Code</li> <li class="TabbedPanelsTab" tabindex="0">County</li> </ul> <div class="TabbedPanelsContentGroup"> <div class="font"><br /> Illinois Zip Codes</div> <div class="font"><br /> Illinois Counties </div> </div> </div> <p> </p> </div> </div> </div> <script type="text/javascript"> <!-- var TabbedPanels1 = new Spry.Widget.TabbedPanels("TabbedPanels1"); var TabbedPanels2 = new Spry.Widget.TabbedPanels("TabbedPanels2"); var TabbedPanels3 = new Spry.Widget.TabbedPanels("TabbedPanels3"); var TabbedPanels4 = new Spry.Widget.TabbedPanels("TabbedPanels4"); var TabbedPanels5 = new Spry.Widget.TabbedPanels("TabbedPanels5"); //--> </script> </div> </body> </html> and here what it looks like right now. http://www.schultzstudio.com/freelance/index.php I'm pretty sure I need to use an array but I can say I've really experimented with them so any help would be great.
  2. thats pretty nice. Not sure what your going to use it for. but i like it
  3. I didn't see the first layout but this one is poor. Font alignment changes and so does the size throughout the site. Find a style and stick with it. Use use a sanserif font. Verdana is a very nice web font clean and easy to read, and keep it consistent. Your flash animation is weak too. The animation looks like its from the late 90s. If you're going to use a top nav don't use a side nav and vice versa. just my .02
  4. first thing i see when i go there is dontation...makes me want to turn around and walk out.
  5. you can use the html redirect <meta http-equiv="REFRESH" content="0;url=http://www.the-domain-you-want-to-redirect-to.com"> put this in your head. The content is how many seconds you want before you are sent to that page.
  6. "you cant share sessions across different domains and http - https make them different why not drop the order details in the db before switching to https you can get the last db_id and append it to the checkout link then perform a $_GET['db_id'] to catch the id in the https page. Then use the id to query the db and retrieve the order details" a good programming friend told me this
  7. It is pretty simple hand over from http to https and maintain the session. Here's an example: <?php session_start(); if(@!$_SERVER['HTTPS']){ // Non - SSL session here $_SESSION['test'] = 'This was set in the non-SSL part of the session!'; header('Location: https://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'?PHPSESSID='.session_id()); exit; } echo $_SESSION['test']; // Now we are in a secure session ?>
  8. ok 1 it you dont need two different if statements you can do a if else but ill let you run with this. instead of if(empty($photo['image_name'])){ try if($photoCount = 0){
  9. you pretty much need to create 2 css one specifically for IE -M
  10. a couple of things. I'm just looking at the main page. At work I use a Mac so this might be just a browser conflict but as web designers this is something important and should be taken care of. Again I'm on a Mac using FireFox. 1. Your navigation bar disappears when I rollover "Our Products" also the navigation bar should be the same length of the banner. 2. Your "search by application" box jumps when you rollover "Mechanical Connections" because connections is dropping to another line. 3. The image under "Quick Product Selector" drops on top of the "NEW Product - Soldering Iron Maintenance Kits" box 4. Add a footer other than that nice site. -M
  11. you server is only allowing you to add an image at a certain size you don't have to "flush it out" you need to do what lemmin said. next to your upload file input box add <input type="hidden" name="MAX_FILE_SIZE" value="100000"> the value (10000) is what sets the amount of bytes you can upload to the server. If the value is set at 100000 then you can only upload an image at no greater then that size. It's kind of like a safety feature so they don't max out your server space or add a virus.
  12. ok the form submits right? but you get it as plain text? ok I believe in order to send it as a HTML format you'll need to store it on the server so in a database then have the page sent and request the data from the database depending on the email address. I think it would be kinda complicating so if you don't have much experience with php you should stick with a text file
×
×
  • 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.