Jump to content

Couple string related questions


python72

Recommended Posts

I am trying to store website address in a variable but when I do so the dots in the address are missing. I guess it takes it as string concatenation, for example:

$address='www.lottocomplete.com';

will actually give me: wwwlottocompletecom

How can I make sure these dots will be preserved?

 

I am also trying to store email address in a variable but I get error, something about @ symbol being in wrong spot, wonder how this can be resolved as well.

 

One more questions relates to the new line issue that I have when I concatenate string, for example if I do the following:

 

$string = "1\n";
$string .= "2\n";
$string .= "3\n";

 

I would think that each number would be printed on new line but instead it shows up as: 123

 

What am I doing wrong?

Link to comment
Share on other sites

Here is the code, when I receive the email the dots in the website address are missing.

		if(@mysql_query($sql)){
		$yoursite = 'www.lottocomplete.com';
		$webmaster = 'Webmaster';
		$youremail = 'webmaster@lottocomplete.com';

		$subject = "You have successfully registered at $yoursite...";
		$message = "Dear $previousfname, you are now registered at our web site.  
    			To login, simply go to our web page and enter in the following details in the login form:
    			Username: $previoususername
    			Password: $previouspassword
    
    			Please print this information out and store it for future reference.
    
    			Thanks,
    			$webmaster";
    
		mail($previousemail, $subject, $message, "From: $yoursite <$youremail>\nX-Mailer:PHP/" . phpversion());

		//$urlname = urlencode($$_POST['username']);
            header("location: www.lottocomplete.com/registered/thankyou.php");
	}
	else{
		$errormessage = "Your information was not entered into our database.\n
				    Please check your information and try again.";
	}

Link to comment
Share on other sites

When I use the following:

 

echo "$yoursite";

 

The address is displayed properly with dots in it, I guess it has something to do with the emailing, do you have any idea what can cause it?

 

When I try to save email addres in variable I get error message related to @ symbol,  how should this be done, I am trying to do the following:

$email='webmaster@lottocomplete.com';

Link to comment
Share on other sites

Pikachu,

Not sure what was the problem but now everything is working ok. The dots show in my website address and it takes the email without a hitch, I guess there is something else causing erratic errors, will have to investigate that before I progress any further.

Thanks a lot for all your help.

 

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.