vaultdweller123 32 Posting Pro

where did you learn OOP? that is just so wrong, that is a bad class structure. Your class has no constructor, you know what i recommend you must first learn the standards on how to create a class, specially from getters and setters etc. you can google tutorials on the net but you can try these
http://www.killerphp.com/tutorials/object-oriented-php/

vaultdweller123 32 Posting Pro

try this mitch

$str = 'I like to eat Strawberry Cheesecake.';
$str2 = str_replace("."," .",$str);
$words = explode(" ", $str2);
LastMitch commented: Thanks for the example! +0
vaultdweller123 32 Posting Pro

the reason you recieved html tags is because you did not include an html header, and the reason the image is not displayed it's because your did not specify an absolute path. this is the simple example of how to send html email

<?php
// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>

source : http://php.net/manual/en/function.mail.php

vaultdweller123 32 Posting Pro

honestly, i don't know what are you trying to achieve.... im confused why you have two arrays with the same values? well based on your comment, you want to echo the "Blueberry Cheesecake"? then you could just

echo "I am going to eat a ".$cake[1]. "<br />";
LastMitch commented: Thanks for the solution! +5
vaultdweller123 32 Posting Pro

first i wanna ask, can you clarify this line

$cake("Apple Cheesecake", "Blueberry Cheesecake", "Strawberry Cheesecake", "Mango Cheesecake", "Raspberry Cheesecake");

is that an array? it yes
it should be

$cake = array("Apple Cheesecake", "Blueberry Cheesecake", "Strawberry Cheesecake", "Mango Cheesecake", "Raspberry Cheesecake");
vaultdweller123 32 Posting Pro

try this

<?php

$useryquery = "SELECT * FROM  `members` ORDER BY id DESC ";
$useryquery = mysql_query($useryquery);
$i=0; // added start count
	while($row = mysql_fetch_assoc($useryquery)){
	$id = $row['id'];
	$firstname = $row['firstname'];
	$lastname = $row['lastname'];
	$verified = $row['eamailactivated'];
	$userinfo = $row['Blocked'];
	$usertype = $row['Usertype'];
	if($usertype == '1'){
	$usertype = "<td colspan='2' align='center'>Unavailable.</td>";
	}else{
	$usertype = "<td width='50'><center><a href='index.php?block=$id'>Block</a></center></td><td width='60'><center><a href='index.php?unblock=$id'>Unblock</center></td>";
	}
	if ($userinfo == '0'){
	$userinfo = "<font color='green'>Active</font>";
	}else{
	$userinfo = "<font color='red'>Blocked</font>";
	}
	if($verified == '0'){
	$verified = "<font color='red'>Unverified</font>";
	}else{
	$verified = "<font color='green'>Verified</font>";
	}
	$name = "$firstname $lastname";
	
	if($i%2==0){
		echo "<tr style='background-color:red;'>"; // sample color red, replace it with the color of your choice, you use hex number
	}else{
		echo "<tr style='background-color:blue;'>"; // sample color blue, replace it with the color of your choice, you use hex number
	}
	echo "<td><a href='http://www.daparadise.com/profile.php?id=$id'>$name</a></td>
	<td width='80' align='center'>$userinfo</td>
	<td width='80' align='center'>$verified</td>
	<td width='130'><center><a href='index.php?cp=$id'>Change Password</a></center></td>$usertype</tr>";
	
	$i++; // increment by 1
	
}


?>
karthik_ppts commented: Useful Post +7
vaultdweller123 32 Posting Pro

wow what a difficult problem, worth asking

vaultdweller123 32 Posting Pro

have you tried echoing the $datefrom and $dateto results? they could be empty. Does your query work? try running your query on phpmyadmin SQL to test if it works

vaultdweller123 32 Posting Pro

no the error is in front-page.php that inside the IE folder, what is on line 42?

vaultdweller123 32 Posting Pro

or you can put condition on every includes

