Jump to content

bassdog65

Members
  • Posts

    37
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

bassdog65's Achievements

Member

Member (2/5)

0

Reputation

  1. here is my code snippet: <div><b>Category Name:</b> <p><input type="radio" name="category" value="existing" <?php if (isset($_POST['category']) && ($_POST['category'] == 'existing') ) echo ' checked="checked"'; ?>/> Existing => <select name="existing"><option>Select One</option> <?php $x = "SELECT category FROM artists"; $y = mysqli_query ($dbc, $x); if (mysqli_num_rows($y) > 0) { while ($row = mysqli_fetch_array ($y, MYSQLI_NUM)) { echo "<option value=\"$row[0]\""; if (isset($_POST['existing']) && ($_POST['existing'] == $row[0]) ) echo ' selected="selected"'; echo ">$row[1]</option>\n"; } } else { echo '<option>Please add a new category.</option>'; } mysqli_close($dbc); ?> </select></p> <p><input type="radio" name="category" value="new" <?php if (isset($_POST['category']) && ($_POST['category'] == 'new') ) echo ' checked="checked"'; ?>/> New => <input type="text" name="category_name" size="20" maxlength="40" value="<?php if (isset($_POST['category_name'])) echo $_POST['category_name']; ?>" /></p> </div> Im trying to give the user the option of picking a category already in the database, or to make a new one. For some reason the result is not displaying in my dropdown when there are already categories in the database. When I run the mySQL query in phpMyAdmin it returns results. What am I missing?
  2. And that is done by putting a background on the wrapper behind the two DIVs that sit on top of it?
  3. Right now I am making a basic layout, haven't put any content in it yet, but in this example, I want the background on the left, the DIV "left" to be 100% of the height that the DIV "right" is set to. I know I have done this before, but I am missing something. <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <title><?php echo (isset($page_title)) ? $page_title : 'Welcome!'; ?></title> <style> body { background-image: url(images/heartland_bg4.jpg); background-repeat:repeat; } div#wrapper { width:900px; margin:auto; } div#innerwrapper { width:900px; height:100%; background-color:silver; overflow:auto; } div#left { width:200px; float:left; background-image:url('images/heartland_side.png'); background-repeat:repeat; } div#right { background-color:red; width:700px; float:left; } </style> </head> <body> <div id="wrapper"> <img src="images/top.png" alt="top" style="display:inline;" /> <div id="innerwrapper"> <div id="left"> <p>Would Be Link #1</p> <p>Would Be Link #2</p> <p>Would Be Link #3</p> <p>Would Be Link #4</p> <p>Would Be Link #5</p> </div> <div id="right"> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> <p>Right</p> </div> </div> <img src="images/bottom.png" alt="bottom" style="display:inline;" /> </div> </body> </html>
  4. wow, would you believe i figured that out RIGHT after i posted on here, and i was going to reply that I'm an idiot? sorry guys, i know if i really had a problem you would have solved it for me.
  5. I know I have dealt with similar issue like this in the past, but I think I am just out of practice. I have dissambled the page I am trying to make to just basic DIVs, and nothing else, to try and solve my problem, and alas, I turn to the experts. I color coded all of the DIVs to show where they are, but they will obviously not have background colors in the final product. The live page can be seen at http://sandbox2.premierw.com/index.php Basically at the bottom of my main DIV, there is an image that needs to hug the bottom of the left and right DIVs, and there is a 1px space between it and the actual DIV. If I was using tables, I would know how to fix it, but I want to avoid that and move into the future by only using CSS, but I am pulling my hair out. Here is the code: <?php $page_title = 'Test'; session_start(); ?> <!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" xml:lang="en" lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title><?php echo (isset($page_title)) ? $page_title : 'Welcome!'; ?></title> <style> body { background-image: url(images/heartland_bg4.jpg); background-repeat:repeat; } .wrapper { width:900px; height:600px; margin:auto; background-color:white; } .innerwrapper { width:900px; height:500px; background-color:silver; } .top { background-color:blue; } .bottom { background-color:fuchsia; } .left { width:200px; height:100%; float:left; background-color:orange; } .right { background-color:red; width:700px; float:right; } </style> </head> <body> <div class="wrapper"> <img src="images/top.png" alt="top" style="display:inline;"> <div class="innerwrapper"> <div class="left"> <p>Left</p> </div> <div class="right"> <p>Right</p> </div> </div> <img src="images/bottom.png" alt="bottom" style="display:inline;"> </div> </body> </html> Help!
  6. great! just because i am not seeing the errors doesn't mean they aren't there. is it saying undefined because i haven't run my handle form yet? two solutions from you in one day. much appreciated.
  7. I have a PHP script for a contact form that I am using on one webserver, and i copied the scripts and all the subfolders to a new webserver and I am getting an undefined index error in my text fields. It is literally line for line the same code, but I am getting the error on the second webserver. Could it be a problem with the version of PHP the second webhost is running? the working code can be seen at: http://www.premiermoviegroup.com/contact/contact_form.php?lid=1 the non working code and the error can be seen at: http://av.premierw.com/contact/contact_form.php?lid=1 I have gone through every single line of code, and even resorted to copy and pasting one script into the other and uploading it, and i still get the undefined index error. *confused*
  8. Hmmmmm, Ken, good point. I guess I am used to calling more than one thing at a time, so i have a stristr so that i can pull any value out of my string. However in this case with one or the other, i see where you are going. I learn so much on here. Thanks to everyone.
  9. premiso! that worked! thanks! I was just confused about what i needed to escape and what i didn't need to. I would be interested to learn if there is a better function i could call in the future for what I am trying to accomplish. I take everything in that i learn on this site and absorb it.
  10. i put the \ in front of the URL because i was trying to escape the second set of quotes, thinking that mgiht have been the problem. it clearly was not, and im sure i can remove those by now. Also the reason for putting \/\/ was because two forward slashes in PHP makes it a comment, so i didnt knwo how else to enter a href. since this is a handle form for another page, i have a location id built into the page based off where the user was sent from. we have one contact page beign shared between both of those domains. if they are coming from farewaymovies.com they go to contact_form.php?lid=1 if they come from premiermoviegroup.com they go to contact_form.php?lid=2 and after they submit the form, i want the handle form to display the link of wherever they came from, so i am trying to pull their location id out of the page and display a link based on that.
  11. what would a better substitute for stristr() be?
  12. <?php // load the variables form address bar $subject = $_REQUEST["subject"]; $main = $_REQUEST["message"]; $from = $_REQUEST["from"]; $verif_box = $_REQUEST["verif_box"]; $name = $_REQUEST["name1"]; $number = $_REQUEST["number"]; // remove the backslashes that normally appears when entering " or ' $main = stripslashes($main); $subject = stripslashes($subject); $from = stripslashes($from); $name = stripslashes($name); $number = stripslashes($number); $main2 = 'Question/Comment: '.$main."\n\n"; $subject2 = 'Subject Line: '.$subject."\n\n"; $from2 = 'Email address entered: '.$from."\n"; $name2 = 'Contact Name: '.$name."\n"; $number2 = 'Phone Number: '.$number."\n"; $message = $subject2.$main2.$name2.$number2.$from2; // check to see if verificaton code was correct if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']){ // if verification code was correct send the message and show this page mail("bassdog65@gmail.com", 'Message from contact form at FarewayMovies.com: ', $message); // delete the cookie so it cannot sent again by refreshing this page setcookie('tntcon',''); } else { // if verification code was incorrect then return to contact page and show error header("Location:".$_SERVER['HTTP_REFERER']."?subject=$subject&from=$from&message=$message&wrong_code=true"); exit; } ?> <!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=iso-8859-1" /> <title>Success!</title> <style> body { background: white url(images/bg5.jpg) repeat-x; font-family: "Trebuchet MS", Rockwell; font-size:14px; } #container { margin: 0 auto; background-color:#5e5e5e; width:500px; height:400px; padding:30px; border: 5px black double; color:white; z-index:auto; } #pagewrapper { margin-top:78px; } #logochoice { float: left; position:absolute; top: 20px; left: 30px; z-index:0; } /* Text Box with Gradient: */ .tb-gradient { border:0; background: transparent url(images/gradient.gif) no-repeat top left; height: 22px; width: 230px; padding-top:2px; } .tb-gradient2 { border:0; background: transparent url(images/gradient2.gif) no-repeat top left; height: 100px; width: 450px; padding-top:0px; } a:link { font-family: "Trebuchet MS", Rockwell; font-size: 14px; color: white; } a:visited { font-family: "Trebuchet MS", Rockwell; font-size: 14px; color: white; } a:hover { color: gray; } </style> </head> <body> <div id="logochoice"> <?php if (isset($_GET['lid'])) { if (stristr($_GET['lid'], '1') == TRUE) { $returnlink = "<a href=\"http:\/\/www.farewaymovies.com/test\">FarewayMovies.com</a>"; echo '<img src="images/FarewayMoviesLogo.png">'; } else { $returnlink = "<a href=\"http:\/\/www.premiermoviegroup.com\">PremierMovieGroup.com</a>"; echo '<img src="images/PMGlogo_med.png">'; } } else { echo 'No location set.'; } ?> </div> <div id="pagewrapper"> <div id="container"> Email sent. Thank you. You will be contacted in 24 hours.<br /> <br /> <p>Return to <?php echo $returnlink;?></p> </div> </div> </body> </html> Its a handle form for a contact us page, to put it in context for you.
  13. yes, later on I simply call this: <p>Return to <?php echo $returnlink;?></p> but instead of one href or the other, it returns: http://www.premiermoviegroup.com////www.farewaymovies.com/test where it should return one or the other based off of the location ID.
  14. I have an IF statement to assign a href to a variable, so i can call the variable later, and for some reason everytime i go to the page, it combines both options for the variable, like teh if statement ran both the if and the else. example: <?php if (isset($_GET['lid'])) { if (stristr($_GET['lid'], '1') == TRUE) { $returnlink = '<a href=\"http:\\/www.farewaymovies.com/test\">FarewayMovies.com</a>'; echo '<img src="images/FarewayMoviesLogo.png">'; } else { $returnlink = '<a href=\"http:\/\/www.premiermoviegroup.com\">PremierMovieGroup.com</a>'; echo '<img src="images/PMGlogo_med.png">'; } } else { echo 'No location set.'; } ?> Basically the end result is that when i call teh $returnlink variable later i get both links combined, instead of one or the other. What am I missing?
  15. I kind of abandoned my effort. I think that I am just going to go about my design a different way. My original need to have the footer stick the to bottom has changed, so I think I'll just leave this one unsolved until it comes up again. I appreciate all the help and the ideas from everyone!
×
×
  • 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.