Banderson 29 Junior Poster in Training

ALMOSTBOB - you are right as well however I need to get my html to work as or with a PHP file or some flavor of that (not sure that is where I have my disconnect) then I am sure your REMOVE_ADDRESS code above will work.

This is a server configuration issue so, do it with .htaccess Put a file named .htaccess << (notice the period in front ) in the htdocs of your server (eg: public html) or where your source folder is. Input either rule below that you need or prefer.

This will change all .html files on your server so that they can execute php

AddType application/x-httpd-php .html

or if you just want php on your registration page :

<Files index-eng-register2.html>
AddType application/x-httpd-php .html
</Files>
Banderson 29 Junior Poster in Training

Try to comment out the complete query and hard code session data in. If that fixes it then it is because your query is being executed everytime you reload the page, otherwise you are writing to the session somewhere else in your code.

Banderson 29 Junior Poster in Training

Check to see if and why the query is being executed on page refresh and be sure you are not setting any stray session data on accident outside the query. Also try to close the connection after the query.

Banderson 29 Junior Poster in Training

He means when you insert the data into the database redirect to another page immediately to prevent duplicate data. Like IIM said there are multiple solutions. The way I would do this is :

Capture the session until the products cart is added to the database. After the products are added take the user to a "your cart has been updated" page and generate a new session id destroying the products in the old session. Do not destroy the entire session or you will log them out. On the cart updated page pull the results from the database for the user to view. Do not add these products back to the session. Only add products to this new session if the user continues adding products.

Rinse and repeat until shopping is done.

Banderson 29 Junior Poster in Training

Expanding on what @Zagga said, you can also set up your server to read .html files as PHP. You will need to set up a .htaccess file to do this.

Place an .htaccess file in the root of your application with the following:

AddType application/x-httpd-php .html

Banderson 29 Junior Poster in Training

Ok I found the problem on your images. It is in the base.css located at:
Click Here

The code in the css is :

blockquote p code {
    padding: 0 4px;
    display: block;
    text-align: left;
    overflow: auto;
}

It needs to be :

blockquote p code {
    padding: 0 4px;
    display: block;
    text-align: left;
    overflow: hidden
    ;
}

But be aware that this changes the whole game. By doing this your users can no longer select the text in the frame because it is hidden. You will need to find a work around.

Banderson 29 Junior Poster in Training

Which page if your iframe on? I am getting a 404 on the previous one you posted. I will take a look to see if I can help.

Nmv I got it.

Banderson 29 Junior Poster in Training

Try adding the code above overflow:hidden; to all the declarations one by one and testing. If the probem still exists then also try the
body { overflow:hidden; } to the IFrame first and then the main document. This will troubleshoot and narrow down the culprit. As I mentioned before: If you add the overflow:hidden; to the css that is controllinig the look&feel of the IFrame then that code will remove the scrollbars frome the IFrame.

Banderson 29 Junior Poster in Training

Well possibly, since it is an IFrame. Try and see. Whichever tag is for your iframe lightboxes and video software then you will need to use only the overflow:hidden; there. The complete body { overflow:hidden; } will remove the scrollbars from the entire page. I haven't worked with IFrames for a long time. Which tag is defining your IFrame above?

Banderson 29 Junior Poster in Training

If you want to remove the scroll bar from the entire page then you will need to insert into the body tag since the scroll bars are part of the body of your document.

eg:

body { overflow:hidden; }

If you only want to remove it from an element in your page then add overflow:hidden; to that elements space.

Banderson 29 Junior Poster in Training

You will need to pass the variables to the int(speed) of your Timer animation in the ActionListener of your Timer class. Your timer class will also need to implement KeyListener.
The Timer class has a setDelay method. setDelay() will not affect setInitialDelay(). So if you want your monster to begin moving at startup or when the event is fired you will set this up in your setInitialDelay() After the event is fired then you can use setDelay to control the monsters speed(Delay between the firing of your events such as keyPressed in your example)

Banderson 29 Junior Poster in Training

@arunmagar, you are correct to sanitize the data, but be aware that mysql_real_escape_string will be deprecated as of PHP 5.5.0 release and removed in later versions.

Click Here

Banderson 29 Junior Poster in Training

Your query is failing here:

 $strSQL = "SELECT * FROM employee WHERE proj_mgr = '$session->username'";

Try this:

 $strSQL = "SELECT * FROM employee WHERE proj_mgr = $session->username";

