Jump to content

fastsol

Moderators
  • Posts

    827
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by fastsol

  1. Are these 2 forms on the same page? You have the first form posting back to the same page it's on and the second form posting to a different page. If the intention is to fill out the first form and submit it, then fill out the second form and submit that to the other page then you need to grab the $_GET vars form the url after the first submit and put them in the hidden fields of the second form. <input name="category" type="hidden" value="<?php echo (isset($_GET['List1'])) ? $_GET['List1'] : ''; ?>"/> <input name="first_subcategory" type="hidden" value="<?php echo (isset($_GET['List2'])) ? $_GET['List2'] : ''; ?>" /> <input name="second_subcategory" type="hidden" value="<?php echo (isset($_GET['List3'])) ? $_GET['List3'] : ''; ?>"/>
  2. I think will be rather difficult to achieve by just blindly scanning pages. You would need to use some regex to only grab things within certain html tags most likely and even that will be limited if these sites are built dynamically cause the info won't be on the page as it's scanned. My 2 cents.
  3. Give the form submit button a specific name for the form in question then just check for that in the POST. if(isset($_POST['registration_button'])) // change registration_button to the name you give the button in your html { //connect to SOAP }
  4. I didn't read through your code but based on your questions this might be of some help http://amecms.com/article/Retaining-Drop-down-Selection-After-Form-Submit
  5. I have a tutorial on this http://amecms.com/article/Building-Chained-Select-Boxes-with-Jquery-and-PHP
  6. Use the $_SESSION array. You'll also need a session_start(); at the very top of the code for the page. I would imagine that wordpress already has that in the code but I have not used wordpress so I could be wrong.
  7. A cron job is the way to go on this. You can google it for the type of server configuration you have and find out how to set it up. Then in the php file you have the cron run, just use some simple queries to gather the in info and send out mail() in the format you want. You would use a WHERE clause in the query to only gather the records that are within the expire time frame you want. How the WHERE clause will look depends on the how you are storing the expire date in the db and what format it is.
  8. We'll probably need your full code as to how you are building the text fields and the javascript you're using to make those too. Usually you don't use foreach loops on text fields but rather checkboxes or radio buttons. Why are you thinking you need to use a foreach loop on them? Can you explain your situation in more depth please so we can understand and post the rest of the relevant code.
  9. Your example would make them need to update it in the next 3 years cause it would need to change to 202 in your code. Granted it's not unlikely that it won't need to be updated in some way before then anyway but it's always best to code it in a way that you don't need to update it for something so trivial.
  10. Something like this <?php $current_year = date("Y"); $range = range($current_year, ($current_year + 4)); echo '<select name="year" id="contact-year" tabindex="7">'; //Now we use a foreach loop and build the option tags foreach($range as $r) { echo '<option value="'.$r.'">'.$r.'</option>'; } //Echo the closing select tag echo '</select>'; ?> This will start the list with the current year and add 4 year to it.
  11. Here's a tutorial on how to setup the page hit counter. http://www.youtube.com/playlist?list=PLD527AE17B0A9F1F1 Then you can do some simple queries to get the top 5 highest views.
  12. Umm what's the question? You can't just post code with not explanation of what your issue is and expect people to do anything to help you.
  13. Here is a good tutorial on the "multiple" attribute and how to iterate through multiple file uploads the correct way. http://www.youtube.com/playlist?list=PL7413DDD1EB6A14BD
  14. Check out Alex on youtube.com/phpacademy I learned a tremendous amount from him when I started php. He is easy to follow and understand and uses real world examples on things. Just make sure to use tutorials from his more recent videos. There are duplicate concepts of videos but they'll be labeled new or something to get you to the newer better coded stuff.
  15. It's usually best to declare a var that you will be adding onto before you try to add on to it. The error is coming because the script sees that you are trying to add on to the var using the .= way but you haven't previously declared a value for that var. $string_extracredit = ''; $query_extracredit = "SELECT title, points FROM $section WHERE oasis_id='$oasis_id' && extracredit='1' ORDER BY date ASC"; $result_extracredit = mysql_query($query_extracredit) or die('Error, query failed'); if (mysql_num_rows($result_extracredit) > 0) { while(list($extracredit_title, $extracredit_points) = mysql_fetch_array($result_extracredit)) $string_extracredit .= "".$extracredit_title.": ".$extracredit_points." Points<br/>"; } echo "$string_extracredit";
  16. Pretty sure you need to put the db link in the first parameter of the query call $sqlresult = mysqli_query($mydb, $sql); Or maybe $sqlresult = mysqli_query($myconn, $sql);
  17. Check out this tutorial series http://www.youtube.com/playlist?list=PL1A88F9FF46F82198
  18. You can make a simple backoffice scenario just as easy with a db, if not easier than with flat files. A secure login system is much harder to achieve with out a db. Is there a specific reason you don't want to use a db? You could use a prebuilt system like wordpress if you just need simple blog posting and file editing.
  19. Google has a php class that is used for this http://code.google.com/p/php-mobile-detect/
  20. $id = (int)$_GET['id']; // This is jsut an example using a GET var from the url. $query = $dbh->query("SELECT `user` FROM `$table` WHERE `ID` = $id"); $result = $query->fetch(PDO::FETCH_ASSOC);
  21. You need to turn on error_reporting so you can see why it's doing this. First thing I see is you are missing a ; at the end of the mysql_connect line.
  22. This whole thing is rittled with issues and errors. I'm not really sure where to tell you to start cause the whole thing needs to be rewritten. I guess to help with the image upload take a look at this tutorial series to understand how to do that. http://www.youtube.com/playlist?list=PL10C2E583722F66E7
  23. Well first off you haven't shown us enough code to really understand how your system is working. Second, you need to use the $_FILES array to deal with file uploads, $_POST doesn't hold that info in any way. Is the print for the image on the same page as the processing for the form?
  24. Well you had a number of html errors that I fixed. I did not experience the issue you are having, even loading your code as it was. One issue in the php for sure was that you were trying to check for submit even though you didn't have a form field named "submit", you had the submit button named "login". So I changed that too. At this moment I don't get any specific errors with this fixed code, although it's not really coded very well, but I'm not going to recode the whole thing. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR...l1-strict.dtd"> <!-- --> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="keywords" content="" /> <meta name="description" content="" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>Yakity Yak</title> <link href='http://fonts.googlea...=Oswald:400,300' rel='stylesheet' type='text/css'/> <link href='http://fonts.googlea...css?family=Abel|Satisfy' rel='stylesheet' type='text/css'/> <link href="style.css" rel="stylesheet" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <p><!-- end #header --></p> <div id="header" class="container"> <div id="logo"> <h1><a href="#">Yakity Yak</a></h1> </div> <div id="menu"> <ul> <li class="current_page_item"><a href="file:///D:/blackpolish/index.html">Homepage</a></li> <li><a href="file:///D:/blackpolish/trip.html">Destinations</a></li> <li><a href="file:///D:/blackpolish/Contact.html">contact </a></li> <li><a href="file:///D:/blackpolish/login.html">Login</a></li> <li><a href="#">Leader</a></li> <li></li> <li></li> </ul> </div> </div> <blockquote> <blockquote> <p> <center><img src="sd.jpg" width="999" height="300" alt=""/></center> </p> </blockquote> </blockquote> <div id="page"> <div class="post"> <h2 class="title"><a href="#">Welcome to Yakity yak club</a></h2> <form method='post' action='login.php'> <table width='400' border='5' align='CENTER'> <tr> <td><h1>Login</h1></td> </tr> <tr> <td>User Name:</td> <td><input type='text' name='name'/></td> </tr> <tr> <td>Password:</td> <td><input type='password' name='pass'/></td> </tr> <tr> <td>Email:</td> <td><input type='text' name='email'/></td> </tr> <tr> <td><input type='submit' name='login' value='login'/></td> </tr> </table> </form> <div class="entry"> </div> </div> </div> </div> </body> </html> <?php $connect=mysql_connect("localhost","root",""); $db_selected = mysql_select_db("users_db", $connect); if(isset($_POST['login'])){ $users_name = $_POST['name']; $users_pass = $_POST['pass']; $users_email = $_POST['email']; if($users_name==''){ echo "<script>alert('Please enter your Username')</script>"; exit(); } if($users_pass==''){ echo "<script>alert('Please enter your password')</script>"; exit(); } if($users_email==''){ echo "<script>alert('Please enter your email')</script>"; exit(); } $check_email="select*from users where users_email='$users_email'"; $run = mysql_query($check_email) or die(mysql_error()); if(mysql_num_rows($run)>0){ echo"<script>alert('Email $users_email is already exist in our databse, please try another one')</script>"; exit(); } $query = "insert into users (users_name,users_pass,users_email) values('$users_name','$users_pass','$users_email')"; { $result = mysql_query($query) or die(mysql_error()); } echo"<script>alert window.open('','_self')</script>"; } ?>
  25. You have all your php processing after the closing </body> and </html>
×
×
  • 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.