jamesyrawr 0 Newbie Poster

Hi
I'd like someone to just give me a hand getting a form to open up facebox and submit the form details via that.

Ok they process I'm looking for help on is this

When a user enters the details into the contact form and clicks "submit" it needs to then open up a facebox window and run the php file in that.
so it will either pop up and say errors with certain feilds or message sent.
Right now I can't seem to figure it out so i stripped the facebox code out and put my html code back to normal.

I', not too fussed weather the php file opens from a remote file or if it is stored in a hidden Div on the page its self.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<form id="contactForm" action="validator.php" method="post">		
				<div id="OrcFormContentLeft">					
					<ul>
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderName">Name*</label></li>
						<li><input type="text" name="senderName" id="senderName"   required/></li>
                        
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderEmail">Email*</label></li>
						<li><input type="text" name="senderEmail" id="senderEmail" required /></li>
                        
						<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderPhone">Phone Number</label></li>
						<li><input type="text" name="senderPhone" id="senderPhone"  /></li>				
					</ul>
				</div>
				<div id="OrcFormContentRight">
					<ul>
                    	<li><img src="LOLNOIMAGEHA.png" width="16" height="16" /><label for="senderBudget">Monthly SEO Budget*</label></li>
						<li><select name="senderBudget" id="senderBudget"  required/>
                  			 <option value="£0 - £99">£0 - £99</option>
 							 <option value="£100 - £199">£100 - £199</option>
 							 <option value="£200 - £299">£200 - £299</option>
 							 <option value="£300 - £399">£300 - £399</option>
                             <option value="£400 - £499">£400 - £499</option>
                             <option …
jamesyrawr 0 Newbie Poster

I am fairly new to php
but i do have some knowledge of it
im justnot sure how to code what i want.
if anyone can give me some idea of what code i need i'd really appriciate it :)

anyway


photo names will be uploaded to database with a catagory id "live music", "landscapes", "custom names".
a flah file will read an xml file which will then start echoing the correct data for the flash file to present.
i need it to go somthing like "if the catagory id = live music
echo all photos in that album with the catagory id then do the same for each one.

i have this so far

<gallery title="Tony's Photo Album" thumbDir="./images/thumbs/" imageDir="./images/" random="true">
<category name='Live Music'>
<?php
	include ("include/connect.php");
	$query = "SELECT * FROM photo ORDER BY id DESC"; 
	$result = mysql_query ($query)  or die ("Error in query: $query. ".mysql_error());
	
	   
   while ($row = mysql_fetch_array($result))  
   {                                       
         echo  "
		<image>
			<date>".$row['date']."</date>
			<title>".$row['title']."</title>
			<desc>".$row['description']."</desc>
			<thumb>".$row['thumb']."</thumb>
			<img>".$row['image']."</img>
		</image>
		
	";


   }                                                                             
   		 ?>
</category>
</gallery>
jamesyrawr 0 Newbie Poster

i'm not sure i quite understand
if you could explain in slightingly more simpler term
been learning the language now as part of my course for a few weeks so its not fully burnt it yet :P

jamesyrawr 0 Newbie Poster

can anyone help me out with these errors i'm getting please?
and if they can explain why im getting them and how i can avoid them in future
thanks :)

Notice: Undefined index: prod_name in C:\wamp\www\uniwork\update_database.php on line 17

Notice: Undefined index: prod_price in C:\wamp\www\uniwork\update_database.php on line 24

Notice: Undefined index: prod_desc in C:\wamp\www\uniwork\update_database.php on line 31

Notice: Undefined index: prod_colour in C:\wamp\www\uniwork\update_database.php on line 38

<!DOCTYPE HTML PUBLIC  
               "-//W3C//DTD HTML 4.0 Transitional//EN" 
               "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
  <title>Add an Animal with Validation</title> 
