Jump to content

thibo1025

Members
  • Posts

    118
  • Joined

  • Last visited

About thibo1025

  • Birthday 10/25/1989

Previous Fields

  • Languages
    PHP 5, XHTML 1, CSS2, Javascript, SQL, ActionScript.

Contact Methods

  • MSN
    thibo1025@hotmail.fr
  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Boulogne Billancourt, France
  • Interests
    Party, Alcohol, Chics and waterver the rest might be!

thibo1025's Achievements

Member

Member (2/7)

0

Reputation

  1. I want to know what are the differant free redirection possibilyties... and what are their caracteristics...are there ads or something else like it?
  2. when I copied and pasted the code I had to translate it form what I had to a more basic version and I forgot to deleate a part.Thanks cocolate.However I might want to know how to change the font of an option but I read it could not be done in CSS... I found a tutorial using JS that makes the select act like a list: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head> <title>Select Replacement Test</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta http-equiv="Content-Language" content="en-us" /> <style type="text/css"> } input { display: block; margin: 0 0 0px; color: #ffffff; } select { display: block; width: 300px; } select.replaced { display: none; } ul.selectReplacement { margin: 0; padding: 0; height: 1.65em; width: 300px; } ul.selectReplacement li { background: #ffffff; color: #000000; cursor: pointer; display: none; font-size: 11px; line-height: 1.7em; list-style: none; margin: 0; padding: 0px 12px; width: 276px; border: solid 1px #000000; } ul.selectOpen li { display: block; } ul.selectReplacement li.selected { background: url(../tytd/images/fleche.gif) top right no-repeat; color: #000000; border: solid 1px #000000; display: block; } ul.selectOpen li.selected { background: #ffffff; display: block; border: solid 1px #000000; } ul.selectOpen li:hover, ul.selectOpen li.hover, ul.selectOpen li.selected:hover { background: #CCCCCC; color: #000000; border: solid 1px #000000; } </style> <script type="text/javascript"> function selectReplacement(obj) { obj.className += ' replaced'; var ul = document.createElement('ul'); ul.className = 'selectReplacement'; var opts = obj.options; for (var i=0; i<opts.length; i++) { var selectedOpt; if (opts[i].selected) { selectedOpt = i; break; } else { selectedOpt = 0; } } for (var i=0; i<opts.length; i++) { var li = document.createElement('li'); var txt = document.createTextNode(opts[i].text); li.appendChild(txt); li.selIndex = opts[i].index; li.selectID = obj.id; li.onclick = function() { selectMe(this); } if (i == selectedOpt) { li.className = 'selected'; li.onclick = function() { this.parentNode.className += ' selectOpen'; this.onclick = function() { selectMe(this); } } } if (window.attachEvent) { li.onmouseover = function() { this.className += ' hover'; } li.onmouseout = function() { this.className = this.className.replace(new RegExp(" hover\\b"), ''); } } ul.appendChild(li); } obj.parentNode.insertBefore(ul,obj); } function selectMe(obj) { var lis = obj.parentNode.getElementsByTagName('li'); for (var i=0; i<lis.length; i++) { if (lis[i] != obj) { lis[i].className=''; lis[i].onclick = function() { selectMe(this); } } else { setVal(obj.selectID, obj.selIndex); obj.className='selected'; obj.parentNode.className = obj.parentNode.className.replace(new RegExp(" selectOpen\\b"), ''); obj.onclick = function() { obj.parentNode.className += ' selectOpen'; this.onclick = function() { selectMe(this); } } } } } function setVal(objID, selIndex) { var obj = document.getElementById(objID); obj.selectedIndex = selIndex; } function setForm() { var s = document.getElementsByTagName('select'); for (var i=0; i<s.length; i++) { selectReplacement(s[i]); } } window.onload = function() { (document.all && !window.print) ? null : setForm(); } </script></head><body><form><select name="font" id="font"><option select>font</option><option value="Arial"><font face="Arial">Arial</font></option><option value="Arial Black"><font face="Arial Black">Arial Black</font></option><option value="Arial Narrow"><font face="Arial Narrow">Arial Narrow</font></option><option value="Book Antiqua">Book Antiqua</option><option value="Century Gothic">Century Gothic</option><option value="Comic Sans MS">Comic Sans MS</option><option value="Courier New">Courier New</option><option value="Franklin Gothic Medium">Franklin Gothic Medium</option><option value="Garamond">Garamond</option><option value="Georgia">Georgia</option><option value="Impact">Impact</option><option value="Lucida Console">Lucida Console</option><option value="Lucida Sans Unicode">Lucida Sans Unicode</option><option value="Microsoft Sans Serif">Microsoft Sans Serif</option><option value="Palatino Linotype">Palatino Linotype</option><option value="Tahoma">Tahoma</option><option value="Times New Roman">Times New Roman</option><option value="Trebuchet MS">Trebuchet MS</option><option value="Verdana">Verdana</option></select></form></body></html> An It works out well only the font still dosent change...
  3. I have my bbcode installed and I have a problem with a dropdown as buttonWhat I have tryed out is <select name="font" ><option select>Font</option><option onClick="txt.value+='[font=Times New Roman]text[/font]';"><><spanfont face="Times New Roman">Times New Roman</font></option><option onClick="txt.value+='[font=Comic Sans MS]text[/font]';"><font face="Comic Sans MS">Comic Sans MS</font></option></select> I cant figure how to make it work, my textarea is: <textarea cols='90' rows='10' id='txt' name='text'></textarea> note that inside the dropdown the font tag isn't doing anything...
  4. thibo1025

    Uplopad File

    Wich is exactly what I did, and I still do nott know how to correct the errors.
  5. thibo1025

    Uplopad File

    only that link is invalid...
  6. sure let me show you: <?phpsession_start();$logged_in = false;$msg = "";if ($_SESSION['online']){ $logged_in = true;}elseif (isset($_POST['username'])){$db=mysql_connect("localhost", "root", "");mysql_select_db("jny", $db);$username = mysql_real_escape_string(htmlentities($_POST['username']));$password = mysql_real_escape_string(htmlentities($_POST['password']));$query = mysql_query("SELECT username, password FROM Users WHERE username = '$username' AND password = '$password'");if(mysql_num_rows($query) == 1) {$_SESSION['online'] = true;$_SESSION['username'] = $username;$logged_in = true; }else{$msg .= "The username and password did not match.<br /><br />";}mysql_free_result($query); mysql_close($db);echo "<html>\n"; echo "<head>\n";/* Dont U want a title to your page */echo "</head>\n";echo "<body>\n";echo $msg;if ($logged_in) { include('[b]current page[/b]'); //Without the includes!!echo "<h1>Login</h1>\n<form action='' method='post'>\n<p>Username<br /><input type='text' name='username' /></p>\n<p>Password<br /><input type='password' name='password' /></p>\n<p>\n<br /><input type='submit' name='submit' value='Login' /></p>\</form>";}echo "</body></html>";?>
  7. thibo1025

    Uplopad File

    right so In stead of righttingecho"There is a problem with the file";I should put echo $_FILES['file']['error'] ;right?well than:as the errors return in numbers, could you telle me what these number mean?
  8. actually, I am not sure that yoo can finish a conditional with an include... Maybe you can try to put it back in one file and see if it works out alone
  9. to get data out of a database: <?php$con = mysql_connect("[b]host[/b]","[b]user[/b]","[b]pass[/b]");if (!$con){ die('Could not connect: ' . mysql_error()); }mysql_select_db("[b]database[/b]", $con);$result = mysql_query("SELECT [b]col name[/b] FROM [b]table[/b]"); while($row = mysql_fetch_array($result)){//$row['[b]col name[/b]'] is your value.}mysql_close($con);?> In Your Case:for the registration $db=mysql_connect("localhost", "root", "");mysql_select_db("jny", $db);$username = mysql_real_escape_string(htmlentities($_POST['username']));$password = mysql_real_escape_string(htmlentities($_POST['password']));$query = mysql_query("SELECT username, password FROM Users WHERE username = '$username' AND password = '$password'");if(mysql_num_rows($query) == 1) { $_SESSION['online'] = true; $_SESSION['username'] = $username; $logged_in = true; }else{ $msg .= "The username and password did not match.<br /><br />";} mysql_free_result($query); mysql_close($db);
  10. have you trued to put the code back into one block?
  11. humm... I propose We see your attempt of script first because what you are asking is rather complicated...But I can help you a bit for few reasons:$_POST['name'] is an arraw and not a function. it contains the value of the input called name in a form.what do you mean by "in a row"? you mean if you have an arraw that contains differant values you could compare the values in the arraw?That is possible with a foreach method.Read the php tutorial of W3schools
  12. thibo1025

    Uplopad File

    the problem is not there, whenever the file is in ".wma" or that the file contains a space, the sending fails:if the file is in ".wma"the array $_FILES is emptyif the file contains a spaceit returns"There is a problem with the file." (wich is my error message in the script)Is it normal or not?
  13. thibo1025

    php index page

    I know that but the content of the directory is only files, the files in it are uploaded by php on another script so this is exactly what I was looking for.
  14. thibo1025

    Uplopad File

    I am using the formular used given by W3schools and when I try to upload a file, I have to be sure that this file dose not contain spaces in it's title otherwise he dose not understand that it is a file. How could I fix this? //page where the form is.echo "<form action='file.php' method='post' enctype='multipart/form-data'>\n";echo "<label for='file'>File:</label>\n";echo "<input type='file' name='file' id='file' />\n";echo "<br />\n";echo "<input type='submit' name='submit' value='OK' />\n";echo "</form>\n"; //My file.php pageif ($_FILES["file"]["error"] > 0){ // this is my line 42. echo "There is a problem with the file.";}else{ echo "File: " . $_FILES["file"]["name"] . "<br />\n"; echo "Type: " . $_FILES["file"]["type"] . "<br />\n"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />\n"; if (file_exists("fichiers/" . $_FILES["file"]["name"])){ echo "the file '" . "fichiers/" . $_FILES["file"]["name"] . "' already exists."; } else{// Enrogistrement du fichier dans "fichiers/": move_uploaded_file($_FILES["file"]["tmp_name"],"fichiers/" . $_FILES["file"]["name"]); echo "the file '" . "fichiers/" . $_FILES["file"]["name"] . "' was saved."; }} and this is what I get! or my message There is an error with the file.any help for fixing errors?
  15. thibo1025

    php index page

    oh but If I understood $ext becomes the axtansion of the file right? and dose it contain the dot or not?and $file stays my file....
×
×
  • Create New...