0

My goal is to create a social network share button on job seeker website.

The idea is that jobs are published according to agent and the job ids, so i will like to share this job on social network.

Example

Share button

<a href="https://twitter.com/intent/tweet?source=webclient&text=<?php echo "You may have experience of the following: Junior Web Developer, Technical Support, .Net, PHP, C#, Trainee Developer, IT Support, Helpdesk, Web Designer, Content Manager, CMS, Wed Editor, ASP.Net, VB.Net, Online Content Editor etc."."     ".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']?>">SHARE</a>

Expected Result Sample

You may have experience in this following: Junior Web Developer, Technical Support, .Net, PHP, C#, Trainee Developer, IT Support, Helpdesk, Web Designer, Content Manager, CMS, Wed Editor, ASP.Net, VB.Net, Online Content Editor etc. dayjob.com/?j=4&Agent=rayJ345

==

The trouble is, when this button is click it produce some like this in which anything after dayjob.com/?j=4 is eliminated or not included.

In nutshell i am getting dayjob.com/?j=4 instead of dayjob.com/?j=4&Agent=rayJ345

Thank you in advance .

Simlofi
  • 95
  • 2
  • 11

1 Answers1

0

You need to urlencode the string you're passing. Try this:

<a href="https://twitter.com/intent/tweet?source=webclient&text=<?php echo rawurlencode("You may have experience of the following: Junior Web Developer, Technical Support, .Net, PHP, C#, Trainee Developer, IT Support, Helpdesk, Web Designer, Content Manager, CMS, Wed Editor, ASP.Net, VB.Net, Online Content Editor etc."."     ".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']); ?>">SHARE</a>

But also keep in mind that tweets shouldn't be longer than 140 characters.

Malcolm Diggs
  • 455
  • 2
  • 7