</head> 
<body> 
<h2>The action script for adding animal with validation </h2> 
<p>Look at the <a href="addAnimalwithValid.phps">source code</a> and notice there is some validation and cleaning of the data. </p> 
 <?php 
  
      // Create a string to collect and report back any errors 
     $errorString = ""; 
     //See if any info was submitted 
     $prodname = $_GET['prod_name'];  
     //Clean data - trim space 
     $prodname = trim ( $prodname);  
     //Check its ok - if not then add an error message to the error string 
     if (empty($prod_id))  
       $errorString = $errorString."<br>Please supply a product name."; 
	         
     $prodprice = $_GET['prod_price'];    
     //Clean data - trim space 
     $prodprice = trim ( $prodprice); 
     //Check its ok - if not then add an error message to the error string 
     if (empty($prodprice))  
       $errorString = $errorString."<br>Please supply a product price in the £xxx.xx format.";
	      
     $proddesc = $_GET['prod_desc'];    
     //Clean data - trim space 
     $proddesc = trim ( $proddesc); 
     //Check its ok - if not then add an error message to the error string 
     if (empty($proddesc))  
       $errorString = $errorString."<br>Please …
jamesyrawr 0 Newbie Poster

thanks for that
i had made an error in my coding and typed one of the field names differently too how it was in my database too.

but now im getting a new error in it


Notice: Undefined index: price in C:\wamp\www\unisite\products.php on line 13

<?php

    if(isset($_GET['action']) && $_GET['action'] == "add"){
        $id = intval($_GET['id']);
        if(isset($_SESSION['cart'][$id])){
            $_SESSION['cart'][$id]['quantity']++;
        } else {
            $sql2 = "SELECT * FROM products WHERE id_prod = $id ";
            $query2 = mysql_query($sql2);
            
            if(mysql_num_rows($query2) != 0){
                $row2 = mysql_fetch_array($query2);
                $_SESSION['cart'][$row2['id_prod']] = array("quantity" => 1, "price" => $row2['price']);
            } else {
                $message = "This product id is invalid";
            }
        }
    }
?>
<h2 class="message"> <?php if(isset($message)){echo $message;}?> </h2>
<h1>Products page</h1>

<table>
    <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Price</th>
        <th>Action</th>
    </tr>
    <?php
    $sql = "SELECT * FROM products ORDER BY name ASC";
    $query  = mysql_query($sql)or die(mysql_error());
    
    while($row = mysql_fetch_assoc($query)){
    ?>
    
    <tr>
    
        <td><?php echo $row['name']; ?> </td>
        
        <td><?php echo $row['prod_description']; ?> </td>
        
        <td>£<?php echo $row['prod_price']; ?> </td>
        
        <td><a href="index.php?page=products&action=add&id=<?php echo $row['id_prod']; ?>">add to cart</a></td>
    </tr>



<?php

/**
 * @author James Bell
 * @copyright 2010
 */

}

?>
</table>
jamesyrawr 0 Newbie Poster

I seem to get this error message when I run this
please can someone help?

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\unisite\products.php on line 11

I can't figure this out at all :(

<?php

    if(isset($_GET['action']) && $_GET['action'] == "add"){
        $id = intval($_GET['id']);
        if(isset($_SESSION['cart'][$id])){
            $_SESSION['cart'][$id]['quantity']++;
        } else {
            $sql2 = "SELECT * FROM products WHERE prod_id = [$id] ";
            $query2 = mysql_query($sql2);
            
            if(mysql_num_rows($query2) != 0){
                $row2 = mysql_fetch_array($query2);
                $_SESSION['cart'][$row2]['prod_id'] = array("quantity" =>1, "price" => $row2['price']);
            } else {
                $message = "This product id is invalid";
            }
        }
    }
?>
<h2 class="message"> <?php if(isset($message)){echo $message;}?> </h2>
<h1>Products page</h1>

<table>
    <tr>
        <th>Name</th>
        <th>Description</th>
        <th>Price</th>
        <th>Action</th>
    </tr>
    <?php
    $sql = "SELECT * FROM products ORDER BY name ASC";
    $query  = mysql_query($sql)or die(mysql_error());
    
    while($row = mysql_fetch_assoc($query)){
    ?>
    
    <tr>
    
        <td><?php echo $row['name']; ?> </td>
        
        <td><?php echo $row['prod_description']; ?> </td>
        
        <td>£<?php echo $row['prod_price']; ?> </td>
        
        <td><a href="index.php?page=products&action=add&id=<?php echo $row['id_prod']; ?>">add to cart</a></td>
    </tr>



<?php

/**
 * @author James Bell
 * @copyright 2010
 */

}

