I have this for PHP…
<?php ///if there is a problem here, put sessionstart at top
$idNum = $_POST['idNum'];
//Questions table
$Query = "SELECT * FROM questions WHERE surveyid = '" . $idNum . "'";
$result = mysql_query($Query);
if (!$result)
{
echo "Could not successfully run query ($sql) from DB1: " . mysql_error();
exit;
}
if (mysql_num_rows($result) == 0)
{
echo "No rows found, nothing to print so am exiting1";
exit;
}
//Survey table
$Query2 = "SELECT numQuest FROM surveys WHERE id = '" . $idNum . "'";
$result2 = mysql_query($Query2);
if (!$result2)
{
echo "Could not successfully run query ($sql) from DB1: " . mysql_error();
exit;
}
if (mysql_num_rows($result2) == 0)
{
echo "No rows found, nothing to print so am exiting1";
exit;
}
$rows2 = mysql_fetch_assoc($result2);
$ctr = 1;
while($rows = mysql_fetch_assoc($result))
{
if ($ctr == 1)
{
//echo "GOT HERE";
echo "
“;
echo “
“;
echo “”;
echo “” . $rows['question'];
echo “”;
$ctr ;
}
and so on…
and my Java script isnt working which is:
function moveup() {
var thisline = document.Form10.quest.options.selectedIn…
var lineabove = thisline – 1
//alert(‘lineabove = ‘ lineabove)
if (thisline >= 1) {
{document.Form10.holding.value = document.Form10.quest.options[lineabove]…
//alert(‘document.Form10.holding.value = ‘ document.Form10.holding.value)
{document.Form10.quest.options[lineabo… = document.Form10.quest.options[thisline].…
{document.Form10.quest.options[thislin… = document.Form10.holding.value}
document.Form10.quest.options.selected… = lineabove;
}
// end if
}
// end of moveup
function movedown() {
var thisline = document.Form10.quest.options.selectedIn…
var linebelow = thisline 1
//alert('lineabove = ' lineabove)
if (linebelow < 15) {
{document.Form10.holding.value = document.Form10.quest.options[linebelow]…
//alert('document.Form10.holding.value = ' document.Form10.holding.value)
{document.Form10.quest.options[linebel… = document.Form10.quest.options[thisline].…
{document.Form10.quest.options[thislin… = document.Form10.holding.value}
document.Form10.quest.options.selected… = linebelow;
}
// end if
}
// end of movedown
…What am i doing wrong?
 September 11th, 2009  phpmoz
I need a little help… Please…
I am working on a script but I can’t get one part…
<?php
$Fname = $_POST['Fname'];
$Lname = $_POST['Lname'];
$gender = $_POST['gender'];
$major = $_POST['major'];
$activities = $_POST['activities'];
$email = $_POST['email'];
$comments = $_POST['comments'];
$bgcolor = "";
If ($_POST['gender'] == 'male') {
$bgcolor == "Blue";
} elseif($_POST['gender'] == 'female') {
$bgcolor == "Pink";
}
{
echo "$Fname $Lname, “;
echo “Thank you for completing the survey we have noted that you are are a student majoring in $major who is active in the following clubs:“;
foreach ($activities as $a) {
echo “
$a
“;
}
echo “Your comments $comments have been fowarded to the appropriate person. They may reply to your email address $email”;
}
?>
I need the table in the middle to change colors depending on the gender that is selected.
Can any one help me figure this out… I have tried everything
Vickie S.
 September 11th, 2009  phpmoz
This table is trying to read off of a siteAccessTbl which has two tables related to it. When I run it, I receive this error.
PHP Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/html/php/getSiteAccessTblInfo.p… on line 15
There are two scripts, and one is included in the other. I do not understand how to make these tables work. Please help!! Thanks in advance!!
FINDACCESSINFOTBL.PHP
GETSITEACCESSINFO.PHP
 September 10th, 2009  phpmoz
Prefer an expert in Flash actionscript!!!
-ITS LENGTHY BUT ONLY CUZ I POSTED SCRIPTS!!
I am working on an email form on Flash and I got most of it done. However theres a small mistake that I cant seem to find.
*Heres my actionscript (please check the “if” part since the problem is there):
stop();
var senderLoad:LoadVars = new LoadVars();
var receiveLoad:LoadVars = new LoadVars();
sender.onRelease = function() {
senderLoad.Name = Name.text;
senderLoad.Email = Email.text;
senderLoad.Phone = Phone.text;
senderLoad.Message = Message.text;
senderLoad.sendAndLoad
(“http://mainlinejerky.com/index/
mainlinemail.php”,receiveLoad);
}
receiveLoad.onLoad = function() {
if(this.sentOk) {
_root.gotoAndStop(“success”);
}
else {
_root.gotoAndStop(“failed”);
}
}
*heres my PHP:
MY problem is that even when the fields are empty, one can still submit the form without playing my “failed” message.
What do I need to do? What can I add to play my “failed” message when a field is empty?
Thanks in advanced! Hope the info provided is helpful!
 September 10th, 2009  phpmoz
Given: an array of numbers: {5,4,6,5,6,6,7,8,9,3}
Requirement: The script counts how many occurrences of each number were entered in the array. Afterwards, print all the values with the corresponding number of occurrences.
Additional clause: you may not use array functions
 September 9th, 2009  phpmoz
The original XML file looks something like this.
Dallas.
Tresnjevka. I love the atmosphere on this one.
Motovun.
New York.
Paris.
Color mayhem!
The sleeping monster.
Let me out!
A barrel on the side of the trail.
Subterranean passage.
A train in snow.
Here’s my php
<?PHP
$xml = '’;
$gallPath = ‘/gallery/’;
$link = mysql_connect (“localhost”, “root”, “”);
mysql_select_db (“test”);
$query = ‘SELECT * FROM galleries’;
$results = mysql_query($query);
echo “$xml\n”;
echo “\n”;
while ($line = mysql_fetch_assoc($results)) {
echo “\n”;
echo “ \n”;
echo “\n”;
}
echo “”;
mysql_close($link);
?>
But the output isn’t the same. I’ve changed a few things, obviously, but I would just like that based on the table field galleryTitle, the php would echo each item with that title and then close the node, instead of closing the node after each item.
Does that make sense?
|