Jump to content

computermax2328

Members
  • Posts

    281
  • Joined

  • Last visited

Everything posted by computermax2328

  1. At the top where it says: <?php if (isset($_POST['submitted']) == 1) { if ($_GET['id'] == '') { $q = "INSERT INTO blog (title, date, body) VALUES ('$_POST[title]', '$_POST[date]', '$_POST[body]'"; }else { $q = "UPDATE blog SET title = '$_POST[title]', date = '$_POST[date]', body = '$_POST[body]' WHERE id = '$_POST[id]'"; } $r = mysqli_query($dbc, $q); } ?> I would try !$_GET['id'] in your first if statement. Turn on error reporting while you are still in the developing stage as well.
  2. My bad. Disregard me.... I will go somewhere else
  3. Well to start, both of your if(empty) statements and if(!filter_var) don't have brackets, therefore no argument. They say if this.... and then nothing happens. Doesn't matter if the statement is true or false, the argument does not exist. Also in your query it says WHERE=?. Get rid of the questions mark and the post statement and just put WHERE=$email. You already set the variable. Use the mysql_real_escape_string() all of your POSTs to help prevent mysql injection. Finally, around your query it is mysql_query() not query(). I will keep looking...
  4. Can anyone provide a solution for my problem??
  5. If I am understanding you correctly, you want to know how to reproduce structures with tags such as menus, lists and titles. If I were you I would start with learning the basics of PHP and MYSQL. They kind of run hand in hand. You can learn on YouTube or if you want to do paid online lessons you can try Lynda.com or treehouse.com (I think that is right). Then take the next big step and learn object oriented php aka OOP. I just started learning it recently and it makes object reproduction a lot easier. Also consider learning a framework, Cake php, code igniter, Joomla, WordPress. Feel free to ask around the forum as well.
  6. Hey Everyone, In one of my design classes I am doing some research for something I am designing. I was wondering if some people in the forum could take it to get a broader perspective on it. More than just people at my school. I am just using the information for class, none of your names or other information will be used. The survey just asks about your preferences when it comes to grocery shopping. The link is below. Please, only users who are between the ages of 18-24. Thanks guys, Survey!
  7. Sorry, I thought it would be easy to understand. Code is below. As you can see this is for a joomla template. If you don't have any Joomla experience don't worry about that code, just the divs it lives in. HTML <section id="wrapper"> <section id="left"> <div id="sobox" class="width"> <jdoc:include type="modules" name="FeaturedContent" /> </div> <div id="sobox" class="width"> <jdoc:include type="modules" name="SectionSlide" /> </div> <jdoc:include type="component" /> </section> <section id="right"> <div id="box" class="width"> <div id="rib"> <h3>Follow Quad News</h3> </div> <div id="boxcon"> <div id="sobox" class="width"> <jdoc:include type="modules" name="socialbanner" /> </div> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner1" /> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner2" /> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner3" /> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner4" /> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner5" /> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner6" /> </div> </div> <div id="box" class="mod"> <div id="boxcon"> <jdoc:include type="modules" name="banner7" /> </div> </div> </section> <br style="clear: both;"/> </section> CSS #wrapper { background-color: #f0f0f0; padding: 30px 20px; } /* Article Page right column*/ #right { width: 36%; float: right; background-color: #dbdbdb; margin-top: 20px; } /* Article Page left column*/ #left { width: 60%; float: left; background-color: #ffffff; -moz-box-shadow: 5px 0px 5px #888888; -webkit-box-shadow: 5px 0px 5px #888888; box-shadow: 5px 0px 5px #888888; padding: 20px; } Thanks in advance
  8. Hey! Tough struggles man. Alright I am a little busy right now because I am a student in college, but I have a possible solution for you. First question, do you want all the questions on the same page or do you want a dynamic page for each question? I will be back later to see your answer. This will be a good challenge.
  9. Hey Laura! Welcome to the club! First off, if you look at the text editor that you use to write response in this forum there is a toggle for code. Use that toggle when you want to input code into the forum and it will arrange it so it is easier to read. I will use it below so you can see what it looks like and an admin will probably come through and fix yours. Anyway, it seems that you concatenate your query and you also want to set variables to your $_POST[username] and $_POST[password]. Try something like this.... $user = mysql_real_escape_string($_POST['Username']); $pass = mysql_real_escape_string($_POST['Password']); $sql = "SELECT * FROM client WHERE Username=`$user` AND Password=`$pass` LIMIT 1 "; $query = mysql_query($sql, $connection); The mysql_real_escape_string is going to help prevent mysql injection, so you don't get hacked! Feel free to ask me any more questions.
  10. Hey All, I have two divs, one floats right and the other left, right next to each other. The one of the left has a z-index, is set to absolute positioning, and has a drop shadow on its right edge so it looks like it is over the other column. The problem is that when the left div goes longer than the right it falls out of the wrapper and past the footer. I have a br tag styled with clear both to give the wrapper its height after the two floating divs. Any help with this height problem?? Thanks in advance,
  11. No, but I will. Thanks for the suggestion. Anyone else?
  12. Hi everyone, Does anyone know of any mobile frameworks for web developers to create mobile apps? You know, I have skills in HTML, CSS and php and I want to make a mobile app. I found one today called Phone Gap. It was for HTML5, CSS and Javascript. Obviously, I would rather learn Javascript or jquery before I took java or C++ . Any ideas?
  13. Thanks for getting back to me. One more quick question. I used the technique you showed me above and it worked well, but I was wondering, does it matter if the INSERT columns are not the same as the SELECT columns? The only difference is they have different names. Everything else is the same, storage type and all. Thanks,
  14. You set the body margin to 0px, but not the padding. Set the padding to 0px as well and see what happens. Could be something as small as that. I know some browsers set padding and margins by default.
  15. My roommate got to play the beta today. I have a tip for you, turn back the clock on your computer and it will give you your hour back, so you can keep playing the beta. I don't know what made him think of that but it worked. Second, in some of the trailers I saw that you can buy extra land near your city. Basically you could purchase whole plots, but I don't know if you could expand to that or you would have to build a new city. Someone also pointed out that you can't build agricultural land.
  16. Hello, Welcome to the forum and PHP! Jessica is right, you have your quotations mixed up. When you echo out html you need the proper concatenation and quotation marks. Look up concatenation and learn it because you are going to need it. I tried to skip learning it and work around it, but it will bite you in the ass. Anyway back to your question. So Jessica was also right when she said your radio buttons need names. That is how the process form will figure out what was selected, so something more like this: echo "<input name='$var2' type='radio' value='$var' name='yes'>" . "Yes"; So notice how the two different elements are separated by a period or a concatenation. Also notice that the input is surrounded by double quotes and everything inside that requires quotes has single quotes. If you have any other questions feel free to ask. This is where I learned to code PHP and I am getting a lot better than I was. There are a lot of nice people and great coders in this community.
  17. Hello All, I have a data table with the columns firstname, lastname and rank. I am moving those values from that table into an archive table and the archive table has the same structure, but an additional date on the end. Obviously to tell the different between the repeating values. I have a query like this...... $insert = "INSERT INTO archive (firstname, lastname, rank) VALUES (SELECT firstname, lastname, era FROM old)"; How can I add the mysql command CURDATE() into that insert command? Can I add parentheses inside of the parentheses around the SELECT command?? Thanks in advance??
  18. Thanks that helped alot. Yes, I understand that you are suppose to store a unique ID, but I was unaware of this when I first created this particular site. Something I do regret. Thanks again.
  19. I am new at this. I don't understand your example. Can you help me learn this??
  20. I did subqueires like: $sql="SELECT firstname, lastname, rank FROM archive WHERE firstname=(SELECT 'First Name' FROM politicians AND lastname=(SELECT 'Last Name' FROM politicians) ORDER BY rank"; I do have to get information from the politicians database as well but right now I am just working on getting the information from this one database. Again I need information like this. Joe 1 Sarah 1 Steve 2 Phil 3 Alex 3
  21. Hey, So I am coming back because I tried the subquery and it did not work. To go over the details of my problem again, this is what is going on. I have an archive database with multiple entries of the same value in the database, Example: Joe 1 Joe 2 Sarah 1 Sarah 3 The entries are dated by the date that they were entered. This what I have found out so far. I used SELECT DISTINCT in order to eliminate any other names. Query follows: $sql = "SELECT DISTINCT firstname, lastname FROM archive ORDER BY rank"; So now I am getting all of the name indivually, just Joe and just Sarah, but what I need is for Joe and Sarah to have the ability to have the same number next to their name, so Distinct name but not number. For example: Joe 1 Sarah 1 John 2 Phil 3 Bob 3 Any ideas?
  22. It looks like the 50% that is in that red line is outputting 50% of the image. If you are trying put something over the thumbnail which it looks like you are, absolute position the image, don't make it the background and resize it using CSS height width percents.
  23. The archive table, but the first and last name for both tables are the key between the two. I need some information from the other table.
  24. Hello all, I am working on this query to show past records of data for all of the records in this particular table. This is an archive table so there are multiple entries of the same person in the database. The difference is the date that they were entered, which is an auto entry value added on the date it is uploaded. Here is the query: "SELECT politicians.id, politicians.`Last Name`, politicians.`First Name`, politicians.`District`, archive.`firstname`, archive.`lastname`, archive.rank, archive.era FROM politicians, archive WHERE politicians.`Last Name`=archive.lastname AND politicians.`First Name`=archive.firstname ORDER BY date LIMIT 150"; The problem is that I only need the latest entry from the persons information and I am getting multiple from past dates. They need to be ordered by their past rank, but from the last date of the entry. Any ideas?? P.S I know I already posted this in the applications section. I posted it there by accident
×
×
  • 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.