Jump to content

How can i do this?


cirkos

Recommended Posts

Hi guys, i'm not the best php programmer so i have done some ousoursing,

 

Okay i want people to see this code

 

http://mywebadress.com/danish/index.php?user_id='.$_SESSION['f_id']"

 

As

http://mywebadress.com/danish/index.php?user_id=(Therir user id)"

Like

http://mywebadress.com/danish/index.php?user_id=21

 

How can i do that, thanks.

Link to comment
https://forums.phpfreaks.com/topic/99626-how-can-i-do-this/
Share on other sites

This is my tell a friend system when its working as you can see when people type in 5 emails and press send theire gonna send an email with their refferal link, but i also want so people can see their refferal link in text, so the for example can send it via messenger or link it on a webpage

 

<?php

ob_start();

session_start();

require_once("config/config.inc.php");

require_once("config/functions.inc.php");

@extract($_POST);

if($_REQUEST['base'])

{

$base=$_REQUEST['base'];

}

if($submit=="1")

{

$headers = "From: [email protected]\r\nContent-Type:text/html";

//$email1

$to      = '[email protected]';

$subject = 'Pengesafari Info';

$message = 'Hi '.$name.'here<br>';

$message .='I have come across a site that gives you Cashback when you shop at many of your favourite online stores. You can earn up to 30% Cashback on your purchases at stores such as Tesco, M&S, John Lewis and Currys. Its FREE to join and they are even giving you £5.00 FREE when you sign up.';

$message .='Click the link below<br><br>';

//http://67.159.44.19/~magiecom/clients/pengesafari/'.$base.'"?userid="'.$_SESSION['f_id'].'

$message .='<a href="http://umit/pengesafari/danish/index.php?user_id='.$_SESSION['f_id'].'" target="_blank">Click Here</a><br><br>';

$message .='Posted By<br>';

$message .=$name;

 

//echo $message;

//echo $to, $subject, $message, $headers;

@mail($to, $subject, $message, $headers);

if($email2!='')

@mail($email2, $subject, $message, $headers);

if($email3!='')

@mail($email3, $subject, $message, $headers);

if($email4!='')

@mail($email4, $subject, $message, $headers);

if($email5!='')

@mail($email5, $subject, $message, $headers);

 

$msg="Your Mail has been send to the respective friends";

 

}

?>

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>pengesafari.com</title>

<style type="text/css">

<!--

body {

margin-left: 0px;

margin-top: 0px;

margin-right: 0px;

margin-bottom: 0px;

}

-->

</style>

<script language="JavaScript" type="text/JavaScript">

 

function validEmailAddress(email)

{

invalidChars = " /:,;~"

if (email == "")

{

return (false);

}

for (i=0; i<invalidChars.length; i++)

{

badChar = invalidChars.charAt(i)

if (email.indexOf(badChar,0) != -1)

{

return (false);

}

}

atPos = email.indexOf("@",1)

if (atPos == -1)

{

return (false);

}

if (email.indexOf("@",atPos+1) != -1)

{

return (false);

}

periodPos = email.indexOf(".",atPos)

if (periodPos == -1)

{

return (false);

}

if (periodPos+3 > email.length)

{

return (false);

}

 

return (true);

}

function check()

{

document.friend.submit();

}

function validate(obj)

{

 

var msg='Incomplete data! Kindly give Required information.\n\n', flag=false;

 

if(obj.name.value == '') msg+='- Please enter Your Name. \n';

 

if(obj.email1.value == '') msg+='- Please enter Friend Email-1. \n';

 

else if(!validEmailAddress(obj.email1.value)) msg+='- Please enter valid email address for Friends Email-1. \n';

if(obj.email2.value!='')

{

if(!validEmailAddress(obj.email2.value)) msg+='- Please enter valid email address for Friends Email-2. \n';

}

if(obj.email3.value!='')

{

if(!validEmailAddress(obj.email3.value)) msg+='- Please enter valid email address for Friends Email-3. \n';

}

if(obj.email4.value!='')

{

if(!validEmailAddress(obj.email4.value)) msg+='- Please enter valid email address for Friends Email-4. \n';

}

if(obj.email5.value!='')

{

if(!validEmailAddress(obj.email5.value)) msg+='- Please enter valid email address for Friends Email-5. \n';

}

if(msg == 'Incomplete data! Kindly give Required information.\n\n')

return true;

else{

alert(msg);

return false;

}

}

