Jump to content
xisto Community

TavoxPeru

Members
  • Content Count

    865
  • Joined

  • Last visited

Posts posted by TavoxPeru


  1. I agree with both of you, they are a lot of ways to achieve this and all are valid, you can use CSS with images, you can use only images without CSS, and also you can use CSS with Javascript.

    But one that i use to get the rounded corners effect is the one offered by the curvyCorners website, it only uses Javascript to get this effect and it is very easy to install, configure and use.

    BTW, you can view it in action at Te Recuerdo Peru Peruvian Wall Appointment Calendar.

    Best regards,


  2. I just test your code and it only works with Firefox not with Internet Explorer or Opera, also, as i supose, you are using the jquery library that is not bad and i think that it can be useful, i never use the jquery library but i know it is a very good JS library. Also, i'm thinking about copying some part of code for testing with my code.

    BTW, is it difficult to learn the JQuery library???? I'm start playing with another javascript library, Ext JS.

    Best regards,


  3. jlhaslip

    Yes and No, yes if you use it with another element that supports the onmouseover event like the A or P tags, and no if the element do not support it, like in this case with the SELECT. For example the following same function can be used with the A tag and with the P element like:

     

    <a href="#" onmouseover="showpic(1)">Attached to the mouseover event</a><p onmouseover="showpic(2)">Attached to the mouseover event of the P tag</p>
    In real world is logic that this fuction must use a variable as its value.

     

    Eggie

    No problem, i'm happy that it helps you.

     

    mastercomputers

    Because the OPTION element do not support the mouseover event, the SELECT element supports it but as a whole, if you attach the same function to the SELECT it will work but also you will need more code to get the same effect, you will need to detect the exact position of the x,y coordinates of the mouse position when it is over any of the options, etc, in other words MORE COMPLICATED. It would be very interesting to code something like that, i will appreciate it a lot if you post your solution if you do it.

    About the CSS hover effect, you are right, you can use it and it would work very nice even with the OPTION element but the problem is that it doesn't work with Internet Explorer.

     

    BTW, I test my code with Internet Explorer 6, Firefox 2.0.0.12 and Opera 9.24 and i can say that with Firefox all the functionality works perfectly, Opera also but the CSS hover effect only works with the INPUT element not with the OPTION, and Internet Explorer as i say above do not support the CSS hover effect in any case, well this is not absolutely true, because IE supports it with the A element, but in this example i don't use it ;).

     

    So the new code is this:

     

    <html><head><title>Image Pop Up On Option Change </title><script type="text/javascript">	function showpic(o) {		o = parseInt(o);		switch (o)		{		case 1:			imgName='del.gif';break;		case 2:			imgName='doc2.gif';break;		case 3:			imgName='docempty.gif';break;		case 4:			imgName='docurl.gif';break;		case 5:			imgName='new.gif';break;		}		var DivImage = document.getElementById('DivImg');		var DisplayImg = document.getElementById('IdImg');		DisplayImg.src=imgName;		DivImage.style.visibility="visible";	}</script><style type="text/css">form#form1 input {border:1px solid #414d59; padding-left:0.5em; margin-bottom:0.6em; width:230px; background:#f2f2f2;}form#form1 input:hover{ background:#b80b38; border:1px solid #fff; color:#fff;}form#form1 input:focus{background:#fff; border:1px solid #b80b38; color:#b80b38;}form#form1 option {background:#f2f2f2;}form#form1 option:hover  { background:#b80b38;color:#fff;}form#form1 option:focus  {background:#fff; color:#b80b38;}</style></head><body><form name="form2" method="post" action=""><table border="1"><td>Who do you wanna race?</td></table>	<select size=5 name="bike" onchange="showpic(this.options[this.selectedIndex].value)" >	<option value="1" >Derbi Senda 50</option>	<option value="2">Honda NS 50 R</option>	<option value="3" >Suzuki ZR 50</option>	<option value="4">Yamaha DT 50 MX</option>	<option value="5">Aprilia RS 50</option>	</select>-<a href="java script:launchClasses()">?</a>	<input type=submit value=Register>  	<div id="DivImg" style="position:relative;top:-50px;left:150px;z-index:20;width:25px;height:25px;visibility:hidden;text-align:center;"><img  id="IdImg"></div><!-- code addition - here works the option onmouseover event but only with Firefox --><select size=5 name="biketwo" >	<option value="1" onmouseover="showpic(1);">Derbi Senda 50</option>	<option value="2" onmouseover="showpic(2);">Honda NS 50 R</option>	<option value="3" onmouseover="showpic(3);">Suzuki ZR 50</option>	<option value="4" onmouseover="showpic(4);">Yamaha DT 50 MX</option>	<option value="5" onmouseover="showpic(5);">Aprilia RS 50</option>	</select><!-- code addition  --></form><a href="#" onmouseover="showpic(1)">Attached to the mouseover event of the A tag</a><br /><p onmouseover="showpic(2)">Attached to the mouseover event of the P tag</p><form id="form1"><input type="text" value="a value"><select size=5 name="bike" >	<option value="1" >Derbi Senda 50</option>	<option value="2">Honda NS 50 R</option>	<option value="3" >Suzuki ZR 50</option>	<option value="4">Yamaha DT 50 MX</option>	<option value="5">Aprilia RS 50</option>	<option value="6">Aprilia RS 250</option>	<option value="7">Aprilia RS 150</option>	</select></form></body></html>
    and can be viewed in action at Image Pop-up On Option Change Version 2

     

    Best regards,

     

    EDIT 1: Code addition that demostrates that is possibly to attach a function to the onmouseover event handler of the OPTION element but only works with Firefox.

     

    EDIT 2: Check at Image Pop-up On Option Change Version 3 the last version of this code, especially the last SELECT, but as usual it only works with Firefox.


  4. Hey!
    I am trying to do a "Admin give EXP script".
    But I can't make it work.
    The value is not updating, but the update query is correct.( I think:P)
    I think the fault is here:

    $expcomp=$givexpp['exp'] += $givexp;

    The $givexp is the variable for the amount of Xp the admin wants to give.
    the $givexpp is the variable for the user info (in this case, the experince he already have).

    The datatype for the XP in the database is INT. So I have no idea if it can take data from a normal textfield.
    If you need to see all the code, here you go:

    <?phpsession_start();include "database.php";$givexpto= mysql_real_escape_string($_POST['givexpto']);$givexp= mysql_real_escape_string($_POST['givexp']);$queryxp =("SELECT * FROM characters WHERE user='$givexpto'")or die(mysql_error());					if(mysql_num_rows(mysql_query($queryxp)) == 1)	{		$givexpp = mysql_fetch_assoc(mysql_query($queryxp));		}else{ die("User Don't Excist. Please Go Back And Try Again");}$expcomp=$givexpp['exp'] += $givexp;mysql_query("UPDATE characters SET exp='$expcomp' WHERE user='$givexpto'");header("location:index.php");?>
    Always debug your variables to verify if its values are the expected ones, you can do it simply by echoing it.

    Try this:
    <?phpsession_start();include "database.php";$givexpto= mysql_real_escape_string($_POST['givexpto']);$givexp= (int) mysql_real_escape_string($_POST['givexp']);echo $givexp;$queryxp="SELECT * FROM characters WHERE user='$givexpto'";	if(mysql_num_rows(mysql_query($queryxp))>0) {	$givexpp = mysql_fetch_assoc(mysql_query($queryxp));} else { die("User Don't Excist. Please Go Back And Try Again"); }$expcomp=$givexpp['exp'] + $givexp;mysql_query("UPDATE characters SET exp=$expcomp WHERE user='$givexpto'");header("location:index.php");exit;?>
    Best regards,

  5. did i hear wrong or are you doing something to help me ;)and btw i didn't understand a thing u said except that what i said

    No, you don't hear wrong, i'm doing a javascript to help you, and what you don't understand???

    This is the code i make that works, it is very simple and it is open to a lot of modifications:
    <html><head><title>Image Pop Up On Option Change </title><script type="text/javascript">	function showpic(o) {		o = parseInt(o);		switch (o)		{		case 1:			imgName='del.gif';break;		case 2:			imgName='doc2.gif';break;		case 3:			imgName='docempty.gif';break;		case 4:			imgName='docurl.gif';break;		case 5:			imgName='new.gif';break;		}		var DivImage = document.getElementById('DivImg');		var DisplayImg = document.getElementById('IdImg');		DisplayImg.src=imgName;		DivImage.style.visibility="visible";	}</script></head><body><form name="form2" method="post" action="race.php?action=race"><table border="1"><td>Who do you wanna race?</td></table>	<select size=5 name="bike" onchange="showpic(this.options[this.selectedIndex].value)">	<option value="1" >Derbi Senda 50</option>	<option value="2">Honda NS 50 R</option>	<option value="3" >Suzuki ZR 50</option>	<option value="4">Yamaha DT 50 MX</option>	<option value="5">Aprilia RS 50</option>	</select>-<a href="java script:launchClasses()">?</a>	<input type=submit value=Register>  	<div id="DivImg" style="position:relative;top:-50px;left:150px;z-index:20;width:25px;height:25px;visibility:hidden;text-align:center;"><img id="IdImg"></div></td></tr></form></body></html>
    Take in mind that you must change all the images -names and paths- correctly to work at your website, if you want you can view it on action at Image Pop-up On Option Change.

    Best regards,

  6. I need a script that does this:Lets say I have form with options...you surely know what that is...

    <form name="form2" method="post" action="race.php?action=race"><table border="1"><td>Who do you wanna race?</td></table>	<select size=5 name="bike">	<option value="Derbi Senda 50">Derbi Senda 50</option>	<option value="Honda NS 50 R">Honda NS 50 R</option>	<option value="Suzuki ZR 50">Suzuki ZR 50</option>	<option value="Yamaha DT 50 MX">Yamaha DT 50 MX</option>	<option value="Aprilia RS 50">Aprilia RS 50</option>	</select>-<a href="java script:launchClasses()">?</a>	<input type=submit value=Register>  </td></tr></form>
    When i put my mouse over one of them i want a picture of bike on which your mouse is on to pop up...
    I hope you understand what i mean...i can't rephrase it to be more meaningful...i tried ;)
    Well, i think that it is not possible to do that with simple HTML and Javascript because you can't attach an event handler to the OPTION element, instead you can attach an event handler to the Focus, Blur and Change events of the SELECT element. Right now i'm testing a simple code to work with the Change event, so, give some time to complete it.

    Best regards,

  7. REsolved.
    The problem was the php.ini file - the automatic configuration done by mysql isn't working properly.

    You need to add some extension caluses in the php.ini file to dynamic libraries that aren't present explicitely....I found an answer - rather a workaround here:

    http://www.tanguay.info/wamp/installPhp5.php5?step=15

    simply add the lines to php.ini:

    extension=php_mysqli.dll

    however, this libabry doesn't exists - its fictious in that it can be obtained by renaming php_mysql.dll to php_mysqli.dll (you may find them in the ext folder of your php installation directory)

    I have them both in the extension clause - now cannot be bothered as to check which one is necessary(some forums say both anyway).

    I don't know how such a bug can exists? Maybe its a third party stuff interested in promoting their software...

    You can use both extensions at the same time, i do it without problems, i never use both of them on the same script, but i use them on different scripts and never had problems.

    Now, if i remember correctly you must use the php_mysqli extension if you want to use the complete functionality offered by MySql 4.1.0 and greater versions, if not you can still use the php_mysql extension because is compatible with it.

    Best regards,

  8. Say your external sub-domain is abc.xyz.com. This domain actually maps to some sub-domain on your Xisto account like tavox.astahost.com/sub/forum/. Any URL such as abc.xyz.com/posting.php will be actually tavox.astahost.com/sub/forum/posting.php
    The thing that you need in this case is an external re-direct, if I am not mistaken. I came across one such discussion at http://forums.xisto.com/no_longer_exists/

    However, I couldn't put into work. You should give it a try.

    Another thing that could be done is that a PHP page in your external domain could forward the HTTP requests to the actual pages. Using .htaccess file any URLs for the site, such as abc.xyz.com/posting.php could be redirected to abc.xyz.com/index.php. This page would open a connection and get the actual contents from the url, say, tavox.astahost.com/sub/forum/posting.php and display the results to the browser. This should only be done as the last resort as the bandwidth usage becomes double and you'll also have to handle cookies.

    Ok, thanks for your help and the information, i will try it next monday -work is over for today- and check if it work. I hope it works.

    Best regards,

  9. First of all i don't if it is the correct place to this post so if not please an Admin or Mod move it to the correct place, thanks.Now, the situation that i have is that i want to host an external subdomain like external-subdomain.external-domain.com on my own account hosted here at Xisto, so, if any user access this external subdomain all the files and database tables are served from here. The purpose of this external subdomain will be to host a phpBB3 forum.I also have cPanel access in this external domain so i can create the external subdomain there if necesary, but i don't know how to redirect it to access to my Xisto acount.is it valid to do this????Best regards,


  10. I'm on my way to give up this script =SIt is still not working..
    If you guys can't find a solution for this(because i can't =/) Do you think I should forget this hp regen thing, and use potions instead?

    @Vujsa: You are right.. I'll do that in the future.

    Don't give up, my personal opinion is that if in one way a script don't work i start again and find the solution, that's work.

    And try the idea you get, maybe that's the solution.

    Best regards,

  11. A few years ago i use a previous version of this software called Copernic 2001 or something like that, i remember that it was a nice freeware in that days, now it changes to an adware and i don't like this kind of software, so, because of that i don't install it.

     

    Can I disable the display of advertisement banners in Copernic Agent?

     

    The display of advertisement banners in Copernic Agent is integrated in the software. However, this function is disabled in Copernic Agent Personal/Professional.

    Instead of Copernic Agent what i just download from its website is another product called Copernic Desktop Search that can be a useful tool basically as a replacement of the default search tool that comes with Windows.

     

    Anyway, thanks for the share.

     

    Best regards,


  12. If globals are not enabled then you must use the superglobals arrays like $_POST, $_GET, $_SERVER or $_SESSION, so it is very simple to make your script works again, simply add the superglobals to every variable that comes from your login page. For example:

    <?php$title = "Login"; if (!$_POST["user"] || !$_POST["pass"]) {	include "head.php";	print "Please fill out all fields.";	include "foot.php";	exit;}?>
    Here I use $_POST because it is the method that you use in your form, if you use GET then you will use $_GET instead.

    Now, register_globals is the directive that controls this functionality and it is Off by default and also it is recommended that you don't turn it On because it can lead to security problems.

    ; You should do your best to write your scripts so that they do not require; register_globals to be on; Using form variables as globals can easily lead
    ; to possible security problems, if the code is not very well thought of.

    Checking at your code i see that you use sessions, in this case, you must start your sessions before any other code in your scripts, like:
    <?php session_start();include "config.php";include "java.php";?>
    Another thing here is that you don't need to use parenthesis with include, include_once, require or require_once because they are not necessary, still it is valid.

    Best regards,

  13. It's not that ancient, it's just another old obsolete technology, just like Windows 2000. It isn't ancient, many computers worldwide still uses it ... lol. If that's ancient, then I wonder about Linux 2.2 and 2.4. Now those should be called ancient.
    xboxrulz

    Exactly, i still use windows 2000 basically because i don't have the necesary amount of time to upgrade my OS to XP or Vista. And the OS upgrading process is not as simple as it should be ;).

    Best regards,

  14. As many people know, PHP 4 is dead, it was here for the last 7 years and officialy 2007 was the last year that the PHP development team supports it and release new versions of the PHP4 series -the last stable version is 4.4.8. They will make and release new patches for the PHP 4.4 branch until 2008-08-08, but only if are related with security issues.This is not a problem here because I know that Xisto's PHP version is 5.2.0 since the last year (i'm not pretty sure if it was installed on october 19 2007) but the last stable version of PHP is 5.2.5 and as i just read at the PHP site, the PHP development team encourages all users to upgrade to this release because it fixes over 60 bugs.So, here is my question, does Xisto plans to upgrade to this release soon??? and if it is true, i wanna know when does it will take place, basically to backup my data allocated here.BTW, if it is not the correct place of this post please an Admin or Mod move it to the correct place.Finally, good bye PHP 4, nice to meet you.Best regards,


  15. I did that :P Thanks ;) It is working now.. but as always, I am having a new problem :PThe value in the database is not updating :S
    here the code for the update, should'nt it work =?

    $SeUs = $_SESSION['user'];$PoUS = $_POST['atkuser'];mysql_query ("UPDATE characters SET temphealth =\"{$currentHealthYou}\" WHERE user =\"{$SeUs}\"");mysql_query ("UPDATE characters SET temphealth = \"{$currentHealthEnemy}\" WHERE user =\"{$PoUs}\"");
    You can use the session variable directly in your code, instead of escaping your strings simply use a single quote ('), also, to prevent sql injections use the mysql_real_escape function with the data posted to your script.

    And personally i always attach a die() function with the mysql_error() function to every query i make to check if every thing works fine.

    Try the following:

    <?php$PoUS = mysql_real_escape_string($_POST['atkuser']);mysql_query ("UPDATE characters SET temphealth='$currentHealthYou' WHERE user='" . $_SESSION['user'] ."'") or die(mysql_error() );mysql_query ("UPDATE characters SET temphealth = '$currentHealthEnemy' WHERE user ='$PoUs'") or die(mysql_error());?>

    Best regards,

  16. Hey!I've made a register script.. Some time ago it worked. And I ain't sure if I changed something since then..
    The error I am getting is this:
    Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/feelay/public_html/regcheck.php on line 31
    Here is the code on theese lines:

    $sqlCheckForDuplicate = "SELECT username FROM user WHERE username = '". $username ."'";				if( mysql_num_rows( mysql_query( $sqlCheckForDuplicate ) ) == 0 )		{			$sqlRegUser = 	"INSERT INTO						user( username, password )					VALUES(						'". $username ."',						'". $password ."'						)";			if( !mysql_query( $sqlRegUser ) )			{				$feedback[] = 'You Could Not Register Because Of An Unexpected Error.';			}

    Any Idea What I've made wrong. And maybe anyone can tell me when mysql_num_rows errors occure.

    Thank You For You're Help

    //Feelay
    You got that error because your query returns FALSE and the mysql_num_rows() function expects a valid result set, in this case it means that it is a new user and is valid to register, to work, try this code instead:

    <?php$sqlCheckForDuplicate = "SELECT username FROM user WHERE username = '". $username ."'";$result = mysql_query($sqlCheckForDuplicate) or die(mysql_error());if(mysql_num_rows($result)>0){	$feedback[] = 'You Could Not Register Because the User already exists.';}else{	$sqlRegUser = "INSERT INTO user(username, password) VALUES('$username','$password')";	if(!mysql_query($sqlRegUser))	{		$feedback[] = 'You Could Not Register Because Of An Unexpected Error.';	}}?>
    Best regards,

  17. That works, it doesn't show the error!

     

    Except... it's still stopping the modules and component and the Joomla header and everything else after it from loading.

     

    Which basically means that when Habbo is down, my site is down which is quite annoying. I know other fansites use the same code and it doesn't do it for them, but they aren't using a CMS, the most they use is Cutenews for their news.

     

    Anyone know how to make it load other things? PHP (well the Joomla things) and anything (content and images etc) after the code doesn't show.

    I guess that it stops because you use the die() function, the file_get_contents() function returns a string with the contents of the file on success and FALSE on failure, so, instead try the following:

    <?phperror_reporting(0);  // Disable Error Reporting$online = file_get_contents("http://www.habbo.com/habbo_count_xml.action;; // Turn it back onif ($online) {  $onlinee = trim(strip_tags($online));  echo $onlinee;}?>
    Best regards,

  18. In your second function you have a typo in document,write(Z); simply replace it with the following code:

    document.write(Z);
    But, when you executes this function you got an error and only works one time, so if your intention is to concatenate all the elements (values and texts) of the select in one string and then write it to the document -your Z variable- change your function to:
    function basicFiles1() {	var Z = new String("");	for (i = 0; i < document.Form.regionlist.options.length; i++) {		var x = document.Form.regionlist.options[i].value;		var y = document.Form.regionlist.options[i].text;		Z = Z + "regions" + "[" + x + "]" + " = " + y + ", ";	}	Z = Z.substr(0,(Z.length-2));	document.write(Z); 	//window.close();}
    Hope it helps and is what you need.

    Best regards,

  19. I don't think so. Here is my code. Its a very simple code just to see if I can ever establish a connection with my database:

    function open_connection() {		$host='localhost:3307';		$user='any';		$db='my_db';		$password='my_pass';		$conn=mysql_connect($host,$user,$password);		mysql_create_db ($db,$conn);		mysql_select_db($db);	return $conn;}

    If I call this function within my file I get the error:

    Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server during query in
    As far as i know you use the port 3306 when you want to connect to a MySql host, not to the port that you specify, in this case 3307, also, you don't need to specify this on your connection scripts. So, change it to 3306 or delete from your code.

    Also, add to your code the mysql_error() function to check when you lost the connection and verify that in first case you get connected to the server:
    function open_connection() {		$host='localhost';		$user='any';		$db='my_db';		$password='my_pass';		$conn=mysql_connect($host,$user,$password);		if (!$conn) {		  die('Could not connect: ' . mysql_error());		}		mysql_create_db ($db,$conn) or die('Could not connect: ' . mysql_error());		mysql_select_db($db);	return $conn;}

    Another problem is that according to the PHP online manual the mysql_create_db() function is obsolete and recommends to use the mysql_query() function instead.

    Best regards,
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.