php


How to call a php function? [closed]


how do I call this function to my html page I where I want the forms to appear?
<?php
function login_bar() {
global $user;
if ($user->uid == 0 ) {
$form = drupal_get_form('horizontal_login_block');
return render($form);
} else {
// you can also integrate other module such as private message to show unread / read messages here
return '<div id="loginbar"><p>' . t('Welcome back ') . ucwords($user->name) . '<p></div>';
}
}
?>
In form tag of your HTML page
<form type="post" action="test.php">
// test.php
<?php
function login_bar() {
}
// if you want to call the function on some button click
if(isset($_POST['submit']))
{
login_bar();
}
?>
HTML page won`t process PHP call. Change your page to page.php and then call login_bar();

Related Links

search highlight string with and without Arabic Diacritic characters
Woocommerce - How to get products which have a sale between two percents?
PHPMailer fails when try to send 2 mails
php - How to show a pop-up thank you message instead of another page
How to make a username entries required to be unique with php
Adding a link to click a new button on the form [duplicate]
How to bypass CloudFlare rocket script if wp_enqueue_script is used to add scripts?
Image path upload and displaying image in mysql
fusionchart in php are not showing
php built in webserver not reacheable with ip:port via network cable
I cant get value of the radio button Except first radio button
Edit iframe content using PHP, and preg_replace()
PMPRO Wordpress plugin Membership Cancellation Errors (stripe)
Android HttpURLConnection Post Data, PHP App Server can't receive data
compare todays date with the date in the mysql table using codeigniter
Get all possible combinations without duplicates

Categories

HOME
rust
freeradius
xcode8.1
devexpress
dafny
plaid
out-of-memory
greasemonkey
tfs2015
cdi
polymer-2.x
roku
locationmanager
watch-os-3
documentum
jpa-2.0
android-5.1.1-lollipop
uima
angular2-highcharts
node-webkit
social-tables
error-logging
kaggle
generator
web-push
hdmi
php-5.3
django-import-export
amazon-cloudtrail
series
caesar-cipher
shapeless
sql-execution-plan
devtools
android-canvas
amazon-kms
rails-postgresql
wdk
ms-dos
telephonymanager
grunt-contrib-watch
utf
python-jira
uipickerview
dagger
google-prediction
fluid-mac-app-engine
dbcc
apache-toree
daz3d
gcal
cloudwatch
exc-bad-access
nslayoutconstraint
portability
gmaps.js
google-identity-toolkit
ndk-build
nvda
gcloud-node
traversable
coovachilli
univocity
voronoi
google-maps-api-2
search-form
modern.ie
erlog
android-audiomanager
createfile
sql-processor
comctl32
n-tier-architecture
encryption-symmetric
igor
csslint
stripe.net
property-injection
jomsocial
meteorite
proxy-server
facebook-game-groups
unrealscript
codahale-metrics
lru
delphi-xe4
user-forums
zend-pdf
nsmutablestring
image-formats
msinfo32
type-safety
snackjs
radscheduler
canonicalization
css-friendly
mygeneration
asdoc
rational-unified-process
firephp
wmd-editor
database-cloning
error-detection
synthesizer

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App