Forums
This topic is locked
New to PHP
Posted 02 Sep 2006 20:58:45
1
has voted
02 Sep 2006 20:58:45 Andrew Pattterson posted:
Hi there,I am currently learning to use PHP using an Apress book PHP Web Development with Dreamweaver MX 2004. I am going ok so far however I have just hit a problem. On a page (index.php) I am displaying all records from a table (artists) and there is a link called "view" next to each artist which passes on the artist_id URL parameter to a new page (artist.php) and displays the artist name on this seperate page. There is a problem though, although when i test the record set in artist.php; it works fine.... however when i actually run the page on the server it just comes up as a blank page. This is the code for the artist.php page : echo $row_rstArtist['artist name']; and this is the link from the original index page to the artist page : artist.php?<?php echo $row_rstArtists['artist pk']; ?>=
Any help would be greatly appreciated as this is bugging me !!
Replies
Replied 03 Oct 2006 19:54:46
03 Oct 2006 19:54:46 Tracy Sweder replied:
Couple of questions - did you not add the underscore to 'artist_pk' as they did in the book, or did you just forget it when typing the code here? Just figure I'd ask in case that simple little "_" is the problem - LOL
My next question, when you created the recordset for the artist page did you make sure to set the URL Parameter (page 178 in your book) ?
My other question is, have you made sure that PHP is running on your server? I'm not sure what you meant by testing the recordset in artist.php because that is shown on index.php (page 179). Is that working correctly on your server? If so, did you remember to call the artist_name on the artist.php page? If you don't have it asking for that particular information anywhere on the page then it won't know where to put the information it is pulling from the database and the page won't have the info on it.
My next question, when you created the recordset for the artist page did you make sure to set the URL Parameter (page 178 in your book) ?
My other question is, have you made sure that PHP is running on your server? I'm not sure what you meant by testing the recordset in artist.php because that is shown on index.php (page 179). Is that working correctly on your server? If so, did you remember to call the artist_name on the artist.php page? If you don't have it asking for that particular information anywhere on the page then it won't know where to put the information it is pulling from the database and the page won't have the info on it.
Replied 04 Oct 2006 06:15:06
04 Oct 2006 06:15:06 LorD ExoskeletoN replied:
hi... try to pass variable to URL? for example do this...
$value = rs['id'];
code a link here for: index.php?variable=$value
$value = rs['id'];
code a link here for: index.php?variable=$value
Replied 06 Oct 2006 00:44:06
06 Oct 2006 00:44:06 S MALHOTRA replied:
hello
iam using flash + Php mailform
the mailform is in flash with its send button i wrote this code in flash send button
<!---
on (release) {
if (!email.length || email.indexOf("@" == -1 || email.indexOf("." == -1) {
results = "Please check your e-mail address.";
} else if (!comments.length) {
results = "Please enter your comments.";
} else if (!name.length) {
results = "Please enter your name.";
} else {
loadVariablesNum ("mywebsite.com/mailform.php", 0, "POST"
results = "Sending Data...";
name = "";
email = "";
comments = "";
}
}
---->
on the php- File .....which is mailform.php
<!--
<?php
$TextVariable = '&results=';
$response = 'Data Sent. Thank You..';
echo $TextVariable;
echo $response;
/* recipients */
$recipient .= " " ;
/* subject */
$subject = "website mail";
/* message */
$message .= "Name: $name
Email: $email
Comments: $commentsn";
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: $name <$email>n";
/* and now mail it */
mail($recipient, $subject, $message, $headers);
?>
----------->
but when i published to my server with flash html + its swf + mailform.php
and when i try my web page and on form page when i type the infomations of the user
and when i send i don't get the mails please help me please !
please !
thank you!
iam using flash + Php mailform
the mailform is in flash with its send button i wrote this code in flash send button
<!---
on (release) {
if (!email.length || email.indexOf("@" == -1 || email.indexOf("." == -1) {
results = "Please check your e-mail address.";
} else if (!comments.length) {
results = "Please enter your comments.";
} else if (!name.length) {
results = "Please enter your name.";
} else {
loadVariablesNum ("mywebsite.com/mailform.php", 0, "POST"
results = "Sending Data...";
name = "";
email = "";
comments = "";
}
}
---->
on the php- File .....which is mailform.php
<!--
<?php
$TextVariable = '&results=';
$response = 'Data Sent. Thank You..';
echo $TextVariable;
echo $response;
/* recipients */
$recipient .= " " ;
/* subject */
$subject = "website mail";
/* message */
$message .= "Name: $name
Email: $email
Comments: $commentsn";
/* additional header pieces for errors, From cc's, bcc's, etc */
$headers .= "From: $name <$email>n";
/* and now mail it */
mail($recipient, $subject, $message, $headers);
?>
----------->
but when i published to my server with flash html + its swf + mailform.php
and when i try my web page and on form page when i type the infomations of the user
and when i send i don't get the mails please help me please !
please !
thank you!