Jump to content

textarea


brown2005

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

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.