</script>

<link href="css/style.css" rel="stylesheet" type="text/css">

</head>

 

<body  background="#ffffff">

<table width="49%"  border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" align="center">

  <tr>

    <td align="center" valign="top"><table width="423">

<tr>

            <td width="415" align="center" valign="top" style="padding-top:10px; "><table style="border:1px solid #a3a3a3; " width="100%"  border="0" cellspacing="0" cellpadding="0">

              <tr>

                <td align="left" valign="top" >

<form name="friend" method="post" onSubmit="return validate(this)">

 

<table width="100%"  border="0" cellspacing="0" cellpadding="0">

<tr >

<td  align="left" colspan="2" valign="middle" bgcolor="#83D560"height="28" style="padding-left:14px; "><img src="images/tell_a_friend_txt.jpg" width="86" height="15"></td>

</tr>

<?php if($msg)

{?>

<tr>

<td colspan="2"> </td>

  </tr>

<tr>

<td  align="center" valign="top" class="black_txt" colspan="2"><?php echo  $msg;?></td>

 

</tr>

<? } else

{?>

<tr><td align="center" colspan="100%" class="warning" valign="middle"> </td></tr>

<tr>

<td  align="right" valign="top" class="black_txt" style="padding-top:8px; padding-right:8px;"><b>Your name</b></td>

<td align="left" valign="top"> <input type="text" name="name"></td>

</tr>

<tr>

<td  align="right" valign="top" class="black_txt" style="padding-top:8px; padding-right:8px;"><b>Friends Email-1</b></td>

<td align="left" valign="top"> <input type="text" name="email1"></td>

</tr>

<tr>

<td  align="right" valign="top" class="black_txt" style="padding-top:8px; padding-right:8px;"><b>Friends Email-2</b></td>

<td align="left" valign="top"> <input type="text" name="email2"></td>

</tr>

<tr>

<td  align="right" valign="top" class="black_txt" style="padding-top:8px; padding-right:8px;"><b>Friends Email-3</b></td>

<td align="left" valign="top"> <input type="text" name="email3"></td>

</tr>

<tr>

<td  align="right" valign="top" class="black_txt" style="padding-top:8px; padding-right:8px;"><b>Friends Email-4</b></td>

<td align="left" valign="top"> <input type="text" name="email4"></td>

</tr>

<tr>

<td  align="right" valign="top" class="black_txt" style="padding-top:8px; padding-right:8px;"><b>Friends Email-5</b></td>

<td align="left" valign="top"> <input type="text" name="email5"></td>

</tr>

 

<tr >

<td align="center" valign="top" class="black_txt" colspan="2" style="padding-top:10px; " >

<input type="hidden" name="submit" value="1">

<input type="image" src="images/submit_btn.jpg"  vspace="5" onClick="check()"></td>

</tr>

<? } ?>

</table>

</form>

</td>

              </tr>

            </table></td>

  </tr>

</table></td>

  </tr>

</table>

</body>

</html>

 

Link to comment
https://forums.phpfreaks.com/topic/99626-how-can-i-do-this/#findComment-509675
Share on other sites

Easy, easy! Just the one line would have sufficed with a syntax error :)

 

$message .='<a href="http://umit/pengesafari/danish/index.php?user_id='.$_SESSION['f_id'].'" target="_blank">Click Here[/url]

 

';

 

That's your problem. Look at what you're doing, double quotes inside single quotes? Try this:

 

$message .= "<a href=\"http://umit/pengesafari/danish/index.php?user_id=".$_SESSION['f_id']."\" target=\"_blank\">Click Here</a>";

 

\" escapes the double quotation marks so they don't terminate the string.

 

Bryan

Link to comment
https://forums.phpfreaks.com/topic/99626-how-can-i-do-this/#findComment-509694
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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