If it doesn't work then you will need to be sure that the $session->username variable is not empty.

Banderson 29 Junior Poster in Training

Try this class. It will create your file if it does not exist and it will print your variable value to the file. You will need to change the variable type to what you need in the argument. Also your logger is wrong. Level Severe is only for release. Until you are ready to release the code to production you need to change the level to WARNING or better yet FINE

Usage is :

MyClass myclass = new MyClass();
myclass.printvariableToFile(String,String);

    import java.io.File;
    import java.io.FileWriter;
    import java.io.PrintWriter;
    import java.util.logging.Level;
    import java.util.logging.Logger;

    /**
     *
     * @author Bill
     */
    public class MyClass {


        public void printvariableToFile (String fileName, String myVariable) {


      File myFile;
      myFile=new File(fileName);
      if(!myFile.exists()){

          try {
      myFile.createNewFile();

                FileWriter fw = new FileWriter(fileName);
                PrintWriter pw = new PrintWriter(fw);


                // Write variable to file
               pw.print("Writing variable to file");
               pw.println("The varible is below: ");
               pw.println(myVariable);

               // Close 
               pw.close();


            } catch (Exception ex){

                 Logger.getLogger(NewJFrame.class.getName()).log(Level.SEVERE, null, ex);

             }
          }    
       }
    }
Banderson 29 Junior Poster in Training

it doesnt seem to display the name and id but only says yes. btw the table has a field called completion which says yes or no, so when one of the radio buttons in the completed successfully is clicked it should correspond with the table field completion and there on display results along with the nic given in a text field

That's strange because I ran this code on localhost and it worked for me. I don't think this has anything to do with it, but I am running PHP version : 5.3.0.

I am slightly busy with another project right now. If you do not get anymore replies or still don't have it working after a while, send me a message via skype : ncprogramming and I will try to help you further.

I felt for sure this was going to work for you. :-O

Banderson 29 Junior Poster in Training

Save a backup! I edited your code substantially! This should give you the results you are requesting.

<?php

if (isset($_POST['find'])) {
$cs = $_POST['cs'];
$q=$_POST['q']; //Get the search text
$id=$_POST['id'];
//print $cs;
}

$con = mysql_connect('localhost', 'root', ''); //connect to the database
if (!$con) //if cannot connect to the database, terminate the process
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("sdc_cpds", $con); //Select the databse
$sql="SELECT * FROM course_participant WHERE name='".$q."' || nic LIKE '$id'"; //Select Query
$result = mysql_query($sql);//execute the query and get the result
$num_rows= mysql_num_rows($result); //get the count of the result

if($num_rows >0) //If there is a result, display it
{
while($row = mysql_fetch_array($result))
{
echo $row['name']; echo " ";echo $row['nic'] ;echo " "; echo $row['res_address'] ;echo " ";echo $row['contact_no'] ;echo " ";echo $row['email'] ;echo " ";echo $row['gender'] ;echo " ";echo $row['age'] ;echo " ";echo $row['marital_status'] ;echo " ";echo $row['university'] ;echo " ";echo $row['facdept'] ;echo " ";echo $row['course'] ;echo " ";echo $row['course_date'] ;echo " ";echo $row['reg_date'] ;echo " ";echo $row['payments'] ;echo " ";echo $row['completion'] ;
echo "<br>";



$cs = $_POST['cs'];

if ($cs == 'yes') {
$yes = 'checked';
//echo 'Completed';
echo "The Test Was Completed <br />Student Id: ". $row['nic']."<br />Student Name: ". $row['name'];


}
else if ($cs == 'no') {
$no = 'checked';
echo "Current";
}

else // If no result found
{
echo "No result found!"; //Display the "not found" message
}

mysql_close($con); //Close the database connection



}
}

?>
Banderson 29 Junior Poster in Training

Remember to save a backup. Try this PHP code

<?php

$q=$_POST['q']; //Get the search text
$id=$_POST['id'];
/*$cs=$_POST['cs'];
echo $cs;*/

if (isset($_POST['find'])) {
$cs = $_POST['cs'];
print $cs;
}

$con = mysql_connect('localhost', 'root', ''); //connect to the database
if (!$con) //if cannot connect to the database, terminate the process
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("sdc_cpds", $con); //Select the databse
$sql="SELECT * FROM course_participant WHERE name='".$q."' || nic LIKE '$id'"; //Select Query
//echo $sql;
$result = mysql_query($sql);//execute the query and get the result
$num_rows= mysql_num_rows($result); //get the count of the result

