Jump to content

[SOLVED] implode() error


NickG21

Recommended Posts

when i try executing this code i get the error:Warning: implode(): Bad arguments. in .../testing1.php on line 16
and i am unable to print any of the error messages included.  can anyone help out?
thank you


[code]<?php

if (isset($_POST['submit'])) {
$email = $_POST['email'];
$name = $_POST['text1'];
$number = $_POST['text2'];
$error = array();

// check e-mail address
// display success or failure message
if (!preg_match("/^([a-zA-Z])+/",$_POST['text1'])) $error[] = "Your Name May Only Contain Letters";
if (!preg_match("/^([0-9])+/",$_POST['text2'])) $error[] = "Invalid ZipCode, Please Re-Enter";
if (!preg_match("/^([a-zA-Z0-9])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $_POST['email'])) $error = "Invalid E-Mail Address";
if (count($error)>0)
{
$msg = "<p class=\"error\">The following errors occurred:<br />\n" . implode("<br />\n", $error). "</p>\n";
}
else
{
echo isset($msg) ? $msg: 'Thank You, Your Information Has Been Accepted';
}
}
?>[/code]
Link to comment
https://forums.phpfreaks.com/topic/31520-solved-implode-error/
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.