<html>
	<head>
	<?php
	
	include('get_browser.php');
	$browser=getBrowser();

	?>
	
	<?php
	
	switch ($browser['name'])
	{
		case 'Google Chrome':
			echo '<link rel="stylesheet" type="text/css" href="/your_google_chrome_style.css" />';
			echo '<script type="text/javascript" src="/your_google_chrome_javascript.js"></script>';
			break;
		case 'Internet Explorer':
			echo '<link rel="stylesheet" type="text/css" href="/your_ie_style.css" />';
			echo '<script type="text/javascript" src="/your_ie_javascript.js"></script>';
			break;
		case 'Mozilla Firefox':
			echo '<link rel="stylesheet" type="text/css" href="/your_mozilla_style.css" />';
			echo '<script type="text/javascript" src="/your_mozilla_javascript.js"></script>';
		        break;
		default:
	}
	
	?>
	</head>
	<body>
	<?php

	switch ($browser['name'])
	{
		case 'Google Chrome':
			echo '<p>google chrome content</p>';
			break;
		case 'Internet Explorer':
			echo '<p>Internet Explorer content</p>';
			break;
		case 'Mozilla Firefox':
			echo '<p>Mozilla Firefox content</p>';
			break;
		default:
	}
	
	?>
	</body>
	</html>
vaultdweller123 32 Posting Pro

you know what you can use @emclodon code, it is much better

<?php

	include('get_browser.php');
	$browser=getBrowser();
	switch ($browser['name'])
	{
		case 'Google Chrome':
			include('your_google_chrome_page.php'); // your separate google chrome page
			break;
		case 'Internet Explorer':
			include('your_ie_page.php'); // your separate ie page
			break;
		case 'Mozilla Firefox':
			include('your_mozilla_page.php'); //your separate mozilla page
			break;		
		default:	
	}

?>
vaultdweller123 32 Posting Pro

awts sowe lol :D, btw so what's wrong? i mean is what is the problem? you have error? or it isn't displaying anything

vaultdweller123 32 Posting Pro
vaultdweller123 32 Posting Pro

lol you can't send emails directly from localhost, unless you installed an email system already, PHP need a working email system for it to work

vaultdweller123 32 Posting Pro

you can use javascript

navigator.userAgent
vaultdweller123 32 Posting Pro
$date = strtotime(date("Y-m-d G:i:s")."+30 days");
vaultdweller123 32 Posting Pro

put this above html

$user = $_POST['compid'];
$pass = $_POST['pword'];

$db=mysql_connect('localhost','root','') or die('Cannot connect to MySQL!');
@mysql_select_db('dbriomra')or die('Cannot connect to database');
session_start();

$sql = mysql_query("SELECT * FROM login WHERE username = '".$user."'");

if(mysql_num_rows($sql)>0){

	// login
	while($row=mysql_fetch_array($sql)){

		if($pass==$row['password']){
			// store id as session
			$_SESSION['id'] = $row['id'];
			echo "<script>window.location='/employee.php'</script>";
		}else{
		// password incorrect
			echo 'password incorrect';
		}

	}
}else{
	// fail
	echo "username doesn't exist";
}

then remove the action attribute in your form

vaultdweller123 32 Posting Pro

unlink works, if it doesn't then there's problem with your path, if you doubt it's functionality, try doing simple test, like unlink(test.php); putting unlink script and test.php into the same directory

vaultdweller123 32 Posting Pro

basing on the title... want to get inside PHP? then you have to start at the basic, learn the native php then if you want to go advance learn OOP as most of frameworks are OOP

vaultdweller123 32 Posting Pro

@viribium the code ive given to you was a combination of your both index.php and insert.php, so put that code in your index.php and remove line 11

or die(mysql_error());
vaultdweller123 32 Posting Pro
vaultdweller123 32 Posting Pro

ha ha he think we are able to read minds :D

vaultdweller123 32 Posting Pro

try this, just a revision to your code

<?php
mysql_connect("localhost", "root", "test") or die(mysql_error());
mysql_select_db("testdb") or die(mysql_error());


$username = $_POST['name'];
$country = $_POST['country'];

if (isset($_REQUEST['Submit'])) {  
mysql_query("INSERT INTO users(name, country) VALUES('$username', '$country' ) "); 
or die(mysql_error());
}