if($num_rows >0) //If there is a result, display it
{
while($row = mysql_fetch_array($result))
{
echo $row['name']; echo " ";echo $row['nic'] ;echo " "; echo $row['res_address'] ;echo " ";echo $row['contact_no'] ;echo " ";echo $row['email'] ;echo " ";echo $row['gender'] ;echo " ";echo $row['age'] ;echo " ";echo $row['marital_status'] ;echo " ";echo $row['university'] ;echo " ";echo $row['facdept'] ;echo " ";echo $row['course'] ;echo " ";echo $row['course_date'] ;echo " ";echo $row['reg_date'] ;echo " ";echo $row['payments'] ;echo " ";echo $row['completion'] ;
echo "<br>";

}
}

if (isset($_POST['find'])) {

$cs = $_POST['cs'];

if ($cs == 'yes') {
$yes = 'checked';
//echo 'Completed';
echo "The Test Was Completed <br />Student Id: ". $row['nic']."<br />Student Name: ". $row['name'];


}
else if ($cs == 'no') {
$no = 'checked';
echo "Current";
}
}
else // If no result found
{
echo "No result found!"; //Display the "not found" message
}

mysql_close($con); //Close the database connection


?>
Banderson 29 Junior Poster in Training

Try this first. Just change this code, leave your PHP intact for now. Be sure to save backups while testing.

<html>
<strong>SEARCH</strong><br/>
<form style="background-color:#F2F2F2; padding:10px; border:1px solid; border-color:#084B8A; width:650px;" action="http://localhost/sdc/?q=node/2" method="POST">
<table>
<tr>
<td>Name:</td><td width="300"><input type="text" size="60" name="q"/></td>
</tr>
<tr>
<td>NIC No:</td><td width="150"><input type="text" size="40" name="id"/></td>
</tr>
<tr>
<td>Course:</td>
<td>
<select>
<option>ALL</option>
<option>CTHE</option>
</select>
</td>
</tr>
<tr>
<td>Date of Course:</td><td width="60"><input type="text" size="20" /></td>
</tr>
<tr>
<td>Completed Successfully:</td>
<td width="500">
<input type="radio" name="cs" value="yes">YES</radio> <input type="radio" name="cs" value="no">NO</radio> <input type="radio" name="cs" value="all is checked" checked>ALL</radio>
</td>
</tr>
<tr>
<td>Current Course Participant:</td>
<td width="500">
<input type="radio" name="pm">YES</radio> <input type="radio" name="pm">NO</radio> <input type="radio" name="ccp" checked>ALL</radio>
</td>
</tr>
</table>
<input type="submit" value="FIND" name="find" style="float:right;" class="up" onmouseover="this.className='over'" onmouseout="this.className='up'"/>

</form>
</html>
Banderson 29 Junior Poster in Training

First try wrapping your codes in code tags when you post. It makes it easier to sort.

You need a value for your radio boxes. The value is returned, not the radio box name.

I could probably tell you more about your code, but as I said before it is too difficult for me to sort.

Banderson 29 Junior Poster in Training

This error sounds like your server is not running. If your running Apache go to your

Apache installation folder >> bin/ApacheMonitor.exe

With ApacheMonitor.exe you can start your server.

Banderson 29 Junior Poster in Training

Well, firstly a login form is never secure unless the submitted data is encrypted on the server and even then it is not 100% protected.

Secondly, how about posting a start of your code ( IE : Anything to show some heart!)

Then after this I am sure one of these wonderful and knowledgeable people here here will be glad to help you out.

Banderson 29 Junior Poster in Training

Hey, thanks a lot for the help..
No i didnt think anything..
I will do some changes..and let u know..
I will send the code to you, can u check and correct it for me..

Thanks for ur help again

I will be glad to help you out any way I can. Send me a pm when your ready to proceed and I will help you.

Usually when I start a project, especially large scale , I sit down with a piece of paper and list out all my methods,classes, and variables in each one and then state what purpose they will serve within the program.

Some call it 'Pseudocode', I call it 'jotting' ;)

It all begins in your mind and on paper. This is where dreams become the reality.

Banderson 29 Junior Poster in Training

In line 17 i already have the

echo "$m_id" ;

It doesnt print any thing

Sorry I missed that particular line. I would say this is where your query is failing. If it is not echoing any data here, hence the variable does not exist, so it cannot be passed into the query.

