Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

posting variable into function doesnt work

Posted on 2009-03-31
Last Modified: 2012-05-06
hi all posting my variable $error into the showform function doesnt seem to work, can anyone tell me why?

function ShowForm($error) {
<div class="text">
<h2>Staff Log In </h2>
<form id="form" method="post" action="/includes/login.php" class="menu">
  <table width="544">
      <td><input name="txtUserName" type="text" size="20"  /></td>
      <td rowspan="5">&nbsp;</td>
      <td>Password:</td><td><input name="txtPassword" type="password" size="20" /></td>
       <td><input name="submit" type="submit" value="Login" /></td>
        <td colspan="2"><?php echo $error; ?></td>
      <td colspan="2">Lost your password? <a href="/admin/lostpass.php">Click Here</a></td>
switch(@$_GET["action"]) {
Case "adminonly":
include($_SERVER['DOCUMENT_ROOT'] . '/includes/connection.php');
include($_SERVER['DOCUMENT_ROOT'] . '/includes/header.php');
$error = '<span style="padding-top:30px; color:#FF0000; ">';
$error .= '<strong>Error:</strong><br /> You need to be a member of staff to access these pages.';
$error .= '</span>';

Open in new window

Question by:awilderbeast
LVL 143

Accepted Solution

Guy Hengel [angelIII / a3] earned 500 total points
ID: 24027283


Author Closing Comment

ID: 31564746
ahhh yes how silly of me :)

thankyou :)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Decrypt string by php 7 47
Moving from Mcrypt to OpenSSL 18 46
Ajax php search with multiple text fields generated by php 38 71
Reference key in foreach loop 4 21
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question