cmps 26 Light Poster

Can you provide us with the link to the application and the code for the sql query.
Check the format of the values submitted to the database and the table columns format that correspond to these values. Do you think the format match ?

cmps 26 Light Poster

rewrite it it will be easier trust me ...
but i would like to know why and how u encrypted ur code ?

cmps 26 Light Poster

I was in your same situation. It was hard to pick in which way to go, but after I tried to do everything from scratch, I realized how much code I had to write, so I felt that I really should use a framework which have everything built to me (MVC structure, Libraries, Helpers etc...). There are many free frameworks available online. CI is really powerful, and has the best guide and many free tutorials. Here's a graph that compares the google search for many known frameworks.
http://www.google.com/trends/explore#q=zend%20framework%2C%20%20codeigniter%2C%20%20symfony%2C%20%20yii%2C%20%20kohana&cmpt=q

cmps 26 Light Poster

You need to check the rest of the code, it looks like it was a delete a record page. Try this, but you need to secure it by restricting the variable passed to accept only integer values, otherwise it will redirect to 'X.php'or display an error.

cmps 26 Light Poster
<?php

        session_start();

        // default user's name
        $user = '';

        // if visitor is logged in 
        $loggedIn = (!empty($_SESSION['user']));

        // since user is logged in, let us retrieve user's name from $_SESSION
        if ($loggedIn) {
            $user = $_SESSION['user'];
        } else {
            // we only allow logged in user to see this page
            // if visitor not logged in, redirect visitor to login page
            header('Location: index.php');
            exit;
        }


        // the file that contains your database credentials like username and password
        require_once('config/database.php');

        // see Lecture Webp_Week13_14_Using_PHPandMySQL(updating).pptx Slide 4 aka Step 1
        $mysqli = new mysqli($database_hostname, $database_username, $database_password, $database_name) or exit("Error connecting to database"); 


        // Slide 5 aka Step 2
 $stmt = $mysqli->prepare("INSERT INTO assignment_speeches ( id,subject,body,tags,image )
                                        SELECT id,subject,body,tags,image
                                        FROM assignment_speeches
                                        WHERE id = ?"); 

            // Slide 6 aka Step 3 the bind params must correspond to the ?
            $stmt->bind_param("i",$_GET['id']); // 1 ? so we use i. we use i because  id is INT



        // Slide 7 aka Step 4
        $successfullyDeleted = $stmt->execute(); 

        // Slide 8 aka Step 5
        // we won't check the delete result here.

        // Slide 9 aka Step 6 and 7
        $stmt->close();

        $mysqli->close();

        // if we successfully delete this, we 
        if ($successfullyDeleted) {
            $_SESSION['message'] = 'Successfully deleted';
        } else {
            $_SESSION['message'] = 'Unable to delete';
        }

        header('Location: homepage.php');

?>
cmps 26 Light Poster

i am sure u can find some cool ideas on google ...

cmps 26 Light Poster

I see only a block of code, without any description for what you want
Can you provide us with more details ?

cmps 26 Light Poster

okay I was replying from my mobile...
In you copyspeech.php, you should retrieve the information passed using the $_GET.
I'm not sure where you want to replicate the information (I mean to which table). But you should have this on your page:

$id = $_GET['id'];

if(isset($_GET['id']) && !empty($_GET['id']) && is_numeric($id)){
    $sql="INSERT INTO assignment_speeches_copy ( id,subject,body,tags,image )
                SELECT id,subject,body,tags,image
                FROM assignment_speeches
                WHERE id = $id";

      mysql_query($sql);
}

You may need to make some modifications but this is the main concept of replicating a data.

cmps 26 Light Poster

Here's couple of pop up screens: http://fancybox.net/
You can find lot of these on google: jquery popup screen

And yes the information are stored in cookies

cmps 26 Light Poster

u should have in the cpopyspeech.php
if isset $_GET['id'] and ! empty
then mysql query (the query i wrote first);

cmps 26 Light Poster

Congrats, but there is a default user for phpmyadmin, user "root" pass "" have you tried it ?

cmps 26 Light Poster

okay, you're welcome :)

cmps 26 Light Poster

I agree with your first point, but some people suggest this website without convincing the user. Why is w3school a good start ?!

use your search engine instead of your w3schools bookmark - you may be surprised at the quality of tutorials out there.

w3schools was always a good introduction for html tags, and google first result is this website. It has a very friendly interface and a 'try it yourself' option. I think it's really what a biginner needs ...

cmps 26 Light Poster

Great, thank you for sharing this

cmps 26 Light Poster

I never used a type of date, but I left it as you wrote it.
http://php.net/manual/en/function.date.php
Check it here. I tried the code and it's working.

cmps 26 Light Poster
cmps 26 Light Poster

Great! Click on "mark solved"

cmps 26 Light Poster

One way to do this is to use hidden input, but a better way to do this is using sql queries. Like this:

INSERT INTO trade_copy ( title,price,etc )
        SELECT  title,post,etc
        FROM    trade
        WHERE tradeID = $theTradeId
cmps 26 Light Poster

I didn't really understand what you want.
But you have lot of errors in this php code:

<?php

$system_date = Date("m/d/Y");

echo '<input type = "Date" value ="' . $system_date . '">';

?>
cmps 26 Light Poster

what is the error message ? Access Forbidden or what ?

cmps 26 Light Poster

It depends on what you want to do ...
HTML CSS for web deisgn
PHP for dynamic websites (or ASP)
it's a long list .... Choose which field you want to learn more about to know which language best fits your needs.

cmps 26 Light Poster

Okay so check if the table 'adminsettings' exist in you database

cmps 26 Light Poster

Aha I haven't tried that before but thank you.
Yes you can do this with css by using the percentages. Here's a fast example:

<div style="width:30%; float:left; background-color:red;">This i 30%</div>
<div style="width:70%; float:left; background-color:blue;">This i 70%</div>

cmps 26 Light Poster

This is how your pages should be.

index

<?php
session_start();
include "func.php";
foreach($_GET as $k=>$v)
$id.=$k;
$id=validatet($id);
if($id !="") {
if($_SESSION["refid_session"]=="") {
$_SESSION["refid_session"]=$id ;
}
}
include "header.php";
include "config.php"; 

$rs=mysql_query("select * from pages where ID=1") or die(mysql_error());
$arr=mysql_fetch_array($rs);

echo stripslashes($arr[2]);

include "footer.php";
?>

header.php

<?php
include "config.php";
?>
<html>
<head>
<title><?php echo $sitename; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="styles.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
    background-color: #000000;
}
-->
</style></head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td> <a href="index.php"><img src="images/home.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="advertise.php"><img src="images/advertise.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="join.php"><img src="images/register.jpg" width="104" height="78" alt="" border="0"></a><a href="faq.php"><img src="images/faq.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="contactus.php"><img src="images/contact.jpg" width="104" height="78" alt="" border="0"></a>&nbsp;&nbsp;&nbsp;<a href="login.php"><img src="images/login.jpg" width="104" height="78" alt="" border="0"></a><!-- <img src="images/top.jpg" width="505" height="78" alt=""> --></td>
</tr>
<tr>
<td><!-- <img src="images/header.jpg" width="1000" height="133" alt=""> --></td>
</tr>
<tr>
<td background="images/bg.jpg"><table width="94%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td colspan="2"><font face=verdana size=2 color=#ffffff>
<?php
$rs=mysql_query("select ID,BannerURL from bannersads where remaining>0 and approved=1 and adtype=1 order by rand() limit 0,1") or die(mysql_error());
while($arr=mysql_fetch_array($rs)) {
echo "<center><a href=$siteurl/tr.php?id=$arr[0] target=_blank><img src=$arr[1] border=0></a><br><br></center>";
$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]");
}
?>

