Jump to content

robert_gsfame

Members
  • Posts

    876
  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. If i have this code <a href="#"><img src="image1.JPG" width=200 height="200" border="0"></a> Then when it is clicked, there will be a border surrounded the image...can i remove the border using CSS?? thx in advance
  2. $username=$_POST['username']; $password=$_POST['password']; query = sprintf("SELECT * FROM table1 WHERE username='%s' AND password='%s'", mysql_real_escape_string($username), mysql_real_escape_string($password)); $sql=mysql_query($query); So using mysql_real_escape_string() is enough ??Above code is quite safe enough?? or maybe you could alter something so that become safer??
  3. I never use mysql_real_escape_string before as i'm still new to php so i always use mysql_query instead of mysql_real_escape_string Can anyone help me on how to use it? Is it the same as when using mysql_query $username=$_SESSION['username']; $password=$_SESSION['password']; query = sprintf("SELECT * FROM table1 WHERE username='%s' AND password='%s'", mysql_real_escape_string($username), mysql_real_escape_string($password)); $sql=mysql_query($query); does the code above written correctly? then where should i put mysql_real_escape_string??in all query and when using $_POST and $_GET?? Last question, is mysql_real_escape_string must be connected to get_magic_quotes_gpc(), stripslashes to make my webpage safer?? thanks in advance
  4. The code is correct but check WHERE id ='$id' ", erase the space between ' and "
  5. In order to retrieve the image from database is very simple after connecting and get the filename from your database using array $array=mysql_fetch_array('$yoursql'); $filename=$array['filename']; then you can write <img src="your database folder/<?php echo $filename;?>"> Hope it helps
  6. I have a site called http://www.mysite.com/ and when user register, i wish that they could get their own page only by typing http://username.mysite.com/ Is this possible?
  7. i think i get alert CANNOT MODIFY as i put the header on the body <html> is that right??
  8. <?php session_start();?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title></title> <link rel="Shortcut Icon" href="images/icon3.jpg"> <style type="text/css"> <!-- #apDiv1 { position:absolute; left:27px; top:10px; width:962px; height:699px; z-index:1; background-color: #FFFFFF; } </style> </head> <?php require_once('configuration.php'); ?> <body onLoad=start() window.refresh bgcolor = "black"> <div id="apDiv1"></div> <?php if (isset($_SESSION['uid'])){ echo "<b>welcome</b>"; }else{ header("Location:index.php");}
  9. yeah i think header will be the answer but i always try to avoid using header as i will always find this alert CANNOT MODIFY HEADER once using header() What is the problem really?? should i put session_start after require_once or what??
  10. Cannot modify header information - headers already sent by
  11. it will result the same as when i use <self.location> Any other method???
  12. I have page1.php for users to login n if session is not empty then they can go to page2.php Let say i type page2.php on url and as session is empty, it must redirect to page3.php I have this for my code if(empty($_SESSION['username'])){ print "<script>"; print " self.location='index.php';"; print "</script>"; } but that code is not good enough as it will redirect to page2.php first before redirect to page3.php although the process is so fast i wish to have it more professional look, can anyone help me?
  13. I just get my adsense account, i wish to start putting google ads on my site..but when i went to setup i found only 2 features given : Feeds and Search and an alert stated this: "We do not currently offer AdSense for Content in Lithuanian" Can i still use the adsense for content?? Please Help Thx
  14. if i use ob_start(), is it solving the problem??
  15. <?php $cookies1=$_POST['cookies']; if(isset($cookies1)){ setcookie("cookies",$_POST['text']); }?> This line was said to be the error!!
  16. I really confused why was this happened when i was trying to set cookie Page1.php <?php session_start();?> <?php require_once('configuration.php');?> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <?php if($_COOKIE["cookies1"]){ $cookies1=$_COOKIE["cookies1"]; $checked1="CHECKED";} ?> <html> <head> <body> <form name="form1" method="post" action="form2.php"> <input type="text" name="text1" value=<?php echo $cookies1> <input type="checkbox" name="cookies" $checked1>cookies <input type="submit"> </form> </body> </head> then in page2.php <?php session_start();?> <?php require_once('configuration.php');?> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx <?php $cookies1=$_POST['cookies']; if(isset($cookies1)){ setcookie("cookies",$_POST['text']); }?> <html> <head> <body> <form name="form1" method="post" action="form2.php"> <input type="text" name="text1" value=<?php echo $cookies1> <input type="checkbox" name="cookies" $checked1>cookies <input type="submit"> </form> </body> </head> Which part is incorrect as it always give me this result: CANNOT MODIFY HEADER BLABLABLABLABLABLA, and it stated that this part <?php $cookies1=$_POST['cookies']; if(isset($cookies1)){ setcookie("cookies",$_POST['text']); }?> on page2.php seems to be incorrect
  17. If user has uploaded his file (file will be stored into a folder and database for the path) just for example '123.JPEG' file and he send it together with his email (attachment) after clicking the button provided. Surely this will enable the recipient to download the attached file, but my question is: Let say user changed the file from 123.JPEG into 456.JPEG and i unlink it which means that 123.JPEG will be deleted from the folder and ofcourse the path will be changed either then, will it be a problem for the recipient to download 123.JPEG from the email he received before???
  18. Actually users have to login first before they can insert the data into my database, i thought that if i only protect that if "empty($SESSION)" then is enough. I never protect blank data in this case.... Is it helpful enough when using captcha??
  19. I always found several blank records inside my database, although $SESSION is required to insert the data into database. Why can this happen? how to prevent this??
  20. okay, i got the solution!!! ;D it should be application/msword && application/doc TOPIC CLOSED!!!
  21. so what should i do to have it works for both mozilla and IE Please tell me in detail.. i really need your helps
  22. Like i told you when i run my script on IE 6.0, file uploaded..but when i run it on mozilla, file didn't upload
×
×
  • 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.