Hi All,
I'm trying to assign the following variables being imported via csv with the fgetcsv function. How can I get each comma separated value of each line assigned to the following and then loop through them executing a submit form? 😕
blog[domain]
blog[title]
blog[email]
I'm trying to automate the process of the following php form by importing values via a csv file and then submit a form action to myblogs.php.
//<form name="addform" method="post" action="myblogs.php?action=addblog">
[COLOR=DarkRed]//<input name="blog[domain]" type="text" title="Domain"/>
//<input name="blog[title]" type="text" title="Title"/>
//<input name="blog[email]" type="text" title="Email"/>
//<input type="submit" name="go" value="Add Blog" />[/COLOR]
//</form>
<?php
$row = 1;
$handle = fopen("test.csv", "r");
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) {
$num = count($data);
echo "<p> $num fields in line $row: <br /></p>\n";
$row++;
[COLOR=DarkRed]for ($c=0; $c < $num; $c++) {
echo $data[$c] . "<br />\n";[/COLOR]
}
}
fclose($handle);
?>
Thank You! -Troy