config.php

<?php
    include "dbconfig.php";
    $ss=mysql_query("select * from adminsettings") or die(mysql_error());
    $subm=mysql_fetch_array($ss);


$sitename=$subm[0];
$siteurl=$subm[1];
$webmasteremail=$subm[2];
$adminuser=$subm[3] ;
$adminpass=$subm[4] ;
$topad=$subm[5];
$bottomad=$subm[6];
$paypal=$subm[7]; 
if(($paypal=="")||($paypal==" ")) $paypal="0";
$moneybookers=$subm[8];
if(($moneybookers=="")||($moneybookers==" ")) $moneybookers="0";
$alertpay=$subm[9];
if(($alertpay=="")||($alertpay==" ")) $alertpay="0";
$ebullion=$subm[10];
if(($ebullion=="")||($ebullion==" ")) $ebullion="0";
$levels=$subm[11];
$profee=$subm[12];
$minwit=$subm[13];
$memberships=$subm[15];
$duration=$subm[14];
if($duration==30) {
$period="Monthly";
}
elseif($duration==365) {
$period="Yearly";
}
else {
$period="Lifetime";
}

$showaddress=$subm[16];
$showcity=$subm[17];
$showstate=$subm[18];
$showzip=$subm[19];
$showcountry=$subm[20]; …
cmps 26 Light Poster

