Adsense

Anyway to redirect to previous URL after registration in Joomla

In your component you could try to store the referrer in the Joomla! session - I don't believe the session changes or is replaced during login. I haven't had time to try this but it should work.

To Save:

$session = JFactory::getSession();
$session->set('theReferrer', $_SERVER['HTTP_REFERER'], 'mycomponentname');
To Retrieve:

$session = JFactory::getSession();
$redirectTo = $session->get('theReferrer', '', 'mycomponentname');
Then you can just use a setRedirect before you return.

$this->setRedirect($redirectTo);

Make a php php select if options

<select>
  <option<?php if($option "volvo" ){ echo "selected=\"selected\" " ?> value ="volvo">Volvo</option>
  <option <?php if($option "saab"){ echo "selected=\"selected\" "?>value ="saab">Saab</option>
  <option <?php if($option "opel" ){ echo "selected=\"selected\" " ?>value ="opel">Opel</option>
  <option <?php if($option "audi" ){ echo "selected=\"selected\" " ?> value ="audi">Audi</option>
</select>




Reference

<?php
$dbHost 
"localhost";$dbUser "USERNAME";$dbPass "PASSWORD";$dbname "dbcarselect";$db mysql_connect($dbHost,$dbUser,$dbPass);mysql_select_db($dbname,$db);
$sql1 mysql_query("SELECT * FROM tbluser ORDER BY uname ASC");

echo 
'<html>
<head>
<title>Car DB</title>
</head>
<body>'
;
while(
$row1 mysql_fetch_array($sql1)) { $uID $row1['uID']; $cID $row1['cID']; $uname $row1['uname'];
$sql2 mysql_query("SELECT * FROM tblcars ORDER BY cmake ASC"); echo 'Name: '.$uname.' - Car: <select name="cmake">'; while($row2 mysql_fetch_array($sql2)) { echo '<option ' . ($cID==$row2['cID'] ? 'selected' '') . ' value="'.$row2['cID'].'">'.$row2['cmake'].'</option>' } echo '</select><p />';
}
echo 
'</body>
</html>'
;?>

Mail Going Into Spam From PHP [Solved]


PHP Code:
mail("to@address.com","Subject","Message","Additional Headers","-fsomeone@example.com");  

The jplayer HTML5 Audio / Video player Library

Features


  • easy to get started, deploy in minutes
  • totally customizable and skinnable using HTML and CSS
  • lightweight - only 8KB minified and Gzipped
  • free and open source, no licensing restrictions
  • active and growing community providing support
  • free plugins available for popular platforms
  • extensive platform support - multi-codec, cross-browser and cross-platform
  • comprehensive documentation and getting started guide
  • consistent API and interface in all browsers, HTML5 or Adobe® Flash™
  • extensible architecture
Platforms and features

  • Windows: Firefox, Chrome, Opera, Safari, IE6, IE7, IE8, IE9
  • OSX: Safari, Firefox, Chrome, Opera
  • iOS: Mobile Safari: iPad, iPhone, iPod Touch
  • Android: Android 2.3 Browser
  • Blackberry: OS 7 Phone Browser, PlayBook Browser

Media support
  • HTML5: mp3, mp4 (AAC/H.264), ogg (Vorbis/Theora), webm (Vorbis/VP8), wav
  • Flash: mp3, mp4 (AAC/H.264), flv

Autoload your classes in PHP


Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class).
In PHP 5, this is no longer necessary. You may define an __autoload function which is automatically called in case you are trying to use a class/interface which hasn’t been defined yet.
This is how it works in action. We will create two classes. So create Image.php file and paste this in:
1<?php
2  class Image {
3 
4      function __construct() {
5          echo 'Class Image loaded successfully <br />';
6      }
7 
8  }
9?>
Now create Test.php file and paste this in:
1<?php
2  class Test {
3 
4      function __construct() {
5          echo 'Class Test working <br />';
6      }
7 
8  }
9?>
Basically, we created 2 simple classes with constructors which echo some text out. Now, create a file index.php and paste this in:
1<?php
2  function __autoload($class_name) {
3      require_once $class_name '.php';
4  }
5 
6  $a new Test();
7  $b new Image();
8?>
When you run index.php in browser, everything is working fine (assuming all 3 files are in the same folder). Maybe you don’t see a point, but imagine that you have 10 or more classes and have to write require_once as many times.
I will show you how to properly throw exception if you are using PHP 5.3 and above. Chane your index.php to look like this:
01<?php
02function __autoload($class_name) {
03    if(file_exists($class_name '.php')) {
04        require_once($class_name '.php');
05    else {
06        throw new Exception("Unable to load $class_name.");
07    }
08}
09 
10try {
11    $a new Test();
12    $b new Image();
13} catch (Exception $e) {
14    echo $e->getMessage(), "\n";
15}
16?>
Now, it checks if file exists and throws a proper Exception if it doesn’t.

newest questions on wordpress