Jump to content

njdirt

Members
  • Posts

    31
  • Joined

  • Last visited

    Never

Everything posted by njdirt

  1. Thanks Haku, you're right, it does require Javascript. I am going to use the Lightbox2 code from the link I posted up. Thanks for your quick response, too!
  2. Here is an example that uses Flash. I know there is something that uses only CSS though. http://www.huddletogether.com/projects/lightbox2/
  3. Hello, So I'm trying to make it so that on my site, when a user clicks a particular image, a semi-transparent <div> shows up covering 100% of the site and the larger image is shown centered on top of this. I know there must be a popular code out there to do this as I've seen it many times. Unfortunately, I can't remember any sites I've seen it on... if you have seen this, could you please post a link to a site that uses it? Thanks in advance!
  4. Hello, I am working on applying a coupon code option to a Paypal integrated store html page on my website. I want the user to have the ability to enter a Coupon Code for a discount on each item. I pirated some sample how-to code from a site (sorry I don't have the info), but I think the fact that I have multiple items listed on the page prevents it from working. I've posted the relevant code below. I think the problem may be in the assigning of the discount_rate variable where I use 'document.contra.discount_rate.value = "10"; Total JS noob too so I'm trying to figure it out as i go. Thanks in advance! <form name="contra" method='POST' action='https://www.paypal.com/cgi-bin/webscr' target='paypal' onSubmit="paypal=window.open('https://www.paypal.com/cgi-bin/webscr','paypal','width=680,height=400,status=yes,location=no,menubar=no,scrollbars=yes,resizable=yes');paypal.focus();" > <input type="hidden" name="business" value ="xxxxx"> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="cmd" value="_cart"> <input type="hidden" name="add" value="1"> <select name='os0' size='1' style='background-color: #FFFFFF; color: #000000;'> <option value='Select Top Tube'>Select Top Tube</option> <option value="21.5"">21.5"</option> <option value="22"">22"</option> </select> <input type='hidden' name='on0' value='Top Tube'> <select name='os1' size='1' style='background-color: #FFFFFF; color: #000000;'> <option value='Select Color'>Select Color</option> <option value='Black'>Neon Green</option> <option value='Brown'>Dark Orange</option> <option value="Orange">Black</option> </select> <input type='hidden' name='on1' value='Color'><br><br>Qty <input type='text' name='quantity' size='3' value='1'> <input type='submit' onclick='if(os0.selectedIndex==0){alert(os0.options[0].value);os0.focus();return(false);}if(os1.selectedIndex==0){alert(os1.options[0].value);os1.focus();return(false);}' value='Add to Order' name='B1' style='background-color: #ff6600; color: #000000; font-weight: bold'> <input type='submit' value='View Order' name='display' style='background-color: #ff6600; color: #000000; font-weight: bold'> <!-- promo code --> <br> <input type="text" name="promo"> <input type="button" value="Check It" name="Submit" onclick=javascript:validate(promo.value,"GOLD10") > <script language="javascript"> function validate(text1,text2) { if (text1 == text2) { window.alert("Nice, you get a 10% Discount!"); document.contra.discount_rate.value = "10"; document.contra.discount_rate2.value = "10"; document.contra.on3.value = "Coupon Entered"; document.contra.os3.value = "GOLD10"; } if (text1 !== text2) { window.alert("Sorry, No Discount!"); } } </script> <!-- end promo code --> <br><br><noscript>Please enable Javascript to order this item</noscript><input type='hidden' name='item_number' value=''> <input type='hidden' name='item_name' value='MOB'> <input type='hidden' name='amount' value='399.99'> </form>
  5. That is the proper way to do it, but I found that if I make the "::" the same size as the larger of the two menu fonts, everything works fine. Not sure how or why, but it does so in all tested browsers, so I'm content. Thanks for the proper fix tho! I will keep the menu lists in mind for future site builds.
  6. Hello, I hope this is a properly labeled thread, but here is my issue: I have a menu, which is all on one line (in case it matters). The link that is being hovered over is larger than the rest of the menu items, and in between each item is "::". Now, each time a link is hovered over, the "::" drops a pixel or so. I want everything to stay vertically stationary (except the hovered text, which expands higher. I feel like it has something to do with baseline, but I can't find any info on it. Here is the link: http://www.blackmarketbikes.com/10/index.php Thanks in advance!
  7. Hello, How can I empty all values in a db field (within a table of course) and then reload every entry with the same info? For instance, take a pref_contact field. There are many entries in this table, some have a value for "pref_contact" and others don't. Either way, I want to change the field value of all of them to "11000". Is this the correct SQL query: INSERT INTO TableX (pref_contact) VALUES (11000) And will it change the value in every entry in the table? Thanks in advance!
  8. Thanks, I think I figured out a way to make it work for me. The stored value is a 5 digit number composed of zeros and ones, with each digit acting as an operator for a specific option. Then for each switch, I look to the first, second,...,fifth digit to see if it is true or false, like so: $ch_email = substr($preferred_contact,0,1); $ch_phone1 = substr($preferred_contact,1,1); $ch_text1 = substr($preferred_contact,2,1); $ch_phone2 = substr($preferred_contact,3,1); $ch_text2 = substr($preferred_contact,4,1); Thanks again, hope this helps somebody out. I'm trying to add more options to a db with thousands of entries already, so I can't add fields as I please...
  9. Hello, Thanks for the quick replies! I have not yet stored anything in the database. Basically, I'm storing 5 boolean switches in one field in the db. I'm going to see if I can make it work better with the suggestions you gave me Neil. Thanks, I'll let you know how it turns out!
  10. Hello, I think this is a simple enough problem and I hope somebody knows how to do it. I have a page that has five form options which correspond to a value in a database. If all five options were selected, the value would be '12345' and if the first second and fifth were selected, the value would be "125". I need some way of determining from the value which options are to be selected. Optimally, I'd like something along the lines of: if $value contains "1" then ... if $value contains "2" then ... Any ideas? Thanks in advance!
  11. Found a solution for my problem here: http://www.javascript-fx.com/fade_rollovers/general_help/help_remote.html Works great - thanks for all of your help too!
  12. Thanks, Film God! I'll see if I can;t make that work
  13. Hello, So, I know I've seen this done before, but I don't know how to do it: Take this Layout, though right now it is just an image... If someone were to mouse over "About" I would like the text "Who We Are" to appear to the left of About, in that open space. If someone moused over "Services" I'd like "What We Do" to appear in the same space. I will also have the links themselves do a rollover effect, though I know how to do that. If anyone could point me in the right direction, I'd appreciate it very much! Thanks in Advance!
  14. Hey, I'm looking for a PHP blog that has the ability to pull posts from other blogs via their RSS feeds and post them into my own blog, while still maintaining the ability to post my own entries. Anyoner every heard of any? Thanks in advance!!
  15. I just went with a different authentification system for my software. It seems pretty good and very easy!! http://www.zubrag.com/scripts/password-protect.php
  16. Hey, Does anybody have any ideas? I am still trying to find something that will work, without luck, unfortunately. please help me finish this! Thanks!
  17. Still no luck, even with that last suggestion. Can anyone think of any reason why the server isn't receiving the username and password? Thanks for the help!
  18. Hey, Sorry, yes, I do mean that the directory is protected with .htaccess. I was trying the cURL stuff and did a bunch of research on it. For some reason, though, I still can't get the login part to work. Here's my code: $usrnm = "xxxxx"; $pswrd = "xxxxx"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.mysite.com/protected/file.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); curl_setopt($ch, CURLOPT_USERPWD,$usrnm . ":" . $pswrd); curl_exec($ch); curl_close($ch); Thanks!
  19. Thanks, that solves some of the problem! That showed me a safer way to include the page, rather than include();. Let me try to explain my problem in a different way... I have some PHP software where all of the files for a client reside in one folder. To protect them, the file is password protected. Not a PHP password, it's the kind that I set through my FTP client. Now, I am writing some code for the business website, where it needs to access some files in that protected folder. What is the safest way to do this? Thanks in advance! Here is the code I'm going to use for the actual inclusion, using CURL as neil suggested: <?php $curl_handle=curl_init(); curl_setopt($curl_handle,CURLOPT_URL,'http://example.com'); curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,2); curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1); $buffer = curl_exec($curl_handle); curl_close($curl_handle); if (empty($buffer)) { print "Sorry, example.com didn't load.<p>"; } else { print $buffer; } ?>
  20. Hi, I am working on a script that will be used externally from my site, and needs to access files that are within a password protected folder. I have been looking for a way to automatically enter the username and password (and thus gain temporary access to the files), but I've had no luck searching. Does anyone know how to do this? Is there a safer way? I know that coding the uname and pword into the file is not very secure, but I have no other ideas. Thanks in advance! -Mark
  21. Hey, I'm trying to include a SImplePHP blog into another php page, and I keep getting errors of PHP not bieng able to find the includes of the page which I'm trying to include. I only know how to do this with the simple "include("ddfsd")" method. Maybe there is something better? This is the page I want things to show up on : www.thrashbike.com/mine This is the page I want to show up on the aforementioned page : www.thrashbike.com/mine/blog/index.php Here is the code from mine/index.php : <td align="left" width="500px"> <?php include("blog/index.php"); ?> </td>
  22. I got it! I had to create a variable with the html layout, and which is appended to each time more html is generated by the php. A cron tab is set to run the script at night each night to deliver the file. Saweeet!! Thanks for everyone's help <?php $cur_date = date("F d, Y"); include("2/includes/list.php"); $message = "<html><head><title>Repair-Machine</title></head><body><table border=\"0\" width=\"75%\" align=\"center\"><tr><td><h1>Repair Schedule for $cur_date<h1></td></tr><tr><td valign=\"top\" width=\"100%\"><table border=\"1\" width=\"100%\"><tr><td colspan=\"5\"><h2>Todays Repairs</h2></td></tr><tr><td>Tag</td><td>Entry Date</td><td>Make</td><td>Model</td><td>Work Info</td></tr>"; ////////////TODAYS WORK & BUILDS////////////////////////////////////////// //get today's start stamp $begin = time(); $begin_day = mktime(0, 0, 0, date('m', $begin),date('d', $begin),date('Y', $begin)); $query2 = "SELECT * FROM $table4 WHERE est_completion='$begin_day' ORDER BY rid ASC"; $result2 = mysql_db_query ($dbname, $query2, $link); $row_number = "1"; while($row2 = mysql_fetch_array($result2)){ $row_color = ($row_count % 2) ? $color1 : $color2; if ($row2[closed] != "yes"){ $row_color = $color_open; } $bid = $row2[bid]; $cid = $row2[cid]; //see if there is a part on order $query8 = "SELECT status FROM $table5 WHERE cid='$cid' AND rid='$row2[rid]'"; $result8 = mysql_db_query ($dbname, $query8, $link); $row8 = mysql_fetch_array($result8); if ($row8[status] == "0"){ $row_color = $color_order; } if ($row8[status] == "1"){ $row_color = $color_ship; } //get bike info $query3 = "SELECT * FROM $table3 WHERE bid='$bid' LIMIT 1"; $result3 = mysql_db_query ($dbname, $query3, $link); $row3 = mysql_fetch_array($result3); //get ticket id number $query13 = "SELECT tid FROM $table12 WHERE rid='$row2[rid]'"; $result13 = mysql_db_query ($dbname, $query13, $link); $row13 = mysql_fetch_array($result13); if ($row13[tid]==""){ $tid="0"; }else{ $tid=$row13[tid]; } //format date $origin_date = date("F d, Y", $row2[origin_date]); //capitalize first letters in strings $make = ucfirst($row3[brand]); $model = ucfirst($row3[model]); $work = ucfirst($row2[work_needed]); $mes1 = "<tr><td><b>$tid</b></td><td>$origin_date</td><td>$make</td><td>$model</td><td>$work</td></tr>"; //print out the work information $work_order = "<b>Work Order:</b> $row2[work_needed]"; $extra_info = "<b>Extra Information:</b> $row2[work_extra_info]"; $orig = date("D F d, Y", $row2[origin_date]); $origin_date = "<b>Origin Date:</b> $orig"; $sign_in_person = "<b>Sign-In Person:</b> $row2[est_person]"; $mes10 = "<tr><td></td><td colspan=\"4\">$work_order<br>$extra_info<br>$origin_date<br>$sign_in_date</td></tr>"; $row_count++; $row_number++; $message = $message . $mes1 . $mes10; } $mes2 = "<tr><td colspan=\"5\"><h2>Todays Bike Builds</h2></td></tr><tr><td>No.</td><td>Frame Size</td><td>Make</td><td>Model</td><td>Serial Number</td></tr>"; $message = $message . $mes2; //begin displaying build orders in table $query11 = "SELECT sid FROM $table6a WHERE build_date='$begin_day' ORDER BY sid ASC"; $result11 = mysql_db_query ($dbname, $query11, $link); $row_number = "1"; while($row11 = mysql_fetch_array($result11)){ $row_color = $color_build; //get bike info $query12 = "SELECT * FROM $table9 WHERE sid='$row11[sid]' LIMIT 1"; $result12 = mysql_db_query ($dbname, $query12, $link); $row12 = mysql_fetch_array($result12); $mes3 = "<tr><td>$row_number</td><td>$row12[frame_size]</td><td>$row12[make]</td><td>$row12[model]</td><td>$row12[serial]</td></tr>"; $row_number++; $message = $message . $mes3; } $mes4 = "</table><BR><BR><BR></td></tr><tr><td valign=\"top\" width=\"100%\"><table width=\"100%\" border=\"1\"><tr><td colspan=\"5\"><h2>Overdue Repairs</h2></td></tr><tr><td>Tag</td><td>Entry Date</td><td>Make</td><td>Model</td><td>Work Info</td></tr>"; $message = $message . $mes4; //////////////////OVERDUE WORK////////////////////////////////////// //get today's start stamp $begin = time(); $begin_day = mktime(0, 0, 0, date('m', $begin),date('d', $begin),date('Y', $begin)); $query4 = "SELECT * FROM $table4 WHERE est_completion<'$begin_day' AND closed!='yes' ORDER BY rid ASC"; $result4 = mysql_db_query ($dbname, $query4, $link); $row_number = "1"; while($row4 = mysql_fetch_array($result4)){ $row_color = ($row_count % 2) ? $color1 : $color2; $bid = $row4[bid]; $cid = $row4[cid]; //see if there is a part on order $query9 = "SELECT status FROM $table5 WHERE cid='$cid' AND rid='$row4[rid]'"; $result9 = mysql_db_query ($dbname, $query9, $link); $row9 = mysql_fetch_array($result9); if ($row9[status] == "0"){ $row_color = $color_order; } if ($row9[status] == "1"){ $row_color = $color_ship; } //get bike info $query5 = "SELECT * FROM $table3 WHERE bid='$bid' LIMIT 1"; $result5 = mysql_db_query ($dbname, $query5, $link); $row5 = mysql_fetch_array($result5); //get ticket id number $query14 = "SELECT tid FROM $table12 WHERE rid='$row4[rid]'"; $result14 = mysql_db_query ($dbname, $query14, $link); $row14 = mysql_fetch_array($result14); if ($row14[tid]==""){ $tid="0"; }else{ $tid=$row14[tid]; } //format date $origin_date = date("F d, Y", $row4[origin_date]); //capitalize first letters $make = ucfirst($row5[brand]); $model = ucfirst($row5[model]); $work = ucfirst($row4[work_needed]); $mes5 = "<tr><td><b>$tid</b>></td><td>$origin_date</td><td>$make</td><td>$model</td><td>$work</td></tr>"; //print out the work information $work_order = "<b>Work Order:</b> $row5[work_needed]"; $extra_info = "<b>Extra Information:</b> $row5[work_extra_info]"; $orig = date("D F d, Y", $row5[origin_date]); $origin_date = "<b>Origin Date:</b> $orig"; $sign_in_person = "<b>Sign-In Person:</b> $row5[est_person]"; $mes6 = "<tr><td></td><td colspan=\"4\">$work_order<br>$extra_info<br>$origin_date<br>$sign_in_date</td></tr>"; $row_count++; $row_number++; $mes6 = $mes5 . $mes6; $message = $message . $mes6; } $mes7 = "<tr><td colspan=\"5\"><h2>Overdue Bike Builds</h2></td></tr><tr><td>No.</td><td>Frame Size</td><td>Make</td><td>Model</td><td>Serial Number</td></tr>"; $message = $message . $mes7; //begin displaying build orders in table $query11 = "SELECT sid FROM $table6a WHERE build_date<'$begin_day' ORDER BY sid ASC"; $result11 = mysql_db_query ($dbname, $query11, $link); $row_number = "1"; while($row11 = mysql_fetch_array($result11)){ $row_color = $color_build; //get bike info $query12 = "SELECT * FROM $table9 WHERE sid='$row11[sid]' LIMIT 1"; $result12 = mysql_db_query ($dbname, $query12, $link); $row12 = mysql_fetch_array($result12); $mes8 = "<tr><td>$row_number</td><td>$row12[frame_size]</td><td>$row12[make]</td><td >$row12[model]</td><td>$row12[serial]</td></tr>"; $row_number++; $message = $message . $mes8; } $mes9 = "</table></body></html>"; $message = $message . $mes9; //send the actual e-mail $to = "recipient"; $subject = "Repair Machine Schedule for $cur_date"; $body = $message; mail($to, $subject, $message, "To: Bicyle Retailer <shop address>\n" . "From: Repair Machine <server>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); ?>
  23. Thanks for the suggestion with the code pushed to the left. I dave it a shot, but as I suspected, it didn't work. In your case, the whole body is a text string within the quotation marks of a variable. The extra spaces and breaks would do weird things to the data. For me, what I want to be included into the e-mail body is a series of lines of code, not plain text. I"ll keep playing around with that to see if it can do me any good though. Thanks!
  24. My e-mail function is just about the same as yours, and I know that it works. My problem is creating the body of the email in a way that it can be read and sent through a single variable
×
×
  • 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.