?>
<form method="post">
username<input type="text" name="name" value=""> </br>
country<input type="text" name="country" value=""></br>
<input type="submit" name="submit" value="Submit">
</form>
vaultdweller123 32 Posting Pro

1st wrap your dropdown <select> with a form and add a submit button

$dropdown = "<form action='get'><select name='Test'>";
while($row = mysql_fetch_assoc($result)) {
$dropdown .= "\r\n<option value='{$row['Test']}'>{$row['Test']}</option>";
}
$dropdown .= "\r\n</select><input type='submit' name='submit' value='submit' /></form>";

then update your second query

$query2 = "SELECT * FROM tests WHERE id='".$_GET['Test']."'";
$result2 = mysql_query($query2);
while($row2 = mysql_fetch_array($result2))
{
echo "<tr>";
echo "<td>" . $row2['Horse_Number'] . "</td>";
echo "<td>" . $row2['Horse_Name'] . "</td>";
echo "<td>" . $row2['Rider_Name'] . "</td>";
echo "<td>" . $row2['E_Total_Percent'] . "%</td>";
echo "<td>" . $row2['H_Total_Percent'] . "%</td>";
echo "<td>" . $row2['C_Total_Percent'] . "%</td>";
echo "<td>" . $row2['M_Total_Percent'] . "%</td>";
echo "<td>" . $row2['B_Total_Percent'] . "%</td>";
echo "<td>" . $row2['Total_Average'] . "%</td>";
echo "<td>" . $row2['Errors'] . "</td>";
 
echo "</tr>";
}
vaultdweller123 32 Posting Pro

i can't understand your question ha ha, can you make it clear? :D

vaultdweller123 32 Posting Pro

or try changing your html encoding to utf8 without BOM

vaultdweller123 32 Posting Pro

move that ob_start(); to the 1st line before the doctypes

vaultdweller123 32 Posting Pro

i don't see something wrong with your code....what's the error?

vaultdweller123 32 Posting Pro

you can disable short tags, if you do not always use this, disabling it will cause no harm. but like myself, i always use php shortags so id rather echo the xml DTD rather than turning it off so decide on what suits you

vaultdweller123 32 Posting Pro

i think the xml DTD is conflicting with the php short tags, i think there are many solutions on this but try this quick fix

<?php echo '<?xml version="1.0" encoding="utf-8" ?>'; ?>
vaultdweller123 32 Posting Pro

no problem, btw i already tested it, you can test it by running the code on firebug's javascript console

vaultdweller123 32 Posting Pro

echo 1st the $row[RegNo] to see the value, because it could be that the $row[RegNo] only contains the "five" text

vaultdweller123 32 Posting Pro

try this

$sql = "Select * from table_name where age = 10";
$result = mysql_query ($sql,$con) or die (mysql_error());
      $countrows= mysql_num_rows($result);
 

      while ($row= mysql_fetch_array($result))
      {
       $list[] = $row['firstname'].','.$row['lastname'];
 
      }
      
      
      
       $file = fopen("files/ExampleDAT.DAT","w");

	foreach ($list as $line)
	  {
	  fputcsv($file,split(',',$line));
	  }
	
	fclose($file);
vaultdweller123 32 Posting Pro

put this before the </head>

jQuery("#entersite a").hover(function(){

		jQuery("#entersite a").css("position","relative");
		jQuery(this).animate({left:"100px"}).fadeOut(function(){
			jQuery("#entersite a").css("left","-100px").fadeIn().animate({left:"0px"});
		});
		
});
vaultdweller123 32 Posting Pro

it's not possible to call the function buildModels(); from the javascript events onChange because it's a php function, and php is a server-side, it requires page load, unless you use AJAX.

vaultdweller123 32 Posting Pro

just a suggestion:
javascript is very complicated... specially when your coding native javascript... i recommend you make use of the most popular javascript library today... which is jQuery; It will make your life more easier... ^_^

vaultdweller123 32 Posting Pro

one thing is for sure, the condition didn't satisy the if statements. try echoing those variables to see their value, ie $avatar, $ulevel and $inactive

vaultdweller123 32 Posting Pro