There are a lot of tutorials on google. Choose your language and start searching !

cmps 26 Light Poster

I am not sure what you want, but I'll suppose that you want to eliminate the first element. If yes, then add:

while($r=mysql_fetch_array($pc) && $i != 0){
....
}

or you can use the limitation in the query

if you want to eliminate the negative number and the zero, then:

while($r=mysql_fetch_array($pc) && dateDiff($r['elec_contract_edate']) > 0){
....
}
cmps 26 Light Poster

put it in the header.php config.php and every page appearing in the error message

cmps 26 Light Poster

actually the 'or die(mysql_error())' is used here to debug where and why your error is occuring when fetching results

cmps 26 Light Poster

you don't need to go to phpmyadmin!! Just modify your code, where it's written mysql_query("....."), just appand to it 'or die(mysql_error())' so the final code is:
mysql_query("....") or die(mysql_error())
do this every time you use the mysql_query function.

cmps 26 Light Poster

to do an online offline system u nees to set a column for the last_active to store when the user was lastly active (this is used in case the user close the browser without signing out)
and u need to set another column is_online to check if the user is online when logged in or offline when signed out
In this case, the condition to check if the user is online is:
check if the user is online and the last_active is less than 10min

cmps 26 Light Poster

First of all the server is running linux or windows ?
For linux you can use the lampp which is provided by the same company that created the xampp. To access the server from another computer, type the ip of the server in the browser so you will be able to access the xampp as a normal user. To access files you need an FTP software like filezilla.

cmps 26 Light Poster

<M/> has provided you with a wonderful tutorial from tutsplus company. If you want a ready to use software here's one:
http://www.livechatscript.com/Default.aspx

Check the demo, if you liked it, sign up and download it for free!

cmps 26 Light Poster

If you are new to this field, I recommend you to read a PHP & MySQL book (For dummies is a good collection) or buy on online tutorial. Here are the steps you need to learn:
1- Basic PHP code
2- Learn the SQL operations (select, insert, update, delete)
3- Learn how to integrate PHP and MySQL

cmps 26 Light Poster

There are lot of wordpress tutorials for biginners on youtube, check this link:
https://www.youtube.com/results?search_query=wordpress+tutorial+for+beginners&filters=playlist&lclk=playlist

And trust me it's one of the easiest open source CMS to create a website (usually a blog). Just download it from the official website http://wordpress.com/ , then intall it on your local host and check how easy it is.

cmps 26 Light Poster

