Jump to content

[SOLVED] Function Help


monkeypaw201

Recommended Posts

Where are you getting $row_Settings?  If it's from another part in the script, do:

<?php
function sitename()
{
global $row_Settings;
echo $row_Settings['airline_name'];
}
?>

 

or if it's coming from another page you'd have to do something like

 

<?php
function sitename()
{
$row_Settings= $_REQUEST['row_Settings'];
echo $row_Settings['airline_name'];
}
?>

Link to comment
https://forums.phpfreaks.com/topic/102261-solved-function-help/#findComment-523583
Share on other sites

Wow

 

so one could create functions to hold repetive data, stick all of them in one file, and then include that file, then all you have to do is just type

 

<?php sitename(); ?> wherever you need that particular function?

 

sorry to change the subject.. just had to comment.. L:P

Link to comment
https://forums.phpfreaks.com/topic/102261-solved-function-help/#findComment-523587
Share on other sites

Wow

 

so one could create functions to hold repetive data, stick all of them in one file, and then include that file, then all you have to do is just type

 

<?php sitename(); ?> wherever you need that particular function?

 

sorry to change the subject.. just had to comment.. L:P

 

Probably wouldn't want to do that though.  Depends on the situation.

Link to comment
https://forums.phpfreaks.com/topic/102261-solved-function-help/#findComment-523588
Share on other sites

sorry to re-open, but i just went and it seems really weird...

 

i have that same code, but to make it display i have to put

<?php echo sitename(); ?>

even after i already echoed in the function, it works in some cases, but not others, any suggestions?

 

EDIT::

 

i figured it would help if i put the code is causing problems with;

 

href ="<?php 
fullurl() . "Themes" . $row_Settings['theme_directory']; 
?>Style/style.css" />

when the function is

<?php 
function fullurl() 
{ 
global $row_Settings;
echo $row_Settings['base_url'] . $row_Settings['directory'];
}
?>

 

the problem is that it actually prints that on the page while the page is loading...

Link to comment
https://forums.phpfreaks.com/topic/102261-solved-function-help/#findComment-523590
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.