brown2005 Posted January 23, 2007 Share Posted January 23, 2007 hi i enter the following in my textareahttp://www.fantasy-comps.comhttp://www.allinthissite.co.ukand then i submit to this processsession_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 entersfantasy-comps.comallinthissite.co.uk_ in my databaseany ideas why the _ after allinthissite.co.uk? Link to comment https://forums.phpfreaks.com/topic/35372-textarea/ Share on other sites More sharing options...
complex05 Posted January 23, 2007 Share Posted January 23, 2007 what does your 'stripurl' function look like? Link to comment https://forums.phpfreaks.com/topic/35372-textarea/#findComment-167169 Share on other sites More sharing options...
brown2005 Posted January 23, 2007 Author Share Posted January 23, 2007 ill have a look for it, but its not that because when i echo sayStripUrl($website_id); on the id for http://www.allinthissite.co.uk on other parts of the site it comes out fine as it should like allinthissite.co.uk Link to comment https://forums.phpfreaks.com/topic/35372-textarea/#findComment-167178 Share on other sites More sharing options...
Orio Posted January 23, 2007 Share Posted January 23, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.