First this list is not the right one I suggest to use jquery-en...

And second, did you are loading the page for file:// this is a direct
access to the files you should access the page from http:// to get the
php executed...

good luck

On Sun, Nov 9, 2008 at 8:03 PM, bumblebean <[EMAIL PROTECTED]> wrote:
>
> HI. I'm really new to jquery, and PHP for that matter. I'm trying to
> complete a school assignment, and I'm soooo stuck. What I'm trying to
> do is submit form data through jquery to a php page. The php works as
> intended when called outside of jquery. It basically takes some POST
> values, and writes them to a database. It's then supposed to return a
> string which lets a user know the result of the attempt. All I want to
> do is load the resulting string into a div on my form page.
>
> However, in the way I'm calling it from Jquery, I'm doing something
> wrong, since all I'm getting back in my alert message is a huge pop up
> with the entire contents of the PHP page. It's never actually
> processing. Here's my jquery call (the one letter variables are
> derived from my validation script. These also hold the correct
> values):
>
> ***************************************************************************************
>  $.post("bin/uploadstory.php",
>                   {heading: h, story: s, urllink: u, image: p,
> category: c},
>                   function(data){
>                   alert("Data Loaded: " + data);
>                });
> ***************************************************************************************
>
> and here's my php page, bin/uploadstory.php (this is the full code on
> this page).
>
> ***************************************************************************************
>
> <?php
> include("dbconnect.php"); //db connection script
> include("dbstories.php"); // script which writes story to database,
> using a writestory() function
>
> echo(getResult());
>
> function getResult(){
>
>        $msg = "";
>
>        if(connectDB()){
>
>                $user = $_SESSION('userid');
>                $heading = $_POST('heading');
>                $story  = $_POST('story');
>                $urllink  = $_POST('urllink');
>                $image = $_POST('photo');
>                $category = $_POST('category');
>
>                $result = writeStory($user, $heading, $story,
> $urllink, $image,
> $category);
>                        if($result==0)
>                                $msg ="couldn't create record";
>                        else if($result==1)
>                                $msg ="record created, couldn't add
> category";
>                        else if ($result==2)
>                        $msg = "article added successfully";
>                        else $msg = "unknown error occured. please try
> again.";
>                return $msg;
>        }
>        else $msg = "Couldn't connect to the database. Please try
> again
> later.";
>        return $msg;
>
> }
>
> *****************************************************************************************
>
> Can anyone help me out? I've been stuck on this little part for 3
> days, and i know it's something stupid, but i can't figure out what.
>
> >
>



-- 
Perhaps the depth of love can be calibrated by the number of different
selves that are actively involved in a given relationship.

                                        Carl Sagan (Contact)

                                        Jaime Ochoa Malagón
                                        Arquitecto de Soluciones
                                        Cel: +52 (55) 1021 0774

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to