samarudge 16 Posting Whiz

Yep except with MySQLi you need link identifyer I.E. when you connect you do something like

$Connection = mysqli_connect(...);

you would just need to use that in your insert query like

mysqli_query($Connection, "INSERT INTO MY_TABLE (NAME, EMAIL, PHONE) VALUES('bob', 'bob@bobssite.com', '555-222-111')") or die(mysqli_error($Connection));
$InsertID = mysqli_insert_id($Connection);

or if using the variable type class use

$Connection->query("INSERT INTO MY_TABLE (NAME, EMAIL, PHONE) VALUES('bob', 'bob@bobssite.com', '555-222-111')");
$InsertID = $Connection->mysql_insert_id();

=)

samarudge 16 Posting Whiz

Hmm... this is an interesting one isn't it though because PHP stands for
PHP Hypertext Preprocessor
Which doesn't really explain what PHP stands for, I think they had HP and just needed another letter so they added a P and couldn't think of anything for it to stand for which effectively leads to the recursive definition:
PHP stands for:
PHP Hypertext Preprocessor stands for:
PHP Hypertext Preprocessor Hypertext Preprocessor stands for:
PHP Hypertext Preprocessor Hypertext Preprocessor Hypertext Preprocessor stands for:
etc.
So you see how the problem happens =P

samarudge 16 Posting Whiz

I think we need to define some basic keywords

all new
Not compatible with earlier versions.

computer expert:
Someone who has not read the instructions, but who will nevertheless feel qualified to install a program and, when it does not function correctly, pronounce it incompatible with the operating system.

clicklexia
A disorder often suffered by novice computer users in which they have a tendency to double-click on items which only require one click, often resulting in two items opening instead of just one.

egosurfing
Typing your own name into google to see who’s talking about you.

FAQ
Frequently Avoided Questions. A company's attempt to answer commonly asked questions such as, "How do I get technical support?"

feature
A hardware limitation, as described by a marketing representative.

flow chart
A graphic representation of a bowl of spaghetti.


freelance
To collect unemployment.


hardware
The parts of a computer which can be kicked.


inbox
A catch basin for everything you don't want to deal with, but are afraid to throw away.

instruction manual
An explanation of how to use something written in a way that is easily understood only by the author.

mouse
An input device designed to make computer errors easier to generate.

Windows
The most expensive way of generating suicidal tendency in yourself.

UNIX
Software designed to …

samarudge 16 Posting Whiz

So the other day I found an AMAZING website
Do you get tired of idiots on forums asking stupid questions?
Do you wish there was a way to get rid of the idiots?
Introducing http://www.lmgtfy.com/
Possibly the best use of flashvars ever =)
(I don't own this site and I wasn't asked to do this I just think its a pretty cool website =D)

samarudge 16 Posting Whiz

I have a .phpfile in the xamp/php/www folder but can't get it to work with lofalhost.

Firstly be more specific (Explain your problem more clearly)
Secondly I was under the impression that XAMPP doc root was
/xampp/htdocs/
but I may be wrong

samarudge 16 Posting Whiz

Hi,
I need to create a function to shorten a numerical ID to a string of letters
E.G.

echo encode_num('1'); //Outputs a
echo encode_num('3'); //Outputs c
echo encode_num('26'); //Outputs z
echo encode_num('27'); //Outputs A
echo encode_num('52'); //Outputs Z
echo encode_num('53'); //Outputs aa
echo encode_num('54'); //Outputs ab

etc.

But I also need to be able to decode them again like

echo decode_num('a'); //Outputs 1

Is this possible to do?
Thanx,
Sam Rudge

samarudge 16 Posting Whiz

ok so i am an avid php developer and i am starting to get into ajax so i can keep file sizes and code down to a minimum.

i am looking in the w3schools ajax examples but i am a little lost at how to send through a variable to the page i am using to process.

what i would like to do is send through an id that is being recalled from the database to tell it what to save over.

any help would be very helpful. thanks in advance

