DNA180 Posted February 5, 2012 Share Posted February 5, 2012 Hello guys... I have a problem here. I am trying to put a link into a php variable and it isn't show up. Here is what I am trying to do: $text .= "<span><a href='index.php?option=com_alphauserpoints&view=account&userid=".$data."&Itemid=24'><div id='UserProfile_Normal' onMouseOver= id='UserProfile_MOver' onMouseOut= id='UserProfile_MOut' title='None' alt='profile'> </div></a></span>"; Does anybody find something wrong on syntax or something??? Thank you in Advance!!! Link to comment Share on other sites More sharing options...
Ingolme Posted February 5, 2012 Share Posted February 5, 2012 The PHP isn't the problem. It's the HTML. First of all, you can't have <div> elements inside <a> elements. If you want a block link, then use CSS to make it a block. The second thing: Your onMouseOver and onMouseOut attributes look empty to the browser because their values aren't within quotation marks. The other thing is that if you want to change properties of the specific element you need to use this. onmouseover="this.id='UserProfile_MOver'" Link to comment Share on other sites More sharing options...
DNA180 Posted February 5, 2012 Author Share Posted February 5, 2012 I don't know if I can't have <div> element inside <a> in this case, but in other case I have done this and worked!!!Here is an example: <table height='100%' width='auto' border='0' cellspacing='0' cellpadding='0'> \n\<tr> \n\<td> <a href='index.php?option=com_content&view=frontpage&Itemid=2'> \n\<div id='HomeNormal' onMouseOver= id='HomeMOver' onMouseOut= id='HomeMOut' title='none' alt='home'> </div></a> </td> \n\</tr> \n\</table> \n\ Anyway... I'll do as you said it looks more logical. But what should I do with the <a>??? Even if I add it like this: <a href="...">Something</a> without <div> etc, it isn't show up again!!! Thank you for your answer!!! Link to comment Share on other sites More sharing options...
Ingolme Posted February 5, 2012 Share Posted February 5, 2012 You should check the source code of the page to see if it's being printed. If appears in the source code then the problem is CSS, if not then the problem is PHP. You might be overwriting the variable before printing, or printing a different variable. You haven't shown enough PHP to determine what the problem is. Link to comment Share on other sites More sharing options...
DNA180 Posted February 5, 2012 Author Share Posted February 5, 2012 Here is the files!!! I am working in file freichat.php and what I have change is from line 524 to 542!!! Link to comment Share on other sites More sharing options...
Ingolme Posted February 5, 2012 Share Posted February 5, 2012 You said you tried a link with text in it. Can you show the code you used? Link to comment Share on other sites More sharing options...
DNA180 Posted February 5, 2012 Author Share Posted February 5, 2012 Yes, as I wrote before I also try something like this <a href="...">Something</a> but nothing!!! Link to comment Share on other sites More sharing options...
Ingolme Posted February 5, 2012 Share Posted February 5, 2012 What does the PHP syntax look like? That's not PHP. Link to comment Share on other sites More sharing options...
DNA180 Posted February 5, 2012 Author Share Posted February 5, 2012 Where do you see this??? Link to comment Share on other sites More sharing options...
Ingolme Posted February 5, 2012 Share Posted February 5, 2012 The code you just showed me is not PHP, it's HTML. This is PHP: $text = "<a></a>"; What does your PHP code look like? Link to comment Share on other sites More sharing options...
DNA180 Posted February 5, 2012 Author Share Posted February 5, 2012 Come on... If you see my first post you will understand lol!!! Anyway... No problem, I'll look for it somewhere else... Thank you!!! Link to comment Share on other sites More sharing options...
thescientist Posted February 7, 2012 Share Posted February 7, 2012 if you've made changes, the post the changes. that's all he was asking for. we don't assume what people write, since usually, since they are here, something is wrong the code itself is incorrect. Link to comment Share on other sites More sharing options...
boen_robot Posted February 11, 2012 Share Posted February 11, 2012 The code in your first post $text .= "<span><a href='index.php?option=com_alphauserpoints&view=account&userid=".$data."&Itemid=24'><div id='UserProfile_Normal' onMouseOver= id='UserProfile_MOver' onMouseOut= id='UserProfile_MOut' title='None' alt='profile'> </div></a></span>";echo $text; is a PHP code that generates the HTML code <span><a href='index.php?option=com_alphauserpoints&view=account&userid=someData&Itemid=24'><div id='UserProfile_Normal' onMouseOver= id='UserProfile_MOver' onMouseOut= id='UserProfile_MOut' title='None' alt='profile'> </div></a></span> (assuming $data = "someData")You then say you have generated the HTML code <a href="...">Something</a> But what PHP code did you generated that HTML code with? That's the question. And also if you've checked the full generated code and verified this is truly part of it (rather than it being part of the PHP code). Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.