why don't you keep both -moz- and -webkit- at the same time ?
and why are you using them .. you can do this with simple css no need for moz and webkit, personally i use them only to round corners

cmps 26 Light Poster

Do this for all mysql_query(...).

$rsu=mysql_query("update bannersads set remaining=remaining-1 where ID=$arr[0]") or die(mysq_error());

it will tell you where your mysql error is

cmps 26 Light Poster

Try this:
hyp = (hyp.charAt(0)+"").toUpperCase() + hyp.substring(1);
System.out.print(hyp);

cmps 26 Light Poster

I suggest to add "or die(mysql_error())" after mysql_query(...) to understand what is the error

cmps 26 Light Poster

Do you mean space/window for chatting ?

cmps 26 Light Poster

Thank you, it can be helpful if the browser does not support javascript or it's disabled ...

<M/> commented: good point +0
cmps 26 Light Poster

Very easy,here's a detailed connection PHP & MySQL:

//$variables to use in the connection
$host = 'localhost'; //Most of the time it''s 'localhost' but may be different
$user = 'root'; //username
$pass = ''; //password
$db = 'daniweb';

//first you have to make the connection, if not made => mysql_error()
$connection = mysql_pconnect($host,$user,$password);

//select the datbase you want to use, if not found => mysql_error()
mysql_select_db($db,$connection) or die(mysql_error());

//now the sql part
$query = mysql_query("SELECT * FROM table");

//fetch results
$row = mysql_fetch_assoc($query);

//Count results (optional)
$row_num = mysql_num_rows($query);

That's it !!

cmps 26 Light Poster

Use firebug or inspect element, it will make your life easier

cmps 26 Light Poster

No according to php.net he is doing it correctly :O

$bar = 'HELLO WORLD!';
$bar = ucwords($bar);             // HELLO WORLD!
$bar = ucwords(strtolower($bar)); // Hello World!
cmps 26 Light Poster

Can you provide us with the output ?

cmps 26 Light Poster

$txtname = ucwords(strtolower($row ['First.Name'])) . ' '. ucwords(strtolower($row ['Last.Name']));
remove the replace function ...

Don't complicate your life ... :)

cmps 26 Light Poster

There are lot of solution for doing anything, one can use any solution as long as it's correct and effecient. So your code is fine ...

cmps 26 Light Poster

okay i think that's becuz the $_POST['Name'] is not set in print.php.
actually u are redirecting to the page print.php and not submitting the input values ... In other words u may use the post in the save.php cuz the form action is pointing to save.php but not in print.php.
To fix this u can use the $_GET['name'] in print.php. Like this:

save.php
header('location:print.php?name='.$_POST['name']);

and in the print.php use:
I <?php echo $_GET['name'] ?> certified ....

cmps 26 Light Poster

you can easily fix that by using the percentage %. Let's say that the background div has an id of 'context', then the css would contain:

context:{width:100%};

if you don't want to complicate your self by opening the css file and save and refresh. Use the firebug plugin on firefox or use the inspect element of google chrome browser so you can preview changes directly on the browser without affecting your files. When you're ok with the width, apply the changes to your files.
Good luck

<M/> commented: ;) +8
cmps 26 Light Poster

It's very easy, just use photoshop to crop the button and the box field. Then in HTML create a form that contain a input for the search box and submit button for the search, to do so:

<form method="POST" action="search.php">
    <input name="search" value="Search keyword ..." type="text" id="searchb">
    <input name="sbutton" value="Search" type="submit" id="submitb">
</form>

Now using css, it's something close to this but you may need to adjust it so it looks perfectly like the image:

#searchb{border:0px; background-image:url('..../search.jpg');}
#submitb{border:0px; background-image:url('..../button.jpg');}
cmps 26 Light Poster

what does it give you when you enter the ip on the browser from the other pc, for example when entering 192.168.x.x ? Is it page not found or access forbidden or what?