Jump to content

cytech

Members
  • Posts

    87
  • Joined

  • Last visited

    Never

Everything posted by cytech

  1. How your displaying the information is fine(while loop), you just need to do a foreach loop on the post once the form gets submitted. So in your case it would be: foreach($_POST['declare'] as $key=>$val){ echo $val."<BR>"; } The above would display as: 13 14 (given of course you selected those two items).
  2. Hello, If you look at the error you will see the file name is 'neurology-neuroscience'.xml, notice the single quotes around the topic name? In your php do this: $items = simplexml_load_file($topic.".xml"); $items = new SimpleXMLElement($topic.".xml", null, true); See if that does the trick
  3. Hey, You have the right concept - normally I would do something like this: $array_items = array("item1", "item2", "item3"); foreach($items as $key=>$val){ echo "<input type=\"checkbox\" name=\"items[]\" value=\"{$val}\" /> $val <br />"; } Then in your post: echo "The user selected: "; foreach($_POST['items'] as $key=>$val){ echo $val.", "; // can do inserts/updates here } Yep, you can do a foreach loop just like above to do your inserts/updates.
  4. If you do not have access to your ini file you can also just put: ini_set('display_errors', 'Off'); In your core include or header file.
  5. Hey, $admin=$_SESSION['username']; $getadmin="SELECT * from bl_admin where username='$admin'"; $getadmin2=mysql_query($getadmin) or die("Cannot get admin"); $getadmin3=mysql_fetch_array($getadmin2); if($getadmin3['userlevel']==3) { // level 3 }else{ // other level } Would be the right idea, if you look in protect.php way at the bottom they search the array set right before they include the file. They are basically doing what you just did. They pull the users account and then just verify they can view the page. So your method will work as well.
  6. My thought would be it times out?? How many blog posts do you have?
  7. Are they clock in clock out? So the employee clocks in a 08:30:00 and then clocks out at 18:30:00 ?
  8. Whats in the file protect.php?
  9. What parameters are you sending and what server are you sending them to?
  10. Hey jonw118, It is becuase you are re-defining $sql each time. So if you wanted to do it the way you had setup you would need to run $rez=mysql_query($sql,$dblnk); after each $sql you have setup. I suggest combining the queries together, something like this: $sql="update inputinfo set image='',thumb='', image2='', thumb2='', image3='', thumb3='' where id='$id'"; Hope that helps!
  11. Yes, since the $new_small variable is local inside of the class you can not access it as you are. However; looking at the code the variable "dstimg" is holding the new images name. So update your new_image variable to this: $query = mysql_query("insert into house (address,thumb,imagedata1,imagedata) values ('$address','1','{$class->dstimg}','$image1')"); See if that does the trick.
  12. $state_where = ""; if(!empty($state)){ $state_where = " AND state = {$state}"; } $sql = "SELECT * FROM $tbl_name WHERE dtype = '$dtype' OR dtypewc = '$dtype' AND dmajorp = '$smajor' OR dmajorc1 = '$smajor' OR dmajorc2 = '$smajor' OR dmajorc3 = '$smajor' {$state_where} ORDER BY jpted LIMIT $start, $limit"; Thats how I would go about it.
  13. I would be curious to see if there is any security difference.
  14. Your file is trying to save directly to the C drive, is your C drive setup as the root of your server? Try removing the C:\\ and just creating the file itself and see where it creates it. I'm thinking you don't have permissions to write a file to C.
  15. Where you have: $customerRef = $_POST['customerRef']; Put if($_POST['customerRef']=="e.i AIT001"){ $customerRef = ""; }else{ $customerRef = $_POST['customerRef']; } On a side note you should use mysql_real_escape_string() instead of addslashes, it is much better
  16. Hey anthony, Into the database? sounds like you wanted this if statement to check the field before it was added? You would need to do this via php and not javascript. if($_POST['customerRef'] == "i.e ITA001"){ $_POST['customRef'] = ""; }
  17. <input name="customerRef" type="text" class="fields" id="customerRefField" onFocus="if(this.value=='i.e ITA001'){ this.value='';}" onBlur="if(this.value==''){this.value='i.e ITA001';}" value="i.e ITA001" size="25" />
  18. Make sure testing is chmod to 777.
  19. Hey limitphp, No it will not match up, a quick fix would be to run the artistName through a "cleaning" function. Basically remove - and replace it with a space. $artistName = str_replace("-"," ", $artistName); (use the above code before you search artistName in your database). Normally though you should have whats known as a hash for each artist and save it in your database. So for example "The Strokes" would have a hash like "The-Strokes" and this is what you would use to check to see if theres a match.
  20. Try this: <?php include "config.php"; // putting a limit for the first 5 on the query $query="SELECT * FROM data ORDER BY story_num ASC LIMIT 0,5"; $result=mysql_query($query); $num=mysql_numrows($result); // loop through the return while($row = mysql_fetch_array($result)){ echo "<img src='images/notice.png'> <a href='show_story.php?stor_num={$row['story_num']}' style='color: #fff;font-size: 10pt;'>{$row['story_title']}</a><br />"; } ?> Just to note, the issue with you code was that you where using "$i++" within the if statements, the for loop will automatically increment this number for you, so essentially each if statement was adding "2" to $i.
  21. The query string gets rewritten at the end of the rewrite "/artist.php?artistID=$1&artistName=$2"
  22. Can we see it in action please?
  23. My first thought is make sure there is no whitespace at the end of your Easy Humus data in the db.
  24. Interesting thought, but did not work. I get a mysql error - If I place the "*" before columnA it will work. I am running mysql version 4.1.22. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* FROM
  25. Hey All, Not sure if this is even possible but figured I would give it a try. Say I have 5 columns in my table, column1, column2 etc... I want to pull column1 using a specified name and then the rest of the columns as is. Example SELECT column1 AS example FROM tbl Perfect, I now have column1's data in example. So next I try this: SELECT column1 AS example, * FROM tbl The above will give me column1's data as "example" however, it also duplicates it as column1 by using * when it displays all of the other columns. Is there a way I can name column1 as example and then call the rest of the columns without having to type them all out and not duplicating that initial column? I hope I explained it properly
×
×
  • 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.