whats the value of $_GET? ist the name of a person?, like "John"?, why are including names?, include and require function are used for including files, of course the $urle works coz its a path to the filename which is the january_10.html. what are you tring to do?

vaultdweller123 32 Posting Pro
<script type="text/javascript">
function jfunc(x){

if(x=="shirt_yes"){
document.getElementById("jdiv").style.display="block";
}else{
document.getElementById("jdiv").style.display="none";
}

}
</script>
Include Shirt: <br/>
Yes:<input type="radio" name="shirt" onclick="jfunc(this.value)" value="shirt_yes"/>
 No:<input type="radio" name="shirt" onclick="jfunc(this.value)" value="shirt_no"/>
<br/>
<div id="jdiv" style="display:none;">
Size:
<select name="size" id="size" onChange="MM_jumpMenu('parent',this,0)">
  <option>medium</option>
  <option>large</option>
  <option>XL</option>
  <option>XXL</option>
</select>
<br/>
<input type="submit" value="Submit order" />
<br />
</div>
</form>
vaultdweller123 32 Posting Pro

try using using isset in $_POST

if (isset($_POST['login'])){
vaultdweller123 32 Posting Pro

first understand the difference about server-side and client-side scripting, server-side request data from server and reloads the page or not if you use ajax, and client side does not need the page to refresh before you can use it, i hope i understand you correctly, you want to use javascript which is a client-side to request data from php which is server-side, like

<script type="text/javascript">
function form_validation(){ 
if(validation==true){ // sample, if validation is true
<?php
// call php
?>
}
}
</script>

that's impossible, coz in order for you to process php you need to request to the server first commonly via form submit and then the page reloads, unless you use ajax, but php can

<?php
if($_GET['sampe']){ // sample
echo "<script>alert('you pressed it')</script>"; // call javascript or even html
}else{
echo "<script>alert('no you dont')</script>";
}
?>
vaultdweller123 32 Posting Pro

yeah this is like the header("location: sample.php"); you cant have any output before the session_start() even spaces, newline, tab etc. or else it will generate an error

vaultdweller123 32 Posting Pro

i hope you set-up correctly the php.ini for the mail function to work

vaultdweller123 32 Posting Pro

just stick to my original code and you'll do fine

$sql = mysql_query("SELECT name FROM users"); //sample table users
while($row=mysql_fetch_array($sql)){
$a[] = $row['name'];
}
vaultdweller123 32 Posting Pro
<?php

$obj = new Entry(); // instantiate class Entry
$title = $obj->getTitle(); // get array title
$content = ""; 

foreach($title as $val){ // loops through all array 
$content += "<td>".$val."</td>"; 
}

$p->setContent('<table border="1">

<tr><td>Info: '.$u->getInfo().'</td>
'.$content.'</tr></table>');


?>
vaultdweller123 32 Posting Pro

i dont know... but one thing is for sure, we had set correctly the php.ini coz at first i was seeing errors but now no error only a never ending loading upon submit

vaultdweller123 32 Posting Pro

@ivanichi explain the problem clearly so we can help you

vaultdweller123 32 Posting Pro

sorry dude im out of idea, but thats the only possible error i could think of, coz when i examined your code, i noticed that at first it lacking the closing parenthesis of the jfunc() function, the code look like this

<a href="javascript:void(0)" onclick="jfunc('.$row["id"].','.$row["event"].','.$i.'" />Update</a>

so its clear that it will be an error if you dont close your function

so you must append the closing parenthesis of jfunction()

<a href="javascript:void(0)" onclick="jfunc('.$row["id"].','.$row["event"].','.$i.')" />Update</a>
vaultdweller123 32 Posting Pro

why would you change the getTitle() function? its fine already, it just a matter of how you retrieve it

so you retrieve it like this, first lets instantiate you class Entry

<?php
$obj = new Entry(); // instantiate class Entry
$title = $obj->getTitle(); // get array title

foreach($title as $val){ // loops through all array 
echo $val."<br />"; // test result
}
?>
vaultdweller123 32 Posting Pro

@madkat3 yeah dude same here, when i hit send, it's just loads a never ending loading