?>
</table>
jamesyrawr 0 Newbie Poster

Ok for my uni project im wondering if its possible to make a simple game where by the user must click a button ten times to win.
the button has to move after every click to a random point on the screen.
Does anyone know if there are any tutorials for this kind of thing available?
or would it be easy to script?
Thanks
James

jamesyrawr 0 Newbie Poster

hey
i seem to get this everytime i run this file within my login script
Warning: mysql_result() expects parameter 1 to be resource, boolean given in C:\wamp\www\Isis\login.php on line 16
can anyone help me please?
heres my code

<?php


    $username = $_POST['username'];
    $password = $_POST['password'];
    $login = $_GET['login'];
    
    setcookie("username", "$username", time()+86400);

    if ($login=='yes') {
        $con = mysql_connect("localhost","root","");
        mysql_select_db("obsosuser");
        
        $get = mysql_query("SELECT count(id) FROM obsosuser WHERE username='$username' and password='$password'");
        
        $result = mysql_result($get, 0);
        if ($result!=1){
            echo "Invalid Login!";
            
        } else
            echo "Login Successful! Welcome back ".$_COOKIE['username']." Sir/Maddam." ;
            $_SESSION ['username'] = $username;
    }

?>

Thanks

jamesyrawr 0 Newbie Poster

sorry i'll move it over :)

jamesyrawr 0 Newbie Poster

P.S again
sorry about all the emoticons.
i ahve a bad habbit of doing them on msn too.

jamesyrawr 0 Newbie Poster

ok there's a game i want to try and make an application for using Java
i have some knowledge of JavaScript but its only used for drawing pictures and graphs and arranging images :P
what i want to do is create an app for a game called tribal wars
so i can log into my account update my village and stuffs and send attacks
im just mainly wondering if its possible and if so how do i go about starting the coding off please :)
and thank you
P.S
i am studying JavaScript at uni and this could be used as my project for my second year :)

jamesyrawr 0 Newbie Poster

this probably has a simple solution but i cant seem to see whats wrong with it

<?php

//Form Data
//error seems to occur here
echo "<h1>Registration</h1>";


$submit = $_POST['submit'];

$fullname = $_POST['fullname'];
$username = $_POST['username'];
$password = $_POST['password'];
$repeat_password = $_POST['repeat_password'];


if ($submit)
{
   
}
?>
//between these two points

<html>
<form action='register.php' method='POST'>
<table>
    <tr>
        <td>
        Choose a Username:
        </td>
        
        <td>
        <input type='text' name="username">
        </td>
    </tr>
    <tr>
        <td>
        Password:
        </td>
        <td><input type='password' name="password">
        </td>
    </tr>
    <tr>    
        <td>
        Repeat Your Password:
        </td>
        <td><input type='password' name="repeat_password">
        </td>
    </tr>
    <tr>
        <td>
        Your Full Name:
        </td>
        <td><input type='text' name="name">
        </td>
    </tr>
        </table>
        <p><input type='submit' name='submit'></p>

</form>

</html>
jamesyrawr 0 Newbie Poster

Thank you very much :)
Feel stupid now that i didn't notice it :P

jamesyrawr 0 Newbie Poster

Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in C:\wamp\www\registration\login.php on line 19
is the error i get when i run the below code
i cant figure out what is wrong with it. :(

<?php

$username = $_POST ['username'];
$password = $_POST ['password'];

if ($username&&$password){
    $connect = mysql_connect("localhost","root","") or die("Couldn't connect!");
    mysql_select_db("phplogin") or die("Couldn't find db");
    

    
$query = mysql_query("SELECT * FROM users WHERE username='$username");

$numrows = mysql_num_rows($query);

echo $numrows;

    
}
else
    die("Please enter a username and password");
?>