magicandmight
IS-IT--Management
I am using the following procedure to create a query string in the url.
<script type="text/javascript"><!--
function doSomethingSpectacular() {
var splitAtEqual;
var theWholeUrl = document.location;
var splitAtQMark = theWholeUrl.split("?");
if ( isArray( splitAtQMark ) ) {
splitAtEqual = splitAtQMark[1].split("=");
}
if ( isArray( splitAtEqual ) ) {
alert( splitAtEqual[0] + " equals " + splitAtEqual[1] );
}
}
//--></script>
<body onload="doSomethingSpectacular();">
With the link as: <a href="thenextpage.html?mycoolvariable=stuff">Click Me</a>
How would I pull what is after the equal sign into a variable that I can put in the SQL statement:
$query = "SELECT CoName,Anchor FROM list WHERE Gcat LIKE '%worship%' and Anchor <> '' ORDER by CoName";
where what is after the equal sign would take the place of %worship%
<script type="text/javascript"><!--
function doSomethingSpectacular() {
var splitAtEqual;
var theWholeUrl = document.location;
var splitAtQMark = theWholeUrl.split("?");
if ( isArray( splitAtQMark ) ) {
splitAtEqual = splitAtQMark[1].split("=");
}
if ( isArray( splitAtEqual ) ) {
alert( splitAtEqual[0] + " equals " + splitAtEqual[1] );
}
}
//--></script>
<body onload="doSomethingSpectacular();">
With the link as: <a href="thenextpage.html?mycoolvariable=stuff">Click Me</a>
How would I pull what is after the equal sign into a variable that I can put in the SQL statement:
$query = "SELECT CoName,Anchor FROM list WHERE Gcat LIKE '%worship%' and Anchor <> '' ORDER by CoName";
where what is after the equal sign would take the place of %worship%