Also, I am noticing now that you have $companyname listed consecutively within your insert values statement.

I would recommend changing these, it can get confusing, not to mention cause buggy errors that will be hard to find.

I would also recommend executing var_dump(); to see what exactly is being passed.


Please don't take this wrong I am trying to be helpful, not hateful.

Banderson 29 Junior Poster in Training

Where id is the company id, from the company table..

What is the echo statement at line 15

echo "$max_id" ;

Change this to

echo "$m_id" ;

because this is the data that is actually being inserted. Let's see what this prints?
Also uncomment line 26, unless your sure which query is failing. I would also change the echo errors to something else to differentiate them.

Banderson 29 Junior Poster in Training

Hey
Thanks,
For ur reply..
That was the same idea i was thinking...when i worked it out it gives me a Duplicate error...

What is the duplicate error? Are you auto incrementing as previously stated?

Echo your error to screen with :

echo mysql_error ();
Banderson 29 Junior Poster in Training

Hello, i'am newbie. I don't know about programming language,in each language, i only know "hello world".

Javascript is spend more expensive bandhwidth. Especially for Limited Account of hosting.

Is it possible to convert javascript to php or html ???

Ther are online tools, such as, yellowpipe.com that convert HTML to a few other scripting languages, but to my knowledge you cannot convert javascript to PHP without rewriting the source code.

By the way JavaScript is not bandwidth extensive or costly 'to you' because it does not communicate with your server. It is client side only.

Banderson 29 Junior Poster in Training

Got it :)
Thank you

Your welcome. I'm glad I could help! An important thing to remember in any programming language, especially when dealing with personal information (ie : banking applications) is the use of private classes. This will keep your methods, classes, variables and other program properties hidden!

Here is a favorite quote I carry within from the master himself :

"The secret to creativity is knowing how to hide your sources."
— Albert Einstein

Banderson 29 Junior Poster in Training

I always like beginner tutorials, a nice refresher never hurts. This tutorial is not bad, but it is rather outdated, at this point. Most of this code would work for PHP Version 4 **,
but it will not work for Versions 5 =>

You must use

<?php  ?>

for Versions 5 =>

This being said if you are still using PHP 4 **, you probably need to consider migrating to Versions 5 => for updated security on your server.

Now on a brighter note, Thank you Ken Hess for another contribution to the community, it is much appreciated!

Banderson 29 Junior Poster in Training

Hi,
The dynamically created rows are appended at the end of the table i.e. after the last row of the table (found by table.rows.length)
and those individual <tr> contains 8 more <td>s carrying some texts and their respective text fields.
Now we have one such default <tr> , which also contains button for adding more row , onclick of which the addRow() function is called to create the dynamic row each time.
The code is created dynamically that's fine so far.
But when the form is submitted the default textfield's (from the default<tr>) values are found in the echo of post data but not other .
The same script works fine in IE and shows all the elements textfield's values in the textfield POST data along with the default one, after form submit echo.

And this post means what? Sorry, but it seems pretty much meaningless, even after reading it 3 times.

No Code = No Help

Banderson 29 Junior Poster in Training

Hi there, I am creating an ecommerce web site and I am using magento. Payments will be inside in our country and local banks will give me payment forms and I will have to integrate it with my web, but I need some help, how can I integrate their form in magento? Any suggestions? I don't know where to start

I would probably start with a search for Magento Plugins, mods or something similar

If you have trouble or questions about the application being safe, I would look into hiring someone that holds a great deal of expertise in working with Magento, especially when you are dealing with integrating banking applications.

Banderson 29 Junior Poster in Training

I haven't used C in years, but if I remember correctly you need to use

@@IDENTITY

to retrieve the Last ID.

Anyone more familiar, correct me if I'm wrong.

kvprajapati commented: Correct. +7
Banderson 29 Junior Poster in Training

I don't know much about computers and how to protect them (probably why I got these viruses in the first place), but I do know a virus is preventing me from going on any virus removal sites such as McAfee. What should I do?

Boot in safe mode with networking.

Banderson 29 Junior Poster in Training

Both ways you mentioned will cause indexing at the approximately the same speed, but a 301 redirect will cause the page rank to follow from the old domain.

If you put a link on the old domain, the page rank will eventually drop off the old domain and will not help the new domain. So if you want the page rank of the old domain to be posted to your new domain use a 301 permanent redirect.

Banderson 29 Junior Poster in Training

