Jump to content

[SOLVED] Need help with quotes


nunos

Recommended Posts

Hi. I haven't been able to echo a HTML piece of code from PHP due to quotes issues.

 

This is the html code I want to echo:

<td><a onclick="reenviar_email(<?php echo "'$row->email'";?>)">asd</a>

 

Here are my PHP attemps:

<?php echo '<td><a onclick="reenviar_email(' . $row->member_id . ')">asd</a>'; //works, shows box with member_id ?>
<?php echo '<td><a onclick="reenviar_email(' . $row->email . ')">asd</a>'; //doesn't work, doesn't show any box ?> 

 

Javascript function:

function reenviar_email(a)
{
var r=confirm("Reenviar o mail de activação?");
if (r==true)
  		{
	alert(a);		
  		}
}

 

I have tried almost all combinations of different quotes and still haven't managed to succeed. I would appreciate any help on this.

 

Note: $row->member_id is a number whereas $row->email is a string. I can't see how this can affect the call to the function.

 

Thanks  ;)

Link to comment
Share on other sites

<td><a onclick="reenviar_email('<?php echo $row->email;?>')">asd</a>

 

Thanks for you reply. I appreciate your response but what I was looking for is how to call this piece of html from an echo in php, that's where the problem is. :shrug:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.