ajax

function action()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  document.myForm.time.value=xmlhttp.responseText;
  }
}
xmlhttp.open("POST","action.php",true);
xmlhttp.send(null);
}

html form

<form action="#" method="post"> 
        <button name="save" type="submit" value="Save" onclick="action();">Save</button>
<input type="text" name="address" />
</form>

Sending data:
The easiest way to send data to your server from the form is using _GET variables
You can take the variables from your form and add them to your string like this

function action()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
{
if(xmlhttp.readyState==4)
  {
  document.myForm.time.value=xmlhttp.responseText;
  }
}
var textfielddata = document.getElementByID('a_field').value;
xmlhttp.open("GET","action.php?Value="+textfielddata);
xmlhttp.send(null);
}

And this would be your new HTML

<form action="#" method="post"> 
<input id="a_field" name='SomeField' type='text' />
        <button name="save" type="submit" value="Save" onclick="action();">Save</button>
<input type="text" name="address" />
samarudge 16 Posting Whiz

Hi,
What is the function/opperator to calculate a power with C#

I tryed

powerof = anumber ^ anothernumber;

and that clearly doesn't work (1^3 is 2, 2^3 is 1 etc.)

How do I do it???

I looked under Math. functions and there was nothing and I spent ages Googleing

Thanx,
Sam

samarudge 16 Posting Whiz

Probz already been posted but hey

Do you believe in Cod?

Christians believe if they do not sin they will have salivation.

We must try to control our animal orgies.

What means “you should never stone the first cast”?

Which religion do you use?

Our church has smaller members every week.

I Know that if I pray hard,
God will forgive me for my shins.

I think maybe our house is haunted with dead goats.

People don’t think for themselves. Most people have the same religion their parrots had.

If you don’t believe in God your spit can go to hell.

The thirty largest religious leaders met to
talk about world hunger.

Jesus lived during the Roman Catholic Empire.

I think Moses was that guy that climbed into a mountain. then he read God’s Ten Big Rules from the top.

Do you believe some part of you
still lives after you are dead?
You mean organ donation?


I don’t agree with some of the conceptions
in that church.

We believe the spit of our ancestors stays with us
and helps our food to grow.

At that time, the romanians had stronger arms so they controled the Judists.

When the bad army tried to follow them in the land of milky honey land, probably they couldn’t walk on water so they sank.

When turtles …

samarudge 16 Posting Whiz
<form id="form1"  action="#" method="post" enctype="multipart/form-data" runat="server" target="myframe">
    <input type="file" id="myfile"   accept="image"  runat="server"/>
    <input type="submit" value="upload"  runat="server" />
    </form>
    <iframe id="myframe" name="myframe">
    </iframe>

Does that work now?

Dhaneshnm commented: Thanks ... +1
samarudge 16 Posting Whiz

I use Fedora 10 and there is a realy good tutorial for setting up everything you need for a LAMP
http://www.howtoforge.com/perfect-server-fedora-10

nav33n commented: Good link.. +11
samarudge 16 Posting Whiz

There are many problems with that.
1 - Unless you spacificaly tell it, PHP will wait till the end of the script before sending ANY information to the browser so that script would not be sent till after 3 seconds.
2 - If it was shown then header() would not work as headers need to be sent before any data.
3 - Most browsers (IE, Netscape/firefox etc) only update the display every 100bites or so

Try this

<?php
header("Refresh: 3;URL=movie_registration.php");		
echo "Your username and password do not match our records";
?>

This will display the page but tell the browser to refresh after 3 seconds to the new page
Regards,
Sam Rudge

JimD C++ Newb commented: Perfect solution to my problem. Thank you! +1
samarudge 16 Posting Whiz

Hmm, it dont look like a missing module in apache as the error outputs the redirect URL

something/mysite/shopping/leftproducts.php?c_id=5

Try asking your webhost but other than that im stumped, sorry :(

Shanti C commented: Thank You Somuch..... +3