Jump to content

ibda12u

Members
  • Posts

    23
  • Joined

  • Last visited

    Never

Everything posted by ibda12u

  1. This is code that works with the menu system, I didn't write it, but it does work well. I'm pretty certain the javascript isn't the issue, I only listed it in case someone wanted to see how it was being called. The actually CSS file is below it. Thanks for your time dannyb785. Again I was just looking for a second set of eyes to look over it too see if there was something easy I was missing. I don't want to take any of your time.
  2. I'm sorry, I placed all my code on their for reference. I was assuming that someone who's seen something before would just see something I'm missing. I know that the code works, and works well. I'm just missing something in my code what will let me center the menu. I apologize if my posting was taken as "doing my work for me" I just wanted a second set of eyes that may spot my error.
  3. I'm having a real problem getting my CSS navigation menu centered on my page. I think my code is a real mess, but I'm wondering if anyone can see the problem. I'm actually using DNN and a new menu module to get it to display on the page, but I'm still sure the problem is in my css code. Any idea's? Here is the code that calls the CSS. The actual CSS is below. I don't think the problem is here, but figured I'd submit it could be helpful. <head> <link rel="stylesheet" type="text/css" href="silver.css" /> <script type="text/javascript"> function NavMouseover(li) { var agent = navigator.userAgent.toLowerCase(); var regex = /msie/i; if (regex.test(agent)) li.className+=' hover '; if (li.id.match('^navParent')) { var navChild=document.getElementById('navChild'); if (navChild) { var childContainers = navChild.getElementsByTagName('ul'); if (childContainers) { for (var i = 0; i < childContainers.length; i++) { if (childContainers[i].id.match('^navChild')) { if (childContainers[i].id.match('^navChild-'+li.id.substring(li.id.indexOf('-')+1))) { childContainers[i].style.display='inline'; } else { childContainers[i].style.display='none'; } } } } } } } function NavMouseout(li) { var agent = navigator.userAgent.toLowerCase(); var regex = /msie/i; if (regex.test(agent)) li.className=li.className.replace(' hover ', ''); } </script> </head> [NavMenu-Container[ <div id="{NavMenu.Id}" class="TabList"> <ul class="Level1"> ]] [Level0-Item[ <li id="{NavMenu.Id}-{Tab.Id}" iif({Tab.IsActive}='True', class="SelectedItem") onmouseover="NavMouseover(this);" onmouseout="NavMouseout(this);" > ]] [Level0-Anchor[ <a href="{Tab.Url}" title="{Tab.Title}">{Tab.Name}</a> ]] [/Level0-Item[ </li> ]] [/NavMenu-Container[ </ul></div> ]] Here is the CSS Code UL LI {list-style-type:square ; text-align: center;} UL LI LI{list-style-type:disc; text-align: center;} UL LI LI LI {list-style-type:circle; text-align: center;} OL LI {list-style-type:decimal;} OL OL LI{list-style-type:lower-alpha;} OL OL OL LI {list-style-type:lower-roman;} .TabList { width: 800px; horizontal-align:center; vertical-align:middle; text-align: center; } .TabList ul { margin:0; list-style:none; display: inline; vertical-align:middle; text-align: center; } .TabList li { float:left; margin:0; display: inline; padding:0 0 0 10px; vertical-align:middle; } .TabList li a { font-family:Tahoma,San-Serif; font-size:12px; voice-family: "\"}\""; voice-family:inherit; line-height:normal; vertical-align:middle; } select.TabList { border-left: #003366 1px solid; border-right: #003366 1px solid; border-top: #003366 1px solid; /* border-bottom: #003366 1px solid; */ background-color: #F3F3F4; color:#FFFFFF; font-weight:bold; font-size:80%; } #navParent a { font-weight:bold; float:left; display:block; text-align:center; white-space: nowrap; text-align: left; padding: 5px 5px 5px 5px; text-decoration:none; color:#3B3B3B; background-color: #F3F3F4; border-left: #BCBDC0 1px solid; border-right: #BCBDC0 1px solid; border-top: #BCBDC0 1px solid; border-bottom: #BCBDC0 0px solid; } #navParent a:hover, #navParent li.hover a { text-decoration:none; background-position:100% -125px; color:#004E82; background-color: #FFFFFF; border-left: #BCBDC0 1px solid; border-right: #BCBDC0 1px solid; border-top: #BCBDC0 1px solid; border-bottom: #FFFFFF 1px solid; } #navParent li { background:url() no-repeat left top; border-bottom: #999999 1px solid; background-color: #F3F3F4; } #navParent li:hover, #navParent li.hover { /* background-position:0 -125px; */ border-bottom: #FFFFFF 1px solid; } #navParent .SelectedItem { /* background-position:0 -125px; */ border-bottom: #FFFFFF 1px solid; } #navParent .SelectedItem a { /* background-position:100% -125px; */ color:#004E82; border-bottom: #FFFFFF 1px solid; } #navChild ul { padding:2px 0 2px 3px; margin:0; display:none; list-style:none; float:left; } #navChild ul ul { display:inline; } #navChild li { position: relative; padding:4px 8px 6px 0; background:url() no-repeat right 8px; } #navChild li ul { /* second-level lists */ position : absolute; z-index:5; left: -999em; border:1px solid #333333; background-color:#f1f1f1; } #navChild a { display:block; text-decoration:none; padding:2px; color:#000; text-align:left; border:1px solid #f1f1f1; } #navChild li li a { width:125px; } #navChild li a:hover { background-color: #ffffff; border:1px solid #3b3b3b; } #navChild a.SelectedItem { background-color: #ffffff; border:1px solid #3b3b3b; } #navChild .DisabledItem { color:#cccccc; } /* no need to change these hover classes unless you need more than 4 levels */ #navChild li:hover ul ul, #navChild li:hover ul ul ul, #navChild li:hover ul ul ul ul, #navChild li.hover ul ul, #navChild li.hover ul ul ul, #navChild li.hover ul ul ul ul{ left: -999em; } #navChild li:hover ul, #navChild li.hover ul { top: 26px; left:0; } #navChild li li:hover ul, #navChild li li li:hover ul, #navChild li li.hover ul, #navChild li li li.hover ul { top: 0; left:130px; }
  4. Thank you so much, I guess I'd just been looking at it too long!
  5. Hello, I'm getting a javascript error when I run the following code on my page. I am at a total lost, can anyone point me in the right direction, so I can figure what is causing the error? Pretty much this is supposed to be a simple currency convertor. Thanks, Ibda <head> <title>Money Exchange</title> <script language="JavaScript"> <!-- function convert() { var amt = parseFloat(exchange.amount.value); var euro = Math.round((amt * .0.636821) * 100) / 100; document.write(exchange.amount.value + " dollars is " + euro + " Euros"); } //--> </script> </head> <body> <form name="exchange" action="javascript:convert()" method="post"> Amount to convert <input type="text" name="amount"><br/><br> <input type="radio" name="RBgender" value="euro" id="radio1">Euro to Dollar<br> <input type="radio" name="RBgender" value="dollar" id="radio2">Dollar to Euro<br><br> <input type="submit" value="Submit Form"> </form> </body> </html>
  6. Hello I'm trying to ping several websites in order to keep them alive. I have a simple script here that I use that works great for 1 website. but if I include another site, my script doesn't run. Is there a way I can run this script and have it open more than 1 site at a time? <?php ob_start(); include("http://mywebsite.com"); ob_end_clean(); ?>
  7. Hello I use the x protection version 1.10 script which basically is a script that allows you to control user access on a specific page, using either an existing mysql database or using encrypted sha1 passwords. I've used this script a bit in the past, but the developer has stopped work on the project, and as of late there has been a security issue. as described here http://secunia.com/advisories/21282 "Input passed to the "username" and "password" form field parameters in protect.php is not properly sanitized before being used in SQL queries. This can be exploited to manipulate SQL queries by injecting arbitrary SQL code. Successful exploitation can be used to bypass authentication, but requires that "magic_quotes_gpc" is disabled. The vulnerabilities have been confirmed in version 1.10. Other versions may also be affected." I'm curious if anyone know's what I could do to fix the code? to make it properly sanitize the field parameters? Any idea's?
  8. it just displays the pages html [code] <?php if($fathers_email != "" && !strstr($fathers_email,"@") || !strstr($fathers_email,".")) { echo 'Sorry all required fields were not filled out, please <a href="javascript: history.go(-1)">go back</a> and correct Father\'s Email Address. '; } else { echo 'Enrollment Application Step 5</font></b></font><p><font face="Verdana" size="1">Please                   complete the form below to reserve your child\'s                   spot. While it does not guarantee that an opening will be                   immediately available, it does promise that the next available                   spot will be held for your child. <font color="#CC3300">To                   avoid delays </font></font>   ';}                     ?> [/code]
  9. I tried this, and it won't let me not enter an email at all. [code] <?php if(isset($fathers_email)){ if(!strstr($fathers_email,"@") || !strstr($fathers_email,".")) { echo '<span class="style5">Sorry all required fields were not filled out, please <a href="javascript: history.go(-1)">go back</a> and correct Father\'s Email Address.</span> '; }else { echo ' [/code]
  10. Hello just as my title says, I have a form with an email field that is optional for the user to fill out. What I've been trying to do is if a user fills out the optional email address field, it will check that field to make sure there is a . and an @ in the email. My code here works, except it won't validate if the email field is empty. Any idea's? [code] <?php if($fathers_email != "" && !strstr($fathers_email,"@") || !strstr($fathers_email,".")) { echo 'Sorry all required fields were not filled out, please <a href="javascript: history.go(-1)">go back</a> and correct Father\'s Email Address. '; } else { echo '  [/code]
  11. Shaymol, Are you asking the next steps to get your own domain name hosted on your apache installation? If so, do you already own your domain name? And then secondly do you have a DNS server, as you'll need to use some type of DNS server/service and have it point to your pc's IP address (assuming it's static). Then you can cofigure that domain into apache. If this is what you're wanting to do let me know, and I'll send some helpful links. Thanks, [!--quoteo(post=387930:date=Jun 26 2006, 01:11 AM:name=shaymol)--][div class=\'quotetop\']QUOTE(shaymol @ Jun 26 2006, 01:11 AM) [snapback]387930[/snapback][/div][div class=\'quotemain\'][!--quotec--] hi guys i've install the apache2triad in my pc. now i wanna configure my apache server to get my site say as www.mysite.com ( in intranet ) what things should i learn to configure that or give me any link or any idear to do that plz mail me if u have any idea by shaymol mail: shaymol.cse@gmail.com [/quote]
  12. I figured it out by doing this [code]    $t = "TABSSC1Q" . $quantity;           break; } } $scprice = ${$t};[/code]
  13. Okay, now this part here is even more difficult than the first I believe [img src=\"style_emoticons/[#EMO_DIR#]/unsure.gif\" style=\"vertical-align:middle\" emoid=\":unsure:\" border=\"0\" alt=\"unsure.gif\" /] I have an include page that lists these variables [code]$TABSSC1Q500 = '196.00'; $TABSSC1Q1000 = '264.00'; $TABSSC1Q2000 = '401.00'; $TABSSC1Q5000 = '777.00';[/code] on my main page I have this code [code] <?php if ($frontcls =="1" && $foldertype == 'Folder A' || $foldertype == 'Folder B')   {   switch($quantity)   {       case '500':       case '1000':       case '2000':       case '5000':           $t = $TABSSC1Q . $quantity;           break; } } $scprice = $t; ?>[/code] What I'm trying to do is get $t to become a variable from my include page. So I can return the value of that variable. Is it possible to create a variable from 2 others? When I run this code as it is, it only displays the value of quantity. I tried $t = "$".TABSSC1Q . $quantity; but it simple returned the string $TABSSC1Q500 (if the quantity was 500), but it does return the actual value of the variable $TABSSC1Q500 Any idea's?
  14. Wow, everyone awesome awesome. I didn't even think about the switch option! Thanks a ton! [!--quoteo(post=387553:date=Jun 24 2006, 03:33 PM:name=Bane)--][div class=\'quotetop\']QUOTE(Bane @ Jun 24 2006, 03:33 PM) [snapback]387553[/snapback][/div][div class=\'quotemain\'][!--quotec--] to add to kenrbnsn's post, you can also do this: [code] <?php if ($foldertype == 'A' || $foldertype == 'B') {    switch ($quantity) {       case '500':       case '1000':       case '2000':       case '5000':           $iprice = $TempAB . $quantity;           break;          default:                  $iprice = 0;                  break; } } ?> [/code] but i've taken the liberty of assuming that the value of $quantity will be a part of $iprice so this is conditional. :edit: i added a 'default' case to be on the safe side. :edit 2: you can also do this if you prefer: [code] <?php $allowed = array('500', '1000', '2000', '5000'); if (($foldertype == 'A' || $foldertype == 'B') && in_array($quantity, $allowed)) {           $iprice = $TempAB . $quantity; } ?> [/code] [/quote]
  15. Hello I'm trying to write a complex if statement. Any idea why this doesn't work? or what is the best way to write this? [code]   <?php           If ($foldertype == "A" || "B" && $quantity == "500") {$iprice = $TempAB500};           If ($foldertype == "A" || "B" && $quantity == "1000") {$iprice = $TempAB1000};           If ($foldertype == "A" || "B" && $quantity == "2000") {$iprice = $TempAB2000};           If ($foldertype == "A" || "B" && $quantity == "5000") {$iprice = $TempAB5000};           ?>[/code] $foldertype is a dropdown form, where someone can select either Folder A, B, C, or D. I want the if to work if they selected A or B. $quantity is another dropdown. The TempAB500 variables are just prices. Any ideas?
  16. I have a phone list, that has all the contact details stored in 1 database. My form retrieves all this data and displays it in a page. What I would like to do is add a image that say in or out. (if the person has clocked in, or clocked out) I wanted to do this by pulling data from my time clock database. So when the page gets displayed it would look something like this InOffice | Name | Phone Number | Office In person1 111-1111 2b Out person2 111-1112 2c etc....... My query for pulling the contacts works great, but added or tried to add the query to pull the time clock info in, and now my list doesn't display my contacts anymore. no errors. Any idea's here is my code [code] <? # List the contacts. $qtable = "users"; $qfields = "userid, dept, location, name, phone, cell, email, initials, active"; # Sort by user (contact). $qresult = mysql_query("select $qfields from $qtable where (phone != '' or cell != '') and (active = '1') order by name") or die ("Invalid Query: Possibly database server down."); while(list($userid, $dept, $location, $name, $phone, $cell, $email, $initials)=mysql_fetch_row($qresult)){ $dept=stripslashes($dept); $location=stripslashes($location); $name=stripslashes($name); $phone=stripslashes($phone); $cell=stripslashes($cell); $email=stripslashes($email); # Get inoffice/outoffice mysql_select_db (nuke,$db); $qresult2 = mysql_query("select inoffice, username from nuke_users where username='$email'") or die ("Invalid Query: Possibly database server down."); while(list($inoffice)=mysql_fetch_row($qresult2)){ ?> <tr bgcolor="#FFFFFF">                             <td align=center bgcolor=white> <?                             if ($inoffice==0) {                               echo "<img src='images/out.jpg'>";                             } elseif ($inoffice==1) {                               echo "<img src='images/in.jpg'>";                             } else {                               echo "<img src='images/na.jpg'>";                             }                             ?>                             </td>                           <?                             if ($email == "NA") {  ?>                               <td><? echo $name; ?></td>                           <?  } else { ?>                               <td><? echo '<a href=mailto:' . $email . '>' . $name . '</a>'; ?></td>                           <?  } ?>                             <td><? echo $email; ?></td> <!--  -->                             <td><? echo $dept; ?></td>                             <td><? echo $location; ?></td>                             <td><? echo $phone; ?></td>                             <td><? echo $cell; ?></td>                          </tr> <? } } ?>[/code]
  17. [!--quoteo(post=353451:date=Mar 9 2006, 06:14 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Mar 9 2006, 06:14 PM) [snapback]353451[/snapback][/div][div class=\'quotemain\'][!--quotec--] if ($AcceptTerms=="" || $UserPlan=="" ){ $errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } if($errors==1){ echo "$error"; } $link = mysql_connect("localhost","data","passwd"); mysql_select_db("data",$link); $query2="SELECT Username FROM signup where Username='".$Username."'"; $result2=mysql_query($query2) or die(mysql_error()); $num_rows=mysql_num_rows($result2); if($num_rows == 1){ echo 'Username in use, hit back button please'; }else{ $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="Username: ".$Username."NewPassword1: ".$NewPassword1."NewPassword2:".$NewPassword2." AcceptTerms: ".$AcceptTerms."UserPlan: ".$UserPlan." "; $link = mysql_connect("localhost","data","passwd"); mysql_select_db("data",$link); $query="insert into signup(Username,NewPassword1,NewPassword2,AcceptTerms,UserPlan) values ('".$Username."','".$NewPassword1."','".$NewPassword2."','".$AcceptTerms."','".$UserPlan."')"; mysql_query($query); } ?> ive neatened it up a bit, to be honest, this whole code is a mess. so much unneeded. add me on my msn - joe@joeyjoe.co.uk , dont email as i cannot recieve emails at this time. [/quote] Hmm... that still didn't resolve it. I added you as a buddy. msn - msanders@impact-x.com It still just ignores the username I've inputted and adds it
  18. I'm going crazy with some code I've got. I have a signup form, that asks for a username. I'm trying to build and if else statement that won't insert data into the table if the username is already in the table. This is my code. [code] if($AcceptTerms=="" || $UserPlan=="" ){$errors=1; $error.="<li>You did not enter one or more of the required fields. Please go back and try again."; } [b]if[/b]($errors==1){ echo $error;} $link = mysql_connect("localhost","data","passwd"); mysql_select_db("data",$link); $query2="SELECT Username FROM signup where Username='".$Username."'"; $result2=mysql_query($query2) or die(mysql_error()); $num_rows=mysql_num_rows($result2); [b]if [/b]($num_rows == 1) { echo 'Username in use, hit back button please'; }[b]else[/b] { $where_form_is="http".($HTTP_SERVER_VARS["HTTPS"]=="on"?"s":"")."://".$SERVER_NAME.strrev(strstr(strrev($PHP_SELF),"/")); $message="Username: ".$Username."NewPassword1: ".$NewPassword1."NewPassword2:".$NewPassword2." AcceptTerms: ".$AcceptTerms."UserPlan: ".$UserPlan." "; $link = mysql_connect("localhost","data","passwd"); mysql_select_db("data",$link); $query="insert into signup(Username,NewPassword1,NewPassword2,AcceptTerms,UserPlan) values ('".$Username."','".$NewPassword1."','".$NewPassword2."','".$AcceptTerms."','".$UserPlan."')"; mysql_query($query); ?> <?php } ?>[/code] The code pretty much ignores my code to check the db for the username, and goes ahead and inserts the duplicate username and info in the DB. Any idea's?
  19. [!--quoteo(post=352280:date=Mar 6 2006, 04:19 PM:name=Gaia)--][div class=\'quotetop\']QUOTE(Gaia @ Mar 6 2006, 04:19 PM) [snapback]352280[/snapback][/div][div class=\'quotemain\'][!--quotec--] Exactly. When you retrieve the data, it would be like 1,12,34...when you explode it, it will end up in an array. [code] $foo = array (     [0] => 1,     [1] => 12,     [2] => 34 ); [/code] Then with the in_array function you just wrap an if statement around it. [code] if ( in_array('1',$foo) ) {     echo '1 was found in the array'; } else {     echo '1 was not found in the array'; } [/code] Hope that helps some :). [i]EDIT[/i]: And yea, as Xeno said, you could create a new MySQL table listing the permissions and do it from a MySQL perspective. [/quote] Hmm.. I'm guesing that'd be a table with a access level, an id, and an foreign key back to the original table?
  20. [!--quoteo(post=352258:date=Mar 6 2006, 04:01 PM:name=Gaia)--][div class=\'quotetop\']QUOTE(Gaia @ Mar 6 2006, 04:01 PM) [snapback]352258[/snapback][/div][div class=\'quotemain\'][!--quotec--] You could probably do something like seperate them with comma's (make sure the table type is set to text) then use the explode() function in PHP to put them in an array then use the in_array() function with an if statement? Not sure if that's the direction you're wanting to go or not. [/quote] I think that's the direction I'm looking for. I'm not super strong with explode and in_array yet (something to read up on. But I guess I'd like my code to at all the numbers in the array, and then allow access based on that. Ex. suppose a page has an access lvl requiring 12. My user has a 1,12,34 all in his level field. So I could explode that data into an array. Then have my access script check to see if 12 is in the array?
  21. I have a question. I am using a php login script that checks an access level in a table. This access level is just a number in a column called level in the table. What I am wondering is, is there a way to input more than 1 number in the level column? IF so, is there something I can insert in between them, so that sql can tell that it's not just 1 number, but seperate numbers?
×
×
  • 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.