what is the value of $url? what is something?
$url = something;
of course your $url only prints one values, because it is overwritten everytime it loops, it's called destructive readin, use array to store each values or concatenate it
what is the value of $url? what is something?
$url = something;
of course your $url only prints one values, because it is overwritten everytime it loops, it's called destructive readin, use array to store each values or concatenate it
try this mitch
$str = 'I like to eat Strawberry Cheesecake.';
$str2 = str_replace("."," .",$str);
$words = explode(" ", $str2);
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 />";
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");
@lastmitch thanks for the link, i think you are right, based on the article
php > $tz = new DateTimeZone("America/New_York");
php > $dt->setTimezone($tz);
php > print $dt->gt;format("r");
Tue, 20 Dec 2011 15:57:45 -0500
Notice the -0500 offset for the month of December. If you change the the time value to a summer date, such as July 1, you’ll see it is aware of Daylight Savings Time (EDT)
php > $tz = new DateTimeZone("America/New_York");
php > $july = new DateTime("7/1/2011");
php > $july->setTimezone($tz);
php > print $july->>format("r");
Thu, 30 Jun 2011 20:00:00 -0400
it is aware of the DST :D
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
}
?>
depend if you like it, you can do any project without MVC it's not really vital you should do MVC every project, there pros and cons on using MVC but i think the thing i like about MVC is the it's structure and workflow, with MVC your files are organized, you divide logic to your view and you had controllers act as routers, with MVC your co-workers will find eaasy to trace your code, because MVC uses URI to determine which controller and method you use. MVC has clean url, Search Engine Friendly. If you decide to use MVC i recommend Code Igniter, it's a very good MVC, it has helper class that can help lessen your work
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
i don't understand the question, there's no problem populating the dropdown menu, i assume you mean how to echo the selected items from the dropdown menu? if that's the case then above post is right, change $_POST to $_POST
Haha i dont have an IT joke, but i had this kind of joke
Once there was dog who is a sex maniac, he raped many of the animal in the forest, he raped chicken, cow, goat, pig etc. Almost all animals were raped and his crime continues for a long time. The animals of the forest are praying when will it stop that one day the lord will hear their prayers and punish the dog for his sin. One day when the cat was wandering in the forest... he saw the dog laying in the ground face down quivering horribly, Then the Cat says "Ha! good for you! The lord has punished you with your sin and deliver a quick death! die fool!". Just as the cat walk away the dog suddenly replies "Who's fool!? just wait i finish raping this ant and your next" ^_^
1gb RAM and 1gb video card is not so bad and I Prefer PC over console by control advantage... like shooting game... it's so much easier to aim using mouse rather than analog....
if you fail to plan then you plan to fail
hey cscgal... i didn't know your Dani Horowitz, until i thoroughly researched you out of curioisity :D , btw its very nice if daniweb has a notification on thread responses, coz like now i had to open thunderbird, so i can have a notification, coz thunderbird will display a pop-up notification when new email is received, its nice if daniweb can make a notification like facebook :)
what does your $row holds in your database? if it's an image then you dont just echo it directly, you have to put it on an <img> tag
echo "<img src='".$row['content']."' />";
i hope i get your point :)
why do you have to extract() the result? when you can already traverse the recordset via mysql_fetch_array. and when you do extract you dont use arrays anymore like $row coz extract() assign values to array indexes so instead of echo $row you use $content. you may try this
<?php
$query = sprintf("SELECT * FROM property_images JOIN property ON property.id = property_images.property_id ORDER BY property_images.id DESC LIMIT 0 , 30");
$result = mysql_query($query, $db) or die('Error, query failed');
if (mysql_num_rows($result) == 0) { echo "Error: property has no images. "; }
else {
while ($row = mysql_fetch_array($result)) {
header('Content-type: ' . $row['uploadedimage_type']);
header('Content-length: ' . $row['uploadedimage_size']);
echo $row['content']; } // end while
} // end else
?>
<script type="text/javascript">
function ftest(){
window.location="totherecievingpagedatabasesave.php?test="+document.getElementById('test').value;
}
</script>
<input type="text" name="test" id="test" />
<a href="javascript:void(0);" onclick="ftest()">click me</a>
then get the text box variable on the receiving end via $_GET;
I started out with a temp agency here in St Louis in 1986/7. At the time I had zero programming experience, not even college degree. My sole assets were that I was about 43 years old, recently retired US military, bought an Intro to C programming book and cheap computer, then studied that book for a few weeks. I saw an ad in the local newspaper for an entry level job, applied for it, and was hired.
I could be wrong but I suppose there are still a few entry-level jobs like that for us normal-brained folks.
INSPIRING!
have you really doin some effort? havnt you noticed you had no opening curly brace( { ) in your switch in criteria. line 11.
you know what takeshi.... im so sick and tired of debugging your code... i had help you many times and even provided code in many of your threads but you didn't had even the effort to payback the guys that helped you. You dont mark you thread solved. You just come here and beg for answers which is very annoying that some solutions are simple and obvious. i think your so lazy that your just copy and paste the code without even understanding it. Were like baby spoon feeding you here. Grow up and do you assignments on your own. You wont learn anything if you dont put your effort on it. I hope i make sense to you.
how about browser games... preferably turn-based RPG game.
<?php
echo $images[rand(0,count($images)-1)];
?>
isset($_POST['username'] && $_POST['password'])
i didn't know you can set conditional inside isset() function havent tried it yet. and other than that i spotted you lack the closing brace of your if() statement. other than that seem fine to me.
if (isset($_POST['username'] && $_POST['password']) ) {
if ($_POST['username'] == 'admin' || $_POST['password'] == 'admin') {
$password = $_POST['username'];
$password = md5($_POST['password']);
}
else {
$username = $_POST['username'];
$password = $_POST['password'];
}
}
yeah i patiently trace your code and the only thing that i suspect the problem would be in your query
$query=mysql_query("select * from report where companyname='$parameter' and reporttype='client' order by id desc");
coz if you form2 is working right and contain values , your query is right and on how you fetch you query is right.. then theres should be no problem traversing the recorset.
and also you can fetch your query like this
$query=mysql_query("select * from report where companyname='$parameter' and reporttype='client' order by id desc");
while($row=mysql_fetch_array($query)){
echo "<tr>
<td>
<a href='reportclient.php?name=".$row['companyname']."'>".$row['companyname']."</a\>
</td>
</tr>";
}
echo"</table>
<input name=\"viewrep\" type=\"submit\" id=\"viewrep\" value=\"View Report\">";
i recommend you use .png.... about the banner will it's not really hard... because you use database...all you do is some mysql query and PHP predefined function rand();
here ill show you the code
lets assume you had these table
banner
banner_id - int (primary)(autoincrement)
src = varchar
<?php
mysql_connect('localhost','root',''); // i use the default
mysql_select_db('your_database_name'); //enter your database
$sql = mysql_query("SELECT banner_id FROM banner");
$max = mysql_num_rows($sql);
$sql2 = mysql_query( "SELECT src FROM banner WHERE banner_id='".rand(1,$max)."'" );
$row = mysql_fetch_array($sql2);
echo "<img src='".$row['src']."' width='300' height='200' />";
?>
put a banner folder in your root document....
insert the images path in the src field of your banner table
ex. banner/your_images.png