Jump to content

robert_gsfame

Members
  • Posts

    876
  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. hello all, i would like to find some solution regarding uploaded file If user has upload let say an image in jpg and he wants to remove the file, then how to remove not only the file's name in the table and changing it into NULL but also the chosen file inside my uploaded folder?? do i need to use unlink or maybe u have some other method?? thx
  2. no...no...no what i mean is that when i press the other button then it goes to another page where i put a mailto script inside the page
  3. I am really confused with this, hope someone could help.. let say i have 2 button in one form, first button i will use to do the submission while the other one will be used to send an email to user's email typed in the textbox..how to do it using javascript?? <form name = " form1" action="POST"> <input type = "submit"> <input type="text" name="user_email"> <input type="button"> </form> What should i do with the button??
  4. i just want some link to reload the captcha image only without reloading my contact page.
  5. i need some helps regarding refreshing captcha.. what i know i can do it simply by creating a link to refresh my captcha php page.. But i don't have any idea how to do it, could anyone help me about this?
  6. <?php //first you have to know really about mysql and php //connect to your database and don't forget user session //get your data using fetch array based on user session //Let say that your array is being stored inside '$array' $myrecordfromdatabase = $array['record_kept_in_database']; ?> <select name="choose"><option value='check1' <?php if($myrecordfromdatabase=='check1'){ echo "SELECTED";}else{ }> hope it could give you some hints
  7. yeah i know that it won't be as clear as when i created using flash, but what i found here is that text is difficult to be read. Okay, make it more detail...if i would like to have a banner let say 100 x 50 px...should i make it in imageready with this exact width and height or just make it larger width and height, then later adjust it in html ?? Which one will give me clear result?
  8. I would like to put a banner on my html site and i've created the banner using imageready...But then when i start running the banner on my html site, it looks blur especially the text can anyone help me to solve this problem?
  9. i think the problem is with this part implode(' ',$value) as i've tried removing implode part and changing it with echo $value."<br>"; It returns the value in array
  10. i retrieve the value from database $array = mysql_fetch_array('$sqlquery');
  11. $findname=$array['name']; $split = explode(' ',$findname); foreach($split as $index=>$value) $value = ucwords(strtolower($value)); $findname1=implode(' ',$value); When i echo the $findname; it returns -----------> implode() [function.implode]: Bad arguments. in Which part is wrong??
  12. thanks for your great answer, is it possible to do it with strtok ??
  13. Suppose i have this words " I am one of members of PHPFreaks Forum " and i want to make this words into " I am one of members of PHP..." Using strtok then how to do it let say: $words = "I am one of members of PHPFreaks Forum" then how to break this words with using strtok..if i want to break based on space there i can do it like this strtok($words, " "); But in this case words will be change to " ... " after reach strlen Can anyone help me
  14. I have my simple ajax based chat room, but i don't know how to display all active users on the right side of the chat window Below is the code: index.php <? session_start(); if(isset($_GET['logout'])){ //Simple exit message $fp = fopen("log.html", 'a'); fwrite($fp, "<div class='msgln'><i>User ". $_SESSION['name'] ." has left the chat session.</i><br></div>"); fclose($fp); session_destroy(); header("Location: index.php"); //Redirect the user } function loginForm(){ echo' <div id="loginform"> <form action="index.php" method="post"> <p>Please enter your name to continue:</p> <label for="name">Name:</label> <input type="text" name="name" id="name" /> <input type="submit" name="enter" id="enter" value="Enter" /> </form> </div> '; } if(isset($_POST['enter'])){ if($_POST['name'] != ""){ $_SESSION['name'] = stripslashes(htmlspecialchars($_POST['name'])); } else{ echo '<span class="error">Please type in a name</span>'; } } ?> <head> <title>Chat - Customer Module</title> <link type="text/css" rel="stylesheet" href="style.css" /> </head> <?php if(!isset($_SESSION['name'])){ loginForm(); } else{ ?> <div id="wrapper"> <div id="menu"> <p class="welcome">Welcome, <b><?php echo $_SESSION['name']; ?></b></p> <p class="logout"><a id="exit" href="#">Exit Chat</a></p> <div style="clear:both"></div> </div> <div id="chatbox"><?php if(file_exists("log.html") && filesize("log.html") > 0){ $handle = fopen("log.html", "r"); $contents = fread($handle, filesize("log.html")); fclose($handle); echo $contents; } ?></div> <form name="message" action=""> <input name="usermsg" type="text" id="usermsg" size="63" /> <input name="submitmsg" type="submit" id="submitmsg" value="Send" /> </form> </div> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script> <script type="text/javascript"> // jQuery Document $(document).ready(function(){ //If user submits the form $("#submitmsg").click(function(){ var clientmsg = $("#usermsg").val(); $.post("post.php", {text: clientmsg}); $("#usermsg").attr("value", ""); return false; }); function loadLog(){ var oldscrollHeight = $("#chatbox").attr("scrollHeight") - 20; $.ajax({ url: "log.html", cache: false, success: function(html){ $("#chatbox").html(html); var newscrollHeight = $("#chatbox").attr("scrollHeight") - 20; if(newscrollHeight > oldscrollHeight){ $("#chatbox").animate({ scrollTop: newscrollHeight }, 'normal'); //Autoscroll to bottom of div } }, }); } setInterval (loadLog, 2500); //Reload file every 2.5 seconds //If user wants to end session $("#exit").click(function(){ var exit = confirm("Are you sure you want to exit?"); if(exit==true){window.location = 'index.php?logout=true';} }); }); </script> <?php } ?> </body> ----------------------------------------------------------------------- post.php <? session_start(); if(isset($_SESSION['name'])){ $text = $_POST['text']; $fp = fopen("log.html", 'a'); fwrite($fp, "<div class='msgln'>(".date("g:i A").") <b>".$_SESSION['name']."</b>: ".stripslashes(htmlspecialchars($text))."<br></div>"); fclose($fp); } ?> -------------------------------- log.html to put all the text EDIT: use code tags next time
  15. I want to have my active users being displayed, is it possible?? Let say once they login then their name will be appeared on other users' page
  16. I just wonder how can i create my own chat room. What i can do is only create a chat room that always refresh every let say 10 seconds which is so disturbing. Can anyone give me some clue or maybe some link?
  17. Although it sounds a bit complicated and crazy but i use this syntax I put all list menu values for month and year added with '1' just to convert the format of the date into 'd m Y' then i break it using explode then get the value of each array and put it inside my database table In order to have my list menu checked once value is the same with what i have inside the table... i also convert it into 'd n Y' break it using explode and get the value of each array.... AND IT'S DONE!!
  18. so what to do?? i just give 2 list menu for users to choose, one for month and the other for year Do i have to put a day like '1' and inserted into my database, which i have to use explode("/",$date) and take the value only $date[1] and $date[2] ???
  19. i got some clue....i think it's because date should be written completely, i mean it should has day, month and year Just change, i try this syntax and it returns wrong value like what i said above echo date(" F Y", strtotime("1941-07");
×
×
  • 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.