Hi, This will show you how to create a login form using swing.

Please be aware that this form does not connect to anything.
( eg. A URL or a database)


This is just a little advanced example of one of the many things you can do in swing.

A working example of this script can be downloaded at:
http://programmers-paradise.net/forum/viewtopic.php?t=9

And Yes before I start getting attacked with accusations of deprecated values I am aware of one in this code.

:rolleyes:

Banderson 29 Junior Poster in Training

I use this snippet in all my codes if I have problems postings or getting vars. It works every time for me. I have made this into a class and used it for a long time.

Now why do you say :
and, register_globals = off is not being emulated the right way in your snippet.

Some people may use $_REQUEST in their codes which is fine, but as long as you code with security in mind and you know where the vars and methods are coming from $_REQUEST does not need to be used.

Banderson 29 Junior Poster in Training


Ever since PHP turned register_globals_off I have had problems here and there in my codes. I searched hard and long for a simple fix while keeping globals turned off. Fortunately, I found one! I have posted it below for your convenience and it is also described Here.


I'm not sure if this has ever been posted, but if not I hope it helps you as much as it did me. :cool:

Banderson 29 Junior Poster in Training

:mrgreen: hmmm. Interesting concept aniseed.

Banderson 29 Junior Poster in Training

Here is a code to sort numbers instead of strings using the BubbleSort method. The difference here is you don't use compareTo() for numbers as you do with strings.

Banderson 29 Junior Poster in Training

This class will sort strings in alphabetical order.

Banderson 29 Junior Poster in Training

cwarn23 gave you probably the best advice here. If your still getting that error, it would mean you have a parsing error in your ini file. PHP cannot start because of this error.

Since php 5 a parse error in ini file will cause php process to kill.

This is all I know to do from where I am. I would follow cwarn23 advice through and see if that works even disable the .dll files and try to pinpoint the problem like he was saying.

Good luck

Banderson 29 Junior Poster in Training

oh god nvm i just got it working thanks so much for your help

Your welcome good luck, please mark this thread as solved.

Banderson 29 Junior Poster in Training

when i try to apply a header it comes up with an error saying header has already been set

Warning: Cannot modify header information - headers already sent by (output started

Be sure you do not have any white space or blank lines in your script before the

<?php
header("Content-type: image/png");
Banderson 29 Junior Poster in Training

It looks like your sending the wrong header in your output script. Change the header type in your output by putting

header("Content-type: image/png");

in the top of your script.

Banderson 29 Junior Poster in Training

In Apache your httpd.conf file

Be sure that php module is enabled. Take out the # in front of the line if it is there.

If your using PHP version 5 Look for the following lines

LoadModule php5_module "YOUR FULL DIR PATH TO/php5apache2_2.dll"
or substitute 5 for your PHP version.

AddType application/x-httpd-php .php

AddType application/x-httpd-php .php3

If these lines does not exist add them.

Banderson 29 Junior Poster in Training

Yes curl can fetch data from other websites on localhost if it is enabled.

Banderson 29 Junior Poster in Training

Glad you got it fixed, please mark this thread solved.

Banderson 29 Junior Poster in Training

Well it depends on the language too. Web apps are a little more difulcult to deal with sometimes because they are mapped at load time with XML config files. If the mapping is not right in won't execute.

Glad you got it going and good luck

Banderson 29 Junior Poster in Training

Ok your source says that your JavaScript file is 2 directories up.

<script type="text/javascript" src="../../mainapp/scripts/xxx.js"></script>

Try changing this to 1 directory like :

<script type="text/javascript" src="../mainapp/scripts/xxx.js"></script>

and see if that works.

Banderson 29 Junior Poster in Training

Be sure that session_start(); is the first line in each of your codes without spaces or blank lines.

<?php
session_start();
............................
?>
Banderson 29 Junior Poster in Training

Look at your file path :

D:\wamp\www\codeigniter\admin/system/codeigniter/CodeIgniter.php

Your slashes are going the wrong way aren't they? Shouldn't the path be forward slashes? >>>> "\"

hi all,
i am using codeigniter for a shopping cart for my admin panel
i created a first method mentioned here

for this iam getting error failed to open stream 'D:\wamp\www\codeigniter\admin/system/codeigniter/CodeIgniter.php’
i need to add ../ in this line

require_once BASEPATH.'codeigniter/CodeIgniter'.EXT;

how to do this i am getting error for this also any ideas