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

modify an array inside another array
Get text and link from anchor tag by regex [duplicate]
I want to customize a wp slider, i dont want to use the 1 by 1 line, i want to use a loop
PHP - Re-arrange multi-array so that certain combinations have the same key(index)
ldap search trying to retrieve memberUid under some ou value
PHP multidimensional array x HasOffers
How to properly load custom package in Laravel?
Laravel redirect to mobile site
Shpinx results not returning matches after spaces
Are php's zlib_encode() and zlib_decode not opposite?
Use image ACF with get_previous_post
Laravel validation name without polish letters
PHP - Calling methods whose names are stored in variables
how to generate barcode in laravel with size limit
Running a bash script using php
NumberFormatter Error at Live Server

Categories

HOME
qt
rust
typelite
shinyapps
yahoo-weather-api
adfs3.0
barcode-scanner
redmine
plaid
initialization
nsis
openflow
elk-stack
tibco
dji-sdk
polymer-2.x
createjs
google-cloud-logging
mixpanel
string-formatting
significance
parceler
bsd
uislider
device
dragula
managed-c++
router
bonita
fusion
jsonresult
es6-modules
matlab-app-designer
commonsware-cwac
knights-tour
android-collapsingtoolbar
adminer
cups
installanywhere
mv
gitolite
hypothesis-test
adblock
rightnow-crm
uiautomatorviewer
lightning-workbench
nslayoutconstraint
qtextedit
seccomp
coovachilli
android-syncadapter
noclassdeffounderror
mercurial-extension
psd
ajax4jsf
lowercase
apple
wlanapi
scala-macros
azure-xplat-cli
gflags
innerhtml
sablecc
debug-symbols
wicket-1.5
loginview
lumia-imaging-sdk
sql-function
grails-2.3
hints
dynamic-rdlc-generation
cmath
multiscaleimage
playorm
mmc3
servercontrol
3des
bll
pyjamas
getimagesize
fuzzy-comparison

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