Jump to content

vchris

Members
  • Posts

    1,529
  • Joined

  • Last visited

Everything posted by vchris

  1. hmmm interesting... but this will only delete 1 record won't it? Is it possible to have those values separated with commas so I can do WHERE linkid IN (1,2,3)?
  2. vchris

    Session variable

    Thanks for the tip guys
  3. So I've seen PHP and MySQL by myself only, noone helped and no school courses. I've been following examples and tutorials online and a book. What do you guys think about this script?This script is for a page where users can add links to the DB. Of course this is a logged in area. I added some comments for you guys. <?php session_start(); ob_start(); //used to change header without errors ?><?php if(isset($_SESSION['userid'])){ //Check if user is logged in ?><?php if(isset($_POST['cancel'])){ //If the cancel button is pressed in form, user redirected to acp page. header("Location: acp.php"); exit();} ?><?php include('../includes/mf/header.php'); ?> <div class="fullcontent"> <h1>Add Link</h1> <?php if (isset($_POST['add'])) { //Initialize error array $errors = array(); //Validate name if(empty($_POST['sitename'])){ $errors[] = "<p class=\"centerAlign\">Site name field is required.</p>"; } else { $n = trim($_POST['sitename']); } //Validate address if(empty($_POST['siteurl'])){ $errors[] = "<p class=\"centerAlign\">Site URL field is required.</p>"; } else { $n = trim($_POST['siteurl']); } //If everything is OK if(empty($errors)){ //Insert feedback in database require_once('../includes/mysql_connect.php'); //Query the database $query = "INSERT INTO mf_links (sitename, siteurl, dateadded) VALUES('" . $_POST['sitename'] . "','" . $_POST['siteurl'] . "', NOW() )"; //Run query $result = @mysql_query($query); //If it ran OK if($result){ header("Location: acp.php"); exit(); } else { echo "<h3>Your new link was not submitted due to a system error.</h3>"; echo "<p>" . mysql_error() . "<br><br>Query:" . $query . "</p>"; include('../includes/mf/footer.php'); exit(); } mysql_close(); } else { for($i=0 ; $i<sizeof($errors) ; $i++){ echo $errors[$i]; //display errors } } } ?> <form name="addlink" method="post" action="add.php" class="form_addlink"> <div class="form_rowspacing"><label>Site Name</label> <input type="text" name="sitename" class="text_input" /></div> <div class="form_rowspacing"><label>Site URL</label> http://<input type="text" name="siteurl" class="text_input" /></div> <hr /> <input type="submit" name="add" value="Add Link" /> <input type="submit" name="cancel" value="Cancel" /> </form> </div><?php include("../includes/mf/footer.php"); ?><?php } else { //If user is not logged,he is redirected header("Location: index.php"); exit();} ?> If you guys have any comments or suggestions about my php/mysql coding go ahead.
  4. So I have to create a query for each record to be deleted?I can't just do a WHERE linkid IN (1, 2, 3, 4)?
  5. This is what is displayed: array(2) { [0]=> string(1) "7" [1]=> string(1) "5" } Could I do this? $query = "DELETE FROM mf_links WHERE linkid IN (" . var_dump($_POST['itemdel[]']) . ")"; Or would I have to create a loop?
  6. I am working on a project and each record has it's own checkbox. These checkbox are to delete the selected record. You can have 1 record like you can have all records (could be hundreds). I'm not sure how to get every value of every checkbox and I'm not sure of the delete mysql query for those records.I tried this: <input type=\"checkbox\" name=\"itemdel\" value=\"" . $row['linkid'] . "\"> Which only display 1 number.I also tried this: <input type=\"checkbox\" name=\"itemdel[]\" value=\"" . $row['linkid'] . "\"> Which only display the word "Array".My display statement: echo $_POST['itemdel']; I basically only need a list of selected values and need someway to work with it.Thanks
  7. vchris

    Session variable

    I knew it was this simple. SFB you just solve the issue :)I checked my old script and I see session_start(); at the top. When setting a session variable when logging in I don't need to start the session right? Only on a new page where I use a session variable?Thanks.
  8. vchris

    Session variable

    This must be a pretty n00b question but I can't seem to get the session variable to work. This is a login script. On successful login, I create a session variable called userid which contains in this case the number 1. Then on the second page (page redirected to) I check to make sure the user id logged in with this condition if(isset($_SESSION['userid'])){ . Doesn't work, I'm redirected to the first page (when userid is not set in session). I then tried this echo $_SESSION['userid']; exit(); and got this error Undefined variable: _SESSION . Is there somewhere I need to set this variable? I did a previous script like this and everything seemed to work fine...
  9. vchris

    ishost.exe

    It wasn't able to remove my problem.I did fix the ishost issue though. I downloaded the Sophos antivirus 6, scanned and issue resolved
  10. vchris

    ishost.exe

    I appreciate thanks Dan!
  11. vchris

    ishost.exe

    Nevermind I received it twice, the zip and rar versions. Dan: It seems like this version has less definitions than version 5. In 5 (trial) I had around 148000 and in this one I got like 106000 and I only found 3 cookies...The new version seems a lot better...
  12. vchris

    ishost.exe

    Oh ok. Yeah I do have WinRAR. SHIIIIIIIIIP it!
  13. vchris

    ishost.exe

    I thought you were talking about a cracked version of somekind. Then if it's legal + free, I'm even more interested
  14. I'm pretty sure it's javascript that would solve this problem.How would I open a Word doc with a button?I am pretty restricted to what I can do here. Javascript is an option. What would be the code? I know it must be really simple but I never really got into javascript hehe...Thanks
  15. vchris

    ishost.exe

    I tried the demo version and looks nice and finds lots of spyware that ad-aware and spybot couldn't find. Are you talking about the demo version? Can you remove the spywares?
  16. vchris

    ishost.exe

    I think I'll first try that spy sweeper program then I'll try the sophos antivirus and if they can't remove it then I'll try hijackThis. I've seen log files from Hijackthis and it seems to solve some issues when you know what you're doing.
  17. vchris

    ishost.exe

    Seems like I have this: http://www.sophos.com/security/analyses/trojdloadrxj.html
  18. vchris

    ishost.exe

    I currently use 2 anti-spyware program, ad-aware and spybot and none of them found it.I remember this program was downloaded from a site that's not trusted (crack site) and then when I clicked the exec the icon itself disappeared from my desktop and I then started getting this pop-up on boot.Do you have the file ishost.exe in windows/system32? I might just delete it.
  19. vchris

    ishost.exe

    The problem is that when I scan that file specificaly with my antivirus or antispyware they don't see anything wrong with it. When scanning my whole system they don't find anything. My antivirus is Panda and my antispyware is ad-aware and spybot.
  20. vchris

    ishost.exe

    I think I may have downloaded somekind of virus. Since I downloaded a program from a site and executed the exe file I'm having the following pop-up on windows startup. I also have Panda antivirus and firewall. On startup I also get a pop-up from my firewall saying that ishost.exe is trying to access the internet. ishost.exe comes from c:\windows\system32\ishost.exe.I searched on google but couldn't find much and I did virus and spyware scans.
  21. I got this transparency effect working in IE perfectly, in Firefox I get the transparency on the div and also the text in it which I don't want. I wasn't able to test in Opera to see if it worked fine.Is there a fix for my Firefox issue? Anyone found a way to do this without overlaying the text on the div?
  22. Woot! :)Answer is Ctrl+click the thumbnail on the layer table!Thanks guys... I was pretty close
  23. That may work... I was Ctrl+Clicking on the layer in the layer table but not actually on the thumbnail. I'll try that also. I wouldn't believe they would take that out.
  24. When I do Ctrl+A this will create a marquee around the layer?If it does then it's the same thing and I can then create a blur effect only on that selected area
  25. That's maybe a bit too much. I would say to just make them blue (like before). That's simple to change in the stylesheet.
×
×
  • Create New...