Jump to content

Recommended Posts

hi i enter the following in my textarea

http://www.fantasy-comps.com
http://www.allinthissite.co.uk

and then i submit to this process

session_start();

include('../../../include/include.php');

$websites = $_POST['websites'];

$websites = explode("\n", $websites);

foreach($websites AS $websites)
{

$websites_strip = StripUrl($websites);

$websites_add_sql = "INSERT INTO websites(websites_id,websites_user,websites_url,websites_url_letter,websites_hits,websites_date,websites_paid ) VALUES('','$session_id','$websites','$websites_strip','0',NOW(),'0')";
$websites_add_row = mysql_query($websites_add_sql);

}

but it enters

fantasy-comps.com
allinthissite.co.uk_

in my database

any ideas why the _ after allinthissite.co.uk

?
Link to comment
https://forums.phpfreaks.com/topic/35372-textarea/
Share on other sites

This part is not recommended:
foreach($websites AS $websites)

You can use the same variable name both for the array and for the values, but this may cause many misunderstandings...
Use:
foreach($websites AS $website)
and make the changes needed accordingly.

Now, as complex05 said, how does StripUrl() function look like? At may be the fact you are exploding by \n and a carriage return character is still in place.

Orio.
Link to comment
https://forums.phpfreaks.com/topic/35372-textarea/#findComment-167191
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.