Jump to content

floridaflatlander

Members
  • Posts

    671
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by floridaflatlander

  1. I have a mysql table of items and was wondering if it would be to confusing to combine the columns used for the different “non-repeating info” that items had. Instead of having columns for the number of bathrooms, boat length, rv length and camper length have one column called something like num1. I've always heard that you should name columns in a way that associates with the column info, but if I combine columns I just have to add 18 columns, if I don't combine them I have to add 50 plus columns. Or .. even though the data is non repeating go ahead and make tables for the info for realestate, boats, autos, rv's and on and on. Just looking for some ideas Thanks
  2. Are php user defined functions defined/redefined every time a page loads? I have a functions page and function_exist() tells me the function is redefined every time I load a page. Is this correct, is this the nature of the beast that the functions will be redefined each time the function.inc file is used? When they(books) say remember, are they taking about a page that uses the function.inc file 2,3,4 5 times? Thanks
  3. Yes,I just copied and pasted and should use mysqli if at all posssible.
  4. Well you already have this "$num=mysql_num_rows($results);" with the LIMIT 4 and because the data is returned in rows I use $row = mysql_fetch_array($results); Then $sql = "SELECT * FROM cards ORDER BY RAND() LIMIT 4"; $results = mysql_query($sql); if ($r && (mysqli_num_rows($r) >= 1)) { // run if there is data while ($row = mysqli_fetch_array($results, MYSQLI_ASSOC)){ echo '<a href="card.php?cardid=' . $row['id'] . '">' .$row['name'].'</a>'; echo "</br>"; } } else {echo 'Something or nothing here';}
  5. This is common, where do you define subject & detail at? You could do something like if (isset($detail) {$message = "$detail";} which looks better or up at the beginning of the file put something like $subject = $detail = FALSE;
  6. The single quotes may be his issue, I just copied and pasted his code, changed the title & message and did't see that. But as I under stand it, $meil2 is a variable like $to so it should be ... mail("$meil2","VELEC 2012, Resgister succced! $datav","From: info@velec.com"); or mail("$meil2","Test Title", "Test Body", "From: info@velec.com"); Hey Katyna, before you do all this change your code to mail("$meil2","VELEC 2012, Resgister succced!","{$datav}","From: info@velec.com"); mail("$jobmeil2","VELEC 2012, Register succed!","{$datav}","From: info@velec.com"); and see what happens
  7. I don't understand what this is "UID - This is auto increment UID UserId Name Time" Anyway, I usually run a query and if a certain value is already present in a column or in a column with a user id of xx I wont enter the data. Also if you verify your data and your form wont process with out the info being filled out you maybe able to reset a value to false after the info is entered. Then it wont be entered again.
  8. "php mail function dont accept variable names in the '$to' parameter??" Yes it does, I use it. For testing, try hard coding dummy values and/or get rid of one of the parameters. If the simple hard code works it may mean that your format is wrong. mail('$meil2',"VELEC 2012, Resgister succced! $datav","From: info@velec.com"); or mail('$meil2',"Test Title", "Test Body", "From: info@velec.com");
  9. You don't define it until you click submit then the value is POSTED to $myTextbox = $_POST['myTextbox']; Also put your php code in if (isset($_POST['submit'])) { // this name must match your form input name at <input type = 'submit' name = 'submit'/> $myTextbox = $_POST['myTextbox']; if(isset($myTextbox)&&!empty($myTextbox)){ echo 'You Typed: '.$myTextbox; } } as you play more put the footer under the echo and under the footer place exit() to stop the script.
  10. I must be missing something, your form is sending it to send_mail.php Do you have exit()'s on redirects in send_mail.php
  11. Also it's a good habit to use exit() after all your redirects, this stops the script from running. header( "Location: $feedback_page" ); exit; header( "Location: $thankyou_page" ); exit; and on and on
  12. Either enter your URL here http://validator.w3.org/ or copy and paste the source code and if there is an issue it will tell you. If you don't get an answer do the same with your css here http://jigsaw.w3.org/css-validator/ Be careful of extra brackets left in your css while editing. Is this with ie 7/8 or 9?
  13. Here's a quick poor mans way to do what I think you're doing. if(isset($_POST['submitted'])){ $error = FALSE; // Check for a name: if (empty($_POST['name'])) { $error [] = 1; // Or $error [] = '<h5 style="color: red;">* You forgot to enter a name.</h5>'; and then print this array } else { $name= $_POST['name']; $name = mysqli_real_escape_string($dbc, trim($name)); } // Check for a something: if (empty($_POST['somethnig'])) { $error [] = 1; } else { $something= $_POST['something']; $something = mysqli_real_escape_string($dbc, trim($something)); } if (!$error) { $sqlinsert = "INSERT INTO Users (name) VALUES ('$name')"; $r = mysqli_query($dbc, $sqlinsert); // or die("Error: ".mysqli_error($dbc)); if ($r) {$newrecord = "Name created";} } }
  14. I would think you could use the explode function using the comma as a seperator. I can't see people inputing info in a form right each and every time. I think you'll also need something to remove spaces and a way to deal with numbers that are more or less than four charactors.
  15. I think it's okay, do you have the code indented? I'd indent the code to make it easier to read. Are you placing info in a database? Are you cleaning your input someway?
  16. Thanks Jessica, that works great, but I don't know why. I would think it would be it would be OR because the category is either a parent or has a parent not both. What am I looking at wrong? Thanks Added Thanks again Jessica, I see it now.
  17. I can't figure this out the first sql statement with "=" works fine. The second with "!=" doesn't. This one works, it includes only items whose category is 34 or whose category parent is 34 $q = "SELECT photos.thumb, product.id_prod, product.title, photos.thumb_width, photos.thumb_height FROM product JOIN members ON (product.id_mem = members.id_mem AND mem_group >=1 AND mem_group <100) JOIN category ON (product.id_cat = category.id_cat AND (category.id_parent = '34' OR category.id_cat = '34')) LEFT JOIN photos ON (product.id_prod = photos.id_prod AND photos.main_photo = '1') WHERE product.publish = '1' ORDER BY product.id_prod DESC"; This one doesn't work, it includes all items published, including those whose category is 34 or whose category parent is 34(which it shouldn't) and the statements are almost exactly alike. $q = "SELECT photos.thumb, product.id_prod, product.title, photos.thumb_width, photos.thumb_height FROM product JOIN members ON (product.id_mem = members.id_mem AND mem_group >=1 AND mem_group <100) JOIN category ON (product.id_cat = category.id_cat AND (category.id_parent != '34' OR category.id_cat != '34')) LEFT JOIN photos ON (product.id_prod = photos.id_prod AND photos.main_photo = '1') WHERE product.publish = '1' ORDER BY product.id_prod DESC"; Thanks
  18. There is a pinned topic and addresses headers issues. What line is 111. About where is it? You can't send any html or even a white space before your redirect
  19. I would have thought this would have been beat to death on here by now but I searched for "Check for cookies" and I didn't see this topic. On a site I'm making, users can't login without cookies inabled. // I have an included fucntion file and I have this near the top if (!isset($_COOKIE['AllowCookies']) OR $_COOKIE['AllowCookies'] != 'Yes') {setcookie("AllowCookies", Yes);} // To check to see if browser accepts cookies // then on the login page I have if ($_COOKIE['AllowCookies'] != 'Yes') {echo '<p style="color: red;">Sorry, your cookies are turned off. You must allow them in your browser to login. Thank you</p>';} I searched the web and came up with more verbose examples which makes me wonder if this is good enough or if I'm missing something. So my question is, will this do?
  20. I had 24 Errors on the front page at http://validator.w3.org . some of them ... No DOCTYPE No Character encoding declared this may bring up problems down the road.
  21. Try <form id="form1" name="form1" method="post" action="process.php" enctype="multipart/form-data" > added sorry I think I got what you want wrong. Are you trying to upload an image?
  22. Just now I left a reply to a topic and someone else also left one just before me, there was no notice of a reply or statement asking me if I wanted to continue when I clicked submit. I don't know if this would be a feature of the new forum but I just wanted to give you a heads up.
  23. Looks like you cut it down for us, are you sure you have values for the variables? After the email is sent echo the variables to test.
×
×
  • 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.