Jump to content

zang8027

Members
  • Posts

    136
  • Joined

  • Last visited

    Never

Everything posted by zang8027

  1. I have a table set up like the following: ------------------------- comments_table ------------------------- ID | Comment | picID ----------------------------- 1 | lorum ipsum | 54 2 | lorum ipsum | 36 3 | lorum ipsum | 54 If i wanted to find out how many records had the picID of 54, how could i get that? I want the final result to be like: The total number of records is 2. Which of course i can implant easily into php
  2. i never heard of this <<<HTML HTML; thing.. it put it in but now the css is all messed up when do that.. its like..the page does not recognize that html being part of the page its included into. Its there in the view source when i view it though.
  3. I want to put this into an include but.. as you can see, it uses both ' and " so i dont know how to do this. <div id="footer"> <div class="sub-nav"> <a href="index.php" onmouseover="roll('sub_but', 'images/sub-home-btn-over.png')" onmouseout="roll('sub_but', 'images/sub-home-btn.png')"><img src="images/sub-home-btn.png" alt="home" name="sub_but"/></a> So i cant really do: <?php echo' <div id="footer"> <div class="sub-nav"> <a href="index.php" onmouseover="roll('sub_but', 'images/sub-home-btn-over.png')" onmouseout="roll('sub_but', 'images/sub-home-btn.png')"><img src="images/sub-home-btn.png" alt="home" name="sub_but"/></a> '; ?> Any suggestions?
  4. i was able to fix it by floating those img tags left
  5. I have 4 images side by side and i want them to bump right up against each other but for some reason, even though i have padding:0 margin:0, they still have a margin. <div id="footer"> <a href="index.php" onmouseover="roll('sub_but', 'images/sub-home-btn-over.png')" onmouseout="roll('sub_but', 'images/sub-home-btn.png')"><img src="images/sub-home-btn.png" alt="home" name="sub_but"/></a> <a href="pieces.php" onmouseover="roll('sub_but2', 'images/sub-pieces-btn-over.png')" onmouseout="roll('sub_but2', 'images/sub-pieces-btn.png')"><img src="images/sub-pieces-btn.png" alt="pieces" name="sub_but2"/></a> <a href="resume.php"><img src="images/sub-resume-btn.png" alt="resume"/></a> <a href="contact.php"><img src="images/sub-contact-btn.png" alt="contact"/></a> * { margin: 0; padding: 0; font-family: Arial, sans-serif; border: 0px; }
  6. is there away to fade in a flash swf over a browser, play it, then disappear? I see things like these on sites, but it may just be a flash swf opening with a transparent background. What we dont want is to embed it. Rather, when the page loads, the animation fades up, plays, then fades out. Hard to find an example... more and more ads do this now a days.
  7. I got a php file called nav.php with the following code: <?php function navigation($home, $resume, $port, $contact) { echo ' <ul> <li><a href="index/"><img src="images/$home.png" alt="Home Page" /></a></li> <li><a href="resume/"><img src="images/$resume.png" alt="Resume" /></a></li> <li><a href="portfolio/"><img src="images/$port.png" alt="Portfolio Pieces" /></a></li> <li><a href="contact/"><img src="images/$contact.png" alt="Contact" /></a></li> </ul> '; } ?> Then, in my main file, i am using require_once 'nav.php';. Then, i am calling the function navigation("homeBtn", "resumeBtn", "portBtn", "contactBtn); I am getting $contact.png etc.. instead of contactBtn so it acts like its not accepting my params. Any idea?
  8. Well, I have a website now but I want to redesign it. I want to show that I am more into code, rather than graphic design.. most especially Actionscript. I came up with an awesome idea (at least i think so haah) and started designing it. I need some suggestions. Critique it and give me some criticism.
  9. i got it to pop up.. but it still stacking the div for some reason..
  10. A client sent me a site that he designed in Microsoft word 97 (lol.. ) and wanted me to code it and add a background. So I did. www.attractunlimitedleads.com Now, if you scroll down to the bottom of the page, there is a form. Now, i set up the form like such: (sorry if the formatting sucks.. copying and pasting will probably lose it) <div id="aweberForm"> <form action="http://www.aweber.com/scripts/addlead.pl" method="post"> <div class="labelDiv">E-Mail:</div> <div class="inputDiv"><input class="boxs" type="text" name="from"></div> <div class="labelDiv">Name:</div> <div class="inputDiv"><input class="boxs" type="text" name="name"></div> <div id="bottomForm"> <input type="submit" value="Subscribe"> <strong><p>Please Include Valid Contact Information<br></strong> Your contact Information will never be sold or shared with anyone. <br> You can opt out at ANY time</p> </div> </form> </div> My css is: #aweberForm { width: 670px; height: auto; border: 1px #ccc solid; margin: 0 auto; } .labelDiv { width: 155px; float: left; background: #fff; text-align: right; padding-right: .1em; border: 1px #ccc solid; padding: .2em; font-family: "Times new roman", times, serif; } .inputDiv { width:510px; background: #ffffe0; border: 1px #ccc solid; clear: both; padding: .2em; } #bottomForm { background: #8799cc; text-align: center; padding: .2em; } Now, the div 's that hold the input I would like to float beside the name ones. But as you can tell, that is not working. They are stacking on eachother too. If i remove the clear:both on the input div, my label divs show up as being inside the input div... which from what I can tell, is not. Try messing around if you have firefox developer toolbar.. take out the clear:both and see what happens.
  11. forgot to mention "quan" is the input box i have and the if statement works..
  12. is there a way to set a variable inside html quotes? <form onsubmit="validateIt()"> I want like <input type='text' name='amount_1' value='javascript variable' /> and on submit of the form, i want to set that variable in a function function validateIt() { var quan= document.getElementById('fname'); var amount = document.getElementByName('amount_1'); var howMany = document.getElementByName('quantity_1'); if(quan.value>=0) { if(quan.value<=1000) { amount.value="0.19"; howMany.value=quan.value; } } if(quan.value>=1001) { if(quan.value<=5000) { amount.value="0.18"; howMany.value=quan.value; } } if(quan.value>=5001) { if(quan.value<=10000) { amount.value="0.17"; howMany.value=quan.value; } } } </script>
  13. ok i added it to the <form> but i am still not getting an alert.. should i get it when i click the button? <form name="paypalForm" target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post" onsubmit="validateIt()">
  14. my onsubmit is not firing <form name="paypalForm" action="paypal.com" method="post"> <input type="text" name="quantity" value="type your quantity" onsubmit="validateIt()" onfocus="clearVal" /> <script> function validateIt() { var quan= document.paypalForm.quantity.value; if(quan>=0) { if(quan<=1000) { alert("The price is 19 cents"); } } else if(quan>=1001) { if(quan<=5000) { alert("The price is 18 cents"); } } else if(quan>=5001) { if(quan<=10000) { alert("The price is 17 cents"); } } } </script>
  15. http://www.tendertouchtowels.com/pricing/index.php? If you go to that page, you will see a textbox with the default value of "Please enter your quantity here". When you click in the box, it removes it and allows you to type the next value. When you type a value, click out of the box and look at your url change to add ?quan=1251 (or whatever you entered) The reason i have this is because i have a simple php if statement that pulls the parameter "quan" from the url, checks to see if its between 0-1000, 1001-5000, or 5001-10000 +. Now, you can see the problem is that this forces the user to click out of the box in order for it to accept the value. I tried using onkeyup but thats buggy because if you are a slow typer or whatnot, it fires the on key up as soon as you type the first number. Header js functions for clearing text on click and adding param <script type="text/javascript"> function upperCase(x) { var y=document.getElementById(x).value; self.location='index.php?quan=' + y ; } </script> <script> function clearText(theField) { if (theField.defaultValue == theField.value) theField.value = ''; } </script> The form <!-- Form goes here --> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type='hidden' name='cmd' value='_cart' /> <input type="hidden" name="business" value="$email" /> <input type="hidden" name="upload" value="1" /> <input type="hidden" name="lc" value="US" /> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="item_name_1" value="Tender Touch Towels" /> <?php //recieve the passed amount $amount = $_REQUEST['quan']; if(isset($_REQUEST['quan'])){ if($amount > 0) { if($amount <= 1000) { echo '<input type="hidden" name="quantity_1" value="'.$amount.'" />'; echo '<input type="hidden" name="amount_1" value="0.19">'; } } if($amount >=1001) { if($amount <=5000) { //post form to paypal with $amount and 0.18 echo '<input type="hidden" name="quantity_1" value="'.$amount.'" />'; echo '<input type="hidden" name="amount_1" value="0.18">'; } } if($amount >=5001) { if($amount <=10000) { //post form to paypal with $amount and 0.17 echo '<input type="hidden" name="quantity_1" value="'.$amount.'" />'; echo '<input type="hidden" name="amount_1" value="0.17">'; } } } ?> <input id="fname" class="price_box" value="<?php if(isset($_REQUEST['quan'])){$quan=$_GET['quan'];echo "$quan";}else{echo "Type your quantity here...";}?>" onblur="upperCase(this.id)" onfocus="clearText(this)"> <input type="submit" class="order_button"> </form> Is there a better way to do this? I tried a php processing page but how can i send these hidden inputs for paypal from a processing page? Wouldn't i need to manually do it via button
  16. i got this working. When the user types in the box and clicks out of it, the url changes to add ?quan=[whatever they entered] But when it refreshes, the input box resets to the default value. Is there a way that when it refreshes, the value will now equal whatever quan=? <script type="text/javascript"> function upperCase(x) { var y=document.getElementById(x).value; self.location='index.php?quan=' + y ; } </script> <?php include('../includes/head2.php') ?> <div id="promo"> <h1>Order in bulk, and save some cash!</h1> <p>When you order a quantity of 500 or more, we'll pay your shipping and handling for you, as a token of our appreciation!</p> </div> </div> <div id="middle"> <div id="inside"> <h2>Pricing and Order Info</h2> <div class="price1"> <img src="../images/order.gif"/><br/> <!-- Form goes here --> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type='hidden' name='cmd' value='_cart' /> <input type="hidden" name="business" value="john@leaderexcelsolutions.com" /> <input type="hidden" name="upload" value="1" /> <input type="hidden" name="lc" value="US" /> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="item_name_1" value="Tender Touch Towels" /> <?php //recieve the passed amount $amount = $_REQUEST['quan']; if(isset($_REQUEST['quan'])){ if($amount > 0) { if($amount <= 1000) { echo '<input type="hidden" name="quantity_1" value="'.$amount.'" />'; echo '<input type="hidden" name="amount_1" value="0.19">'; } } if($amount >=1001) { if($amount <=5000) { //post form to paypal with $amount and 0.18 echo '<input type="hidden" name="quantity_1" value="'.$amount.'" />'; echo '<input type="hidden" name="amount_1" value="0.18">'; } } if($amount >=5001) { if($amount <=10000) { //post form to paypal with $amount and 0.17 echo '<input type="hidden" name="quantity_1" value="'.$amount.'" />'; echo '<input type="hidden" name="amount_1" value="0.17">'; } } } ?> <input id="fname" class="price_box" value="So, how many would you like?" onchange="upperCase(this.id)">
  17. anyone see why this is not working? Its supposed to take whatever is entered into the input and put it in the url <SCRIPT language="JavaScript"> function reload(form) { var val=form.quan.value; self.location='towels.php?quan=' + val ; } </script> </head> <body> <? echo "Quantity: <input name='quan' type='text' onkeyup='reload(this.form)'>"; ?>
  18. well i need to change the amount attribute.. im not sure on this at all.. any where i can see an example of this?
  19. may be as simple as adding params to the url with ajax like ?amount=1301 and i can use php to capture that
  20. using an input box with the name "amount", can i check to see when the user inputs? I want to have an input form, and when the user enters the type, it to be checked, and if it is between 0-1000, send a form to paypal... if its 1001-5000, send a different form to paypal.. etc any ideas? I tried using php and got this so far: //recieve the passed amount $amount = $_GET['amount']; $productName = "Tender Touch Towels"; if($amount > 0) { if($amount <= 1000) { echo ' <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="business" value="john@leaderexcelsolutions.com" /> <input type="hidden" name="upload" value="1" /> <input type="hidden" name="lc" value="US" /> <input type="hidden" name="custom" value="3" /> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="item_name_1" value="$productName" /> <input type="hidden" name="quantity_1" value="$amount" /> <input type="hidden" name="amount_1" value="0.19"> </form> '; } } elseif($amount >=1001) { if($amount <=5000) { //post form to paypal with $amount and 0.18 echo ' <input type="hidden" name="quantity_1" value="$amount" /> <input type="hidden" name="amount_1" value="0.18"> '; } } elseif($amount >=5001) { if($amount <=10000) { //post form to paypal with $amount and 0.17 echo ' <input type="hidden" name="quantity_1" value="$amount" /> <input type="hidden" name="amount_1" value="0.17"> '; } } ?> but php wont work to check what is inputed :-/
  21. I have an input box called "amount". When the user enters the amount, i need to check what that amount is and send it to paypal. I have three if statements that send the proper amount to paypal: <html> <head></head> <body> <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> AMOUNT: <input type='text' name='amount'/> <input type="hidden" name="business" value="john@lns.com" /> <input type="hidden" name="upload" value="1" /> <input type="hidden" name="lc" value="US" /> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="item_name_1" value="$productName" /> <?php //recieve the passed amount $amount = $_POST['amount']; $productName = "Tender Touch Towels"; if($amount > 0) { if($amount <= 1000) { echo ' <input type="hidden" name="quantity_1" value="$amount" /> <input type="hidden" name="amount_1" value="0.19"> '; } } elseif($amount >=1001) { if($amount <=5000) { //post form to paypal with $amount and 0.18 echo ' <input type="hidden" name="quantity_1" value="$amount" /> <input type="hidden" name="amount_1" value="0.18"> '; } } elseif($amount >=5001) { if($amount <=10000) { //post form to paypal with $amount and 0.17 echo ' <input type="hidden" name="quantity_1" value="$amount" /> <input type="hidden" name="amount_1" value="0.18"> '; } } ?> <input type="submit" value="submit" /> </form> </body></html> now without sending this form to a process page and then sending it to paypal, how can i check to see what the user inputed for amount.
  22. <?php //grab variables being passed and put them into usable variables $name = $_GET['uName']; $email = $_GET['email']; $text = $_GET['uMsg']; //Validate each field for being blank or wrong character if($_GET['uName'] == "") { header("Location:contact.php?error='noName'"); } elseif($_GET['email'] == "") { header("Location:contact.php?error='noEmail'"); } elseif($_GET['uMsg'] == "") { header("Location:contact.php?error='noText'"); } elseif(!preg_match( "/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $email)) { header("Location:contact.php?error='invalid'"); }else{ //If all checks out, send the email //------------------Email----------------- //define the receiver of the email $to = "ty@leaderexcelsolutions.com"; //define the subject of the email $subject = 'A message from'.$name.'via www.GregSReed.com'; //define the message to be sent. Each line should be separated with \n nl2br($EmailBody = $text); $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; $date = date("m/d/Y H:i:s"); $EmailFooter = "<br />Sent: $date<br /><br />"; $Message = $EmailBody.$EmailFooter; $ok = mail($to, $subject, $Message, $headers . "From:$name <".$to.">"); if($ok){ header("Location:contact.php?status=Success"); }else{ } } //End the else all validated ?> <?php include('header.php') ?> <div id='contact'> <?php if(isset($_GET['status'])) { if($_GET['status'] == 'success') { print "<h2>Success! Your message was sent.</h2>"; } } ?> <p class='yellowText'>Got a question or comment? Simply fill out the form below!</p> <form action='processEmail.php' method='get'> <p>Your Name * <?php if(isset($_GET['error'])) { if($_GET['error'] == 'noName') { print "<span class='redText'>You must enter a name</span>"; } } ?></p> <input type='text' name='uName' class='for'/> <p>Your Email * <?php if(isset($_GET['error'])) { if($_GET['error'] == 'noEmail') { echo "<span class='redText'>You must enter an email</span>"; } elseif($_GET['error'] =='invalid') { echo "<span class='redText'>You must enter a valid email</span>"; } } ?></p> <input type='text' name='email' class='for' /> <p>Type a Message * <?php if(isset($_GET['error'])) { if($_GET['error'] == 'noComment') { echo "<span class='redText'>You must enter a Message</span>"; } } ?></p> <textarea name='uMsg' class='for'></textarea> <br/> <br/> <input type='submit' value='Send it!'/> </form> </div> <?php include('footer.php') ?>
  23. I fixed one problem... im dumb... my process page was copied from another one i made and the validation was wrong I still am not seeing the text though in my if statements
  24. http://gregsreid.com/contact.php?error='noName' thats what im getting via url if i dont add the name
×
×
  • 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.