/    Sign up×
Community /Pin to ProfileBookmark

get data from a form

if a client form is filled out but there EEE is not filled out and i visit there page… how can i write a variable that says … check the field ‘EEENUMBER’ in the input and if it’s blank than echo an alert Must have EEE NUMBER…

[code=php]<tr><td>EEE</td><td><?php inp(‘EEENUMBER’); ?></td></tr> <?php if ($EEENUMBER <= 0) {
echo “Must have EEE NUMBER.”;
}
?> [/code]

please help on this easy task.. I’ve gone brain dead today. Thanks in adavance.

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SupplementauthorDec 18.2012 — [code=php] <?php $_GET["DEANUMBER"]; if ($_GET['DEANUMBER <= 0']) {
echo "must have dea number";}

elseif ($_GET['DEANUMBER > 0']) {
echo "all is good";
}
?>[/code]



couldn't get this to work...

need to echo an alert if there is not data in the field and do nothing if there is data..


Help please.
Copy linkTweet thisAlerts:
@SupplementauthorDec 18.2012 — the result is not a number it's a string... this finally worked for me... plus i had a syntax error i didn't see...



[code=php]$_GET["DEANUMBER"]; if (!$_GET['DEANUMBER'])
{
echo "must have dea number";
}
else
{
echo "all is good";
} [/code]



How do i apply this script to a particular sql select statement

like this one:

select * from event.apo.patient_dg() where primname like '%RX%'
Copy linkTweet thisAlerts:
@NogDogDec 19.2012 — First, just want to mention that this little bit is sort of non-code: it does not do anything (unless it might throw a notice-level warning if $_GET['DEANUMBER'] is not set):

[code=php]
$_GET["DEANUMBER"];
[/code]

If we want to get really defensive about things:
[code=php]
$errors = array();
if( ! isset($_GET['DEANUMBER']) or trim($_GET['DEANUMBER'] === '') {
$errors[] = "DEA Nbr. must be entered.";
}
$deaNbr = trim($_GET['DEANUMBER'];
if( ! ctype_digit($deaNbr) {
$errors[] = 'DEA Nbr. must be all numbers.';
}
if( ! empty($errors)) {
// output error page, using $errors[] to get error message(s)
}
else {
// go ahead and process request
}
[/code]
Copy linkTweet thisAlerts:
@SupplementauthorDec 19.2012 — Another question... it's a mix of jquery and php strings..

I have 5 sql tables that i'm displaying results from, I've written a jquery statement that calls out the div parent and first children and parents table .siblings..

like so:

[CODE]$("#phone_book tr").click(function(){
var id = $(this).children().first().html();
var type = $(this).parents('table').siblings('div.module_header').html();
//alert(type);
window.location.href='index.php?q=patient/demographics/armdme&'+ patient + '=<?php $patient_id; ?>' '+ doctors + ' '+referral+ ' etc etc.... [COLOR="#DDA0DD"]<confused on the url string here.[/COLOR]

});
});[/CODE]


So when users hover it allows them to know what div category they're searching... well the window.location.href event needs to visit the correct card based on their selection..

my categories are patients, doctors, alt doctors, referral, pharmacys...

here's my code:

[code=html] <div id='phone_book'>

<?php
echo "<div>";
echo "<div class='module_header'> Patients</div>";
echo lookup_gen::query_results_table("Select TOP 10 code, last + ', ' + first as name, phoneday, phonenight, cellnumber as Cell_Phone FROM " . event_table('patient_dg()') . " WHERE (phoneday is not null and phoneday <> '') or (phonenight is not null and phonenight <> '')");
echo "</div>";


echo "<br /><br />";
echo "<div class='module_header'> Doctors</div>";
echo lookup_gen::query_results_table ("Select TOP 10 CODE_, Last_ + ', ' + First_ as name, phone, fax FROM WARE.APS.FDME");
echo "<div class='fj'> - Alternative Address - </div>";
echo lookup_gen::query_results_table ("Select TOP 10 doctor_id, phone, fax FROM event.dbo.docr_alt_address WHERE (phone is not null and phone <> '') or (fax is not null and fax <> '')");

echo "<div>";
echo "<br /><br />";
echo "<div class='module_header'> Referral</div>";
echo lookup_gen::query_results_table ("Select TOP 10 CODE_,NAME_ as name, phone, fax FROM ARE.APS.RFDM");
echo "</div>";


echo "<div>";
echo "<br /><br />";
echo "<div class='module_header'> Pharmacy</div>";
echo lookup_gen::query_results_table ("Select TOP 10 id, name, call_back as Phone, fax_back as Fax FROM phar.dbo.chain");
echo "</div>";
?>
</div>[/code]
×

Success!

Help @Supplement spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...