Php Help
I have a site I have developed with Dreamweaver 8. The site
has a mix of pages - some with the .html and some with the .php. So
far everything works great. My home page was .html but I saved it
over to .php and updated all the links (Dreamweaver did all of this
for me). Now, I want to use some php code for a news feed. However,
I keep getting the following two errors:
Warning: main(): URL file-access is disabled in the server
configuration in /home/content/s/u/s/sl/html/BMT/index.php on line
139
Warning: main(
http://www.newsfeed.com/tools/steppatch_nc.asp?type=s&t=test&prov=keywords&cat=Business&ca t2=&num_articles=5&show_summaries=Yes&show_sources=No&show_dates=No&title=undefined&keywor ds=B%20Lns&url=&headers_size=12pt&title_size=10pt&title_bold=Yes&font_size=10pt&font_famil y=Arial&text_alignment=Left&space=Yes&titlecolor=%23000000&fcolor=%23000000&desccolor=%230 00000&sourcecolor=%230000FF&datecolor=%23999999):
failed to open stream: no suitable wrapper could be found in
/home/content/s/u/s/sl/html/BMT/index.php on line 139
Line 139 is the closing tag of the php code.
Can anyone help?
quote:
Originally posted by:
brywilson88
Warning: main(): URL file-access is disabled in the server
configuration in /home/content/s/u/s/sl/html/BMT/index.php on line
139
Warning: main(
http://www.newsfeed.com/tools/steppatch_nc.asp?type=s&t=test&prov=keywords&cat=Business&ca t2=&num_articles=5&show_summaries=Yes&show_sources=No&show_dates=No&title=undefined&keywor ds=B%20Lns&url=&headers_size=12pt&title_size=10pt&title_bold=Yes&font_size=10pt&font_famil y=Arial&text_alignment=Left&space=Yes&titlecolor=%23000000&fcolor=%23000000&desccolor=%230 00000&sourcecolor=%230000FF&datecolor=%23999999):
failed to open stream: no suitable wrapper could be found in
/home/content/s/u/s/sl/html/BMT/index.php on line 139
Directly accessing URL's is forbidden on your server.
Therefore you cannot pass a URL as an arguement to a function. This
is a common security setting and you will probably need to use CURL
to get the data from the external URL and then pass the input to
main().
Similar Messages
-
ZEND/Flex - amf-config.php help!!
Have some odd behavior taking place when promoting release builds to my production server.
I have two projects one works - one does not. Both the same settings as far as I can tell.
Using the amf-config.ini file - this test works
[zend]
;set the absolute location path of webroot directory, example:
;Windows: C:\apache\www
;MAC/UNIX: /user/apache/www
;webroot =C:/Program Files/Zend/Apache2/htdocs
webroot = ../../
;set the absolute location path of zend installation directory, example:
;Windows: C:\apache\PHPFrameworks\ZendFramework
;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework
;zend_path =
[zendamf]
amf.production = false
amf.directories[]=xyz/release/services
The next release uses the same gateway and amf-config files - and I get this error.
Class "XYZservice" does not exist: Plugin by name 'XYZservice' was not found in the registry; used paths: : /xyz/release/services/
#0 /var/www/vhosts/xyz.com/httpdocs/ZendFramework/library/Zend/Amf/Server.php(550): Zend_Amf_Server->_dispatch('secure', Array, 'XYZservice')
#1 /var/www/vhosts/xyz.com/httpdocs/ZendFramework/library/Zend/Amf/Server.php(626): Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))
#2 /var/www/vhosts/xyz.com/httpdocs/xyz/release/gateway.php(69): Zend_Amf_Server->handle()
#3 {main}
Have tried many variations - but still no joy. Why does ../../ work and not the direct path? - by the look of it, those directory's are fine.
As I understand it - no matter what set-up you build on (local Windows) and promote to a hosted production server (US, mediatemple) - as long as you configure the amf-config.ini file all should be good. Is this the case? Am I missing something when I do a release build.
Am I better of specifying the "endpoint" in all my service calls in my declarations (mxml code)?
Been going round in circles with this for several months now. Getting to the point where the only way I can deploy is Windows. DO NOT want to go down that road.
Help is much appreciated.
rgds
martin6 Hours of headache later I solved this problem!
So in my case the amf_config.ini was set up correctly with webroot=/fullpath/to/url/root and amf.service=foldername (php in my case)
on my local machine the services file is product.php and everything is groovy and working
I uploaded everything exactly as it is on my machine and got the error you did.
I simply cp product.php to Product.php and it worked
For somereason the zend framework is looking for a file that starts with a capital letter!!!! even though it works fine on my machine and was referenced as product.php! Are you kidding me? What a headache.
Joel -
Hi guys,
Long time, no see! ;-)
Anyway, I've got a question for someone who is pretty darn
good with PHP,
forms, and MySQL. This is ultimately what I need to achieve:
I'm creating a webpage for my university that will allow the
professors in
the IST department to select their preferences in course
choices. I want to
list out each IST course and then give them two different
things to do with
each course. The first thing is they need to select if
they've taught that
IST course before. Secondly, they need to say whether they
"don't want to
teach" the course, are "willing to teach" the course, or
"really want to
teach" the course. OK, hope this makes sense so far. What I
need help with
is figuring out how to put all the choices for each categorey
into one field
in a MySQL database. For example, if they selected the "don't
want to teach"
option (I'm not sure if a drop-box or radio button would work
best...) for
IST 215, IST 110 and IST 230. How can I have those courses
entered into the
single database field called "dontwant?"
This is my code so far:
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or
die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
// Get values from form
$name=$_POST['name'];
$thedate=date('m-j-y');
$taughtbefore=;
$dontwant=;
$willing=;
$reallywant=;
$comments=!trim($_POST['comments']);
// Insert data into mysql
$sql="INSERT INTO $tbl_name(name, thedate, taughtbefore,
dontwant,
willing, reallywant, comments)VALUES('$name', '$thedate',
'$taughtbefore',
'$dontwant', '$willing', '$reallywant', '$comments')";
$result=mysql_query($sql);
// close connection
mysql_close();
Is there a way I can like...append all these values into one
string to pass
into the single database field...? As you can see, I really
don't know how
or what values to assign to those empty strings up there...
I'm really
unsure of how to go about doing this. I hope this makes
sense...
Thanks for any and all of your time!
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Blog:
http://avenuedesigners.com/blog/
Web dev articles, photography, and more:
http://sourtea.com
=============================================
Proud GAWDS member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================Hi Murray,
Allow me to clarify. I ultimately need to display something
like this...and
this would be reading from the MySQL database, and output in
a table on the
webpage:
| No Teach | Want to Teach | Really want |
| IST 250 | IST 420 | IST 330 |
| IST 110 | IST 101 | IST 311 |
| IST 332 | | IST 120 |
| | | IST 440
|
I understand your approach and think it's a good idea. I
guess I should have
a table for each, like: NoTeach, WantToTeach, and ReallyWant.
My question is
how I would put the right IST course into the right table.
Like if they
selected "I don't want to teach" would I have some type of if
statement to
sort them into the right tables? If so, can you give me some
code on how it
would work?
Thanks!
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Blog:
http://avenuedesigners.com/blog/
Web dev articles, photography, and more:
http://sourtea.com
=============================================
Proud GAWDS member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================
"Murray *ACE*" <[email protected]> wrote
in message
news:[email protected]...
> Why would you want to put all of that into a single
field? Sounds like
> the wrong approach to me....
>
> I'd have a NoTeach table, containing at least three
fields -
>
> termDate
> profID
> classID
>
> Each professor's "noteach" selection would then be a
separate record in
> that table, which could all be collated for display....
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
>
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
>
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
> ==================
>
>
> "Shane H" <[email protected]> wrote
in message
> news:[email protected]...
>> Hi guys,
>>
>> Long time, no see! ;-)
>>
>> Anyway, I've got a question for someone who is
pretty darn good with PHP,
>> forms, and MySQL. This is ultimately what I need to
achieve:
>>
>> I'm creating a webpage for my university that will
allow the professors
>> in the IST department to select their preferences in
course choices. I
>> want to list out each IST course and then give them
two different things
>> to do with each course. The first thing is they need
to select if they've
>> taught that IST course before. Secondly, they need
to say whether they
>> "don't want to teach" the course, are "willing to
teach" the course, or
>> "really want to teach" the course. OK, hope this
makes sense so far. What
>> I need help with is figuring out how to put all the
choices for each
>> categorey into one field in a MySQL database. For
example, if they
>> selected the "don't want to teach" option (I'm not
sure if a drop-box or
>> radio button would work best...) for IST 215, IST
110 and IST 230. How
>> can I have those courses entered into the single
database field called
>> "dontwant?"
>>
>> This is my code so far:
>>
>> // Connect to server and select database.
>> mysql_connect("$host", "$username", "$password")or
die("cannot
>> connect");
>> mysql_select_db("$db_name")or die("cannot select
DB");
>>
>> // Get values from form
>> $name=$_POST['name'];
>> $thedate=date('m-j-y');
>> $taughtbefore=;
>> $dontwant=;
>> $willing=;
>> $reallywant=;
>> $comments=!trim($_POST['comments']);
>>
>> // Insert data into mysql
>> $sql="INSERT INTO $tbl_name(name, thedate,
taughtbefore, dontwant,
>> willing, reallywant, comments)VALUES('$name',
'$thedate',
>> '$taughtbefore', '$dontwant', '$willing',
'$reallywant', '$comments')";
>> $result=mysql_query($sql);
>>
>> // close connection
>> mysql_close();
>>
>>
>> Is there a way I can like...append all these values
into one string to
>> pass into the single database field...? As you can
see, I really don't
>> know how or what values to assign to those empty
strings up there... I'm
>> really unsure of how to go about doing this. I hope
this makes sense...
>>
>> Thanks for any and all of your time!
>>
>>
>> --
>> Shane H
>> [email protected]
>>
http://www.avenuedesigners.com
>>
>> =============================================
>> Blog:
>>
http://avenuedesigners.com/blog/
>>
>> Web dev articles, photography, and more:
>>
http://sourtea.com
>> =============================================
>> Proud GAWDS member
>>
http://www.gawds.org/showmember.php?memberid=1495
>>
>> Delivering accessible websites to all ...
>> =============================================
> -
Almost there, still need email php help!
Hey there everyone,
I posted my issue earlier but the thread seems to be dead. I have been researching php syntax and looked at some other examples online, and I think I almost have it. I just need a little extra assistance to get there.
I had my php page partially working earlier, and I was receiving emails from my form submission, but all the data I got was subject and phone number. I didn't get my thank you page to come up either. My form has fields for name, email, phone, 3 comment fields and 3 reference fields. Not sure why I wasn't getting all of the data so I tried redoing my code.
Now, after redoing the code, I get my thank you page to come up, but I don't get any email notification with the submitted data anymore. I am not sure why. I had some code syntax errors but I fixed them through process of elimination and I have no syntax errors now.
Would someone be able to take a look at my files and tell me what I am doing wrong? I am always ready to put in work and test through trial and error, but I just am not sure where to start. I am so close!!!
Thanks for reading and for any advice, I really appreciate it!
JaysonDavid, thank you! It works! You are my new hero!
Well, through it all I learned a lot about syntax, headers, form security, etc etc Very helpful! Even learned about bare LF's lol.
I am trying to also have the thank you page redirect to the manufacturer's page after 5 seconds, and I did some reading about redirect code through meta and php. Not sure if it matters which one I use, and I am also confused about where to put it.
These are what I found:
<head>
<meta http-equiv="refresh" content="5; URL=thankyou.htm">
</head>
<?php
header("refresh: 5; thankyou.htm";
?>
If I use the meta tag, does it go directly in the code on the thank you page? And if I use the pgp code, where does that go? I tried it but the page was having trouble redirecting.
Thanks again for all of your help, and if you feel generous enough to help me with this too I would really appreciate it!
Jayson -
Dreamweaver and PHP Help Needed!
If there is anyone out there who can help, I am working with
a back-end secured website that is in php and need to manipulate
and change pageson-the-fly. I'm not sure how to view and actually
see in Design View my PHP page, as I can best work in Design View.
Can anyone help out there?
The website I need help with is
http://www.businesscreditbuilder.com
Help needed as soon as possible...
Thank you...
If you want to help, I can compensate you for helping with an
immediate page..Thank you for writing. I do need your help, and here's the
scenario. I work for a company that deals with business credit. In
the previous post at
http://www.businesscreditbuilder.com
there is a login. Once logged in, there is a home page for the
members. That first page I need to change as soon as possible for
over 40,000 members. All the members will see the same home page
inside the members area. You're welcome to login as "makaiman",
password is "1143mak" to see the first page that comes inside the
members area I need to change just a little. PHP is installed on a
remote server running on Windows. I need help or guidance on this
immediately but I have to sleep right now as it is 1130pm pacific
and need to have this done by sometime tomorrow morning. I
appreciate all of your help so very much... any advice would be so
much appreciated...
m -
Hi, can anyone help - I'm looking to set up an online
shopping basket on my web site with multiple options for each
product eg. t-shirt - style logo - personalised with name - shirt
colour - size etc. I will only be selling six different products in
total so I don't want anything too over the top.
Is there a PHP/CGI script or shopping basket program that
will allow a customer to make their choices by clicking a radio
button by each option required and then preview the outcome in a
pop-up window or a new page eg. red t-shirt with fish logo on the
front and personalised with a name eg. Matthew, before they make
their purchase?
Any help appreciated
CheersHere is a simple bit of PHP to stick in the page your form posts to. You would need to edit the first three variables to your liking, and add the html you want to serve afterwards:
<pre>
<?php
$emailFrom = '[email protected]';
$emailTo = '[email protected]';
$emailSubject = 'Subject';
$date = date('l, \t\h\e dS \o\f F, Y \a\t g:i A');
$browser = $HTTPSERVER_VARS['HTTP_USERAGENT'];
$hostname = $HTTPSERVER_VARS['REMOTEADDR'];
$message = "$date\n\nAddress: $hostname\nBrowser: $browser\n\n";
foreach ($_POST as $key => $value) {
$message .= $key . ": " . $value . "\n";
$mailResult = mail($emailTo,$emailSubject,$message,"From: $emailFrom");
?>
</pre>
This script will grab the server's date and the submitter's address and browser type. It will then list the name and value of each form field you have put on your form.
Also, this script expects your form method="post".
Lastly, you can offer alternate text later on in your html page based on the success of the above script with a snippet like this:
<pre><?php
if ($mailResult) {
echo "Your comments have been received thank you.";
} else {
echo "There was an error. Please try again or contact us using an alternate method.";
?></pre> -
I am working on a mail form that is linked to my payroll
system. It is working great but there has been a request that I add
a mail to all recipients feature. However I am not to sure how I
would go about doing this, I am hoping someone can help me atler my
current code. Right now the recipient selction is a drop down menu
that is populated from a mySQL table within my payroll system.
I would like the first option when dropped down to be "All
Recipents" so when it is sent the mail is sent to everyone's email
not just the slected individual email.
Below is the current code I have where only one recipent can
be selected.
Thanks in advance!Does your e-mail system support Distribution Lists? If so,
the easiest way
would be to add the appropriate one to your Dropdown list.
If not, then the only other way I see to do this is to check
whether "All
Recipients" is selected. If it is, loop through all of the
addresses and
build up the BCC: string (it's considered a bad practice to
put huge lists
in the TO: field). If not, then use your current code.
HTH
Steve
"bcounts" <[email protected]> wrote in
message
news:[email protected]...
>I am working on a mail form that is linked to my payroll
system. It is
>working
> great but there has been a request that I add a mail to
all recipients
> feature.
> However I am not to sure how I would go about doing
this, I am hoping
> someone
> can help me atler my current code. Right now the
recipient selction is a
> drop
> down menu that is populated from a mySQL table within my
payroll system.
>
> I would like the first option when dropped down to be
"All Recipents" so
> when
> it is sent the mail is sent to everyone's email not just
the slected
> individual
> email.
>
> Below is the current code I have where only one recipent
can be selected.
>
> Thanks in advance!
>
>
>
> ******* HTML CODE *********
> <?
> include('auth.php');
> $user_id = $_GET['user_id'];
> $result = mysql_query("select * from user_info where
user_id = $user_id");
> $row = mysql_fetch_array($result);
> ?>
> <!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>
> <input type="hidden" name="user_id"
value="<?=$user_id?>" />
> <form method="post" action="send_mail.php">
> <table bgcolor=#ffffcc align=center>
> <tr><td><font color=red>*</font>
Name:</td><td><input name="Name"
> value="<?=$row['fname']?>
<?=$row['lname']?>" size=25></td></tr>
> <tr><td><font color=red>*</font>
Email:</td><td><input name="Email"
> value="<?=$row['user_email']?>"
size=25></td></tr>
> <tr>
> <td><font color=red>*</font>
Recipient:</td>
> <td align="left"><select name="sendto">
> <option value="">Select Recipient . .
.</option>
> <?php $sql = mysql_query("SELECT * FROM user_info
ORDER BY lname ASC");
> while
> ($row1 = mysql_fetch_array($sql)) { ?>
> <option value="<?php echo $row1['user_email'];
?>"><?php echo
> $row1['fname'];
> ?> <?php echo $row1['lname']; ?></option>
> <?php } ?>
> </select></td></tr>
> <tr>
> <td><font color=red>*</font>
Subject:</td>
> <td><input size=25
name="Subject"></td></tr>
> <tr><td
colspan=2>Message:</td></tr>
> <tr><td colspan=2 align=center><textarea
name="Message" rows=5
> cols=35></textarea></td></tr>
> <tr><td colspan=2 align=center><input
type=submit name="send" value="Send
> Mail"></td></tr>
> <tr>
> <td colspan=2 align=center><small><font
color=red>*</font> Indicates
> Required
> Field</small></td>
> </tr>
> </table>
> </form>
> </body>
> </html>
>
> ******* PHP CODE *********
>
> <?php
> $to = $_REQUEST['sendto'];
> $from = $_REQUEST['Email'];
> $name = $_REQUEST['Name'];
> $headers = "From: $from";
> $subject = $_REQUEST['Subject'];
>
> $fields = array();
> $fields{"Message"} = "Message";
>
> $body = ""; foreach($fields as $a => $b){ $body .=
sprintf("%20
> %s\n\n",$b,$_REQUEST[$a]);}
>
> if($from == '') {print "You have not entered an email,
please go back and
> try
> again";}
> else {
> if($subject == '') {print "You have not entered a
subject, please go back
> and
> try again";}
> else {
> $send = mail($to, $subject, $body, $headers);
> if($send)
> {header( "Location: index.php" );}
> else
> {print "You did not choose a recipient or the recipent
you have chosen did
> not
> have an email on file.";}
> }
> }
> ?>
> -
Hi, I'm new to PHP, currently the following sets the end date
to the start date:
function afterSetDateValue(ref_field, target_field, date) {
if (date!="") {
var startDate=document.forms[0]["start_date"];
var endDate=document.forms[0]["end_date"];
if (target_field==startDate &&
checkDate(getDateValue(endDate))==0 &&
compareDates(date, getDateValue(endDate))>0) {
setDateValue(endDate, date);
("End Date was earlier than Start Date, it's now set to
Start Date.");
How do I make it so that if the start date is changed to a
date later than the end date, the end date is start date + 1? I'm
sure its a simple PHP, but like i said i'm learning!
Thanksferrarikid123 wrote:
> How do I make it so that if the start date is changed to
a date later than
> the end date, the end date is start date + 1? I'm sure
its a simple PHP, but
> like i said i'm learning!
It's not PHP at all. The script you have shown is JavaScript.
It's also
incomplete. You might get more help if you describe in more
detail
exactly what it is you're trying to do.
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
hey, basic what i would like,,
is a text box, form whatever. that when something is written
then submitted it will insert this data into page, but i would need
several boxs, with multi submit, every box has a seperate cell.
also the current data will be erased.. thankyou
please help
danny
http://www.habboradio1.comThen use the php filesystem functions:
http://www.php.net/manual/en/ref.filesystem.php -
Hey everyone -
I have a quote form on my website that I'd like to tweak a
bit. There are
some fields that have a drop-down box of "Yes" or "No" and
directly after
that it says, "If Yes, ..." So, no matter which option is
chosen, the user
still sees that even if it doesn't apply to them - which I'm
OKAY with for
the time being, but wish to implement it differently.
If the user selects "Yes" - I'd like the the field that says
the question I
*need* to ask the user if they choose "Yes." If they select
"No," than the
box is never shown. Sounds simple enough, right? Right ...
My concern is a). how to show this hide/don't hide
functionality, and b).
how to validate (require) the box being "shown" if they
choose "Yes" and to
NOT validate (require) if they choose "No."
I'm going to upload a .html file to my server that has the
full code for my
quote.php page in plain text, so someone can help me
implement this.
Quote source code:
http://www.avenuedesigners.com/tests/quote_source.html
I colored the big chunks of PHP code red, and the form blue
for ease.
I've tried something like this:
<?php
if ($_POST['havewebsite'] == "Yes") {
echo ('<p class="labelbold">If yes, What is the Domain
Name?</p>
<input name="currentdomain" type="text"
class="contactfield2 inputstyled"
id="currentdomain" value="<?php if
(isset($_POST[\'currentdomain\'])) echo
htmlentities($_POST[\'currentdomain\']);?>" tabindex="11"
/>');
?>
And run into two problems:
1. It only shows up when the page is submitted, and I'm
naturally assuming
this is because of the $_POST being in there. I need it to
display
immediately if they select "Yes."
2. It physically prints out: <?php if
(isset($_POST[\'currentdomain\']))
echo htmlentities($_POST[\'currentdomain\']);?> - as the
value of the
textfield instead of leaving it blank/printing the previously
entered text.
How can I fix these, guys? Thank you!
Shane H
[email protected]
http://www.avenuedesigners.com
=============================================
Proud GAWDS Member
http://www.gawds.org/showmember.php?memberid=1495
Delivering accessible websites to all ...
=============================================you can apply a show-hide layer behavior to the YES check box
(onClick="MM_ShowHideLayers...)
and have the inverse show;hide behavior applied toi the NO
checkbox.
Once you have a Layer on your page and have applied the
behavior, you change that Layer into a
regular div by the way, just leave the same id.
Then, for validating the question only if yes is selected:
<?php
if ($_POST['have_a_website'] == 'yes' &&
empty($_POST['question'])){
$error = TRUE;
?>
Shane H wrote:
> Hey everyone -
>
> I have a quote form on my website that I'd like to tweak
a bit. There are
> some fields that have a drop-down box of "Yes" or "No"
and directly after
> that it says, "If Yes, ..." So, no matter which option
is chosen, the user
> still sees that even if it doesn't apply to them - which
I'm OKAY with for
> the time being, but wish to implement it differently.
>
> If the user selects "Yes" - I'd like the the field that
says the question I
> *need* to ask the user if they choose "Yes." If they
select "No," than the
> box is never shown. Sounds simple enough, right? Right
>
> My concern is a). how to show this hide/don't hide
functionality, and b).
> how to validate (require) the box being "shown" if they
choose "Yes" and to
> NOT validate (require) if they choose "No."
>
> I'm going to upload a .html file to my server that has
the full code for my
> quote.php page in plain text, so someone can help me
implement this.
>
> Quote source code:
>
http://www.avenuedesigners.com/tests/quote_source.html
>
> I colored the big chunks of PHP code red, and the form
blue for ease.
>
> I've tried something like this:
>
> <?php
> if ($_POST['havewebsite'] == "Yes") {
> echo ('<p class="labelbold">If yes, What is the
Domain Name?</p>
> <input name="currentdomain" type="text"
class="contactfield2 inputstyled"
> id="currentdomain" value="<?php if
(isset($_POST[\'currentdomain\'])) echo
> htmlentities($_POST[\'currentdomain\']);?>"
tabindex="11" />');
> }
> ?>
>
> And run into two problems:
>
> 1. It only shows up when the page is submitted, and I'm
naturally assuming
> this is because of the $_POST being in there. I need it
to display
> immediately if they select "Yes."
>
> 2. It physically prints out: <?php if
(isset($_POST[\'currentdomain\']))
> echo htmlentities($_POST[\'currentdomain\']);?> - as
the value of the
> textfield instead of leaving it blank/printing the
previously entered text.
>
> How can I fix these, guys? Thank you!
>
seb ( [email protected])
http://webtrans1.com | high-end web
design
Downloads: Slide Show, Directory Browser, Mailing List -
PHP Help with inherited database site
Hope someone can help with this, although I might be a bit vague. (But will be happy to post any code that might help.)
Basically I do a few sites for a company, and everything is coming together nicely moving everything to a new reseller hosting account where everything can site. I'm basically doing some redesign and new database work for them.
But there's one site I'm basically just trying to move over, that already has a database. I've copied the site onto the new hosting, copied the database across and created a new connection file.
I must admit the code is all a bit more PHPO heavy than what I'm used to working with. so have run into a problem trying to figure out what data is not displaying due to queries failing. As far as I can tell the connection is working, and the queries have not changed.
Anyway - the main page is here, where you should be able to click on the furniture images to go to the product page :
http://www.miradatravelmedia.com/lusty/public_html/index.php
But when you click through the product page query is failing :
http://www.miradatravelmedia.com/lusty/public_html/products.php?category=1
The products page is mostly PHP and looks like this :
[PHP]<?php
if (!@empty($_REQUEST["img"])) {
require_once("../includes/hft_image.php");
$img = new hft_image($_REQUEST["img"]);
$img->resize(200,180,"-");
$img->output_resized("");
exit;
$page = "products";
include("../includes/header.php");
include("../includes/db_open.php");
$sql = "SELECT `id`, `name` FROM `categories` WHERE `id` = '" . $_REQUEST["category"] . "'";
$result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
$category = mysql_fetch_assoc($result);
?>
<div id="trail"><a href="shop.php">Shop</a> > Lloyd Loom <?php echo $category["name"]?></div>
<div class="clear" id="divider1"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
<h1>Lloyd Loom <?php echo $category["name"]?></h1>
<?php
$sql =
"SELECT * " .
"FROM `products` " .
"WHERE `category` = '" . $_REQUEST["category"] . "' " .
"ORDER BY `order`";
$result = mysql_query($sql) or die("Query failed : $sql at line " . __line__);
if (mysql_num_rows($result) == 0) {
?>
<p>Coming soon ...</p>
<?php
} else {
$n = 0;
while ($row = mysql_fetch_assoc($result)) {
$n++;
?>
<a href="product.php?id=<?php echo $row["id"]?>" class="product"<?php if ($n == mysql_num_rows($result)) echo " id=\"last\""?>>
<?php
if ($file = glob("images/products/" . $row["id"] . "_*.*")) {
?>
<img src="img.php?img=<?php echo $file[0]?>&width=200&height=180" alt="<?php echo $row["code"]?>" />
<?php
} else {
?>
<div id="no_image">No image found</div>
<?php
?>
<?php echo $row["code"]?>
</a>
<?php
if (is_int($n / 4)) {
?>
<div class="clear"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
<?php
?>
<div class="clear" id="divider2"><img src="images/spacer.gif" alt="<?php echo keyword()?>" /></div>
<?php
include("../includes/footer.php");
?>[/PHP]
If anyone could shed any light on what's going wrong still, that would be much appreciated.
Thanks.Iain71 wrote:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''categories' WHERE 'id' = '1'' at line 1
So it does look a bit odd with the quotes.
Column names in a SQL query must not be in quotes. The MySQL error message tells you that the SQL syntax error is "near" the section it refers to. In other words, the error is just before that part of the query. Normally, you need to display the whole query to spot the error, but it's obvious in this particular case, because there's a quotation mark after categories, indicating that you've put the column name in quotes. Anyway, you've solved that problem by using the version I suggested.
I still haven't managed to establish where this vat.php file is - is there any explanation for it not being visible on the original hosting server where the site is working? And could it have anything to do with the query not working?
No, it has nothing to do with the query not working, and the reason you can't see it on the live site is because there's no error. The error message on your test site tells you exactly where to look for the problem. The file vat.php is included by header.php on line 19. Either vat.php isn't on your server, or the code on line 19 of header.php is pointing to the wrong location. -
I had set up my Apache and PHP via the terminal last year, and had it working properly in the browser under localhost. I stopped working with it for a year, and am now trying to figure out how to get it up and running again. I have a bad feeling that it's been somehow wiped out. I open a terminal window, type in the command to start apache, it asks me for my root password, accepts it, but then opens up an empty PICO window. I have no idea of where to begin trouble shooting this. Any help would be appreciated.
ibook Mac OS X (10.3.4)The file that causes the "starting apache" isn't located in the Apache directory -- it's somewhere in /etc .
Updating the OS can occasionally wipe out non-standard installations -- Apache 2 being one such. That's why I remarked that version 1.x is a fine option -- OS X manages it and doesn't kill customizations you make to configurations (as in httpd.conf).
So you can try to get PHP working with Apache 1.x. Or you can try installing Apache 2 again. Make sure you follow instructions specifically for OS X, and make some notes about what you did (put comments in the configuration files, and send yourself an email with links to the instructions, a list of the files you changed, etc).
But sometimes the easiest way to go is to do a clean install of the OS. That puts everything back to where it's supposed to be, and you can take small steps customizing things. You no doubt have a lot of detritus piled up in your system.
Other people definitely think that my way is a bit radical, so before you take my advice, see if someone comes up with some better advice.
Also, let me recommend that you find a quick tutorial for Unix and Terminal. SInce you want to work with some non-standard, non-GUI apps, you will benefit from having some really basic commands (cd, ls, chmod, sudo, tar for example). Here's a good one: <http://www.macdevcenter.com/pub/a/mac/2005/05/20/terminal1.html> -
EMAIL: AS3 to PHP → HELP?←
HERE IS MY FLASH ACTION SCRIPT TO SEND EMAIL FOR FORM. PLEASE HELP ME TO FIND WHAT I AM DOING WRONG
[CODE]
send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
function fl_MouseClickHandler(event:MouseEvent):void
if (theName.text == "" || theEmail.text == "")
theFeedback.text = "*Required.";
else
// Create a variable container
var allVars:URLVariables = new URLVariables();
allVars.box1 = box_1.text;
allVars.box2 = box_2.text;
allVars.box3 = box_3.text;
allVars.box4 = box_4.text;
allVars.box5 = box_5.text;
allVars.name = theName.text;
allVars.email = theEmail.text;
//Send info to url
var mailAddress:URLRequest = new URLRequest("http://www.paintedthetown.com/email.php");
mailAddress.data = allVars;
mailAddress.method = URLRequestMethod.POST;
sendToURL(mailAddress);
theFeedback.text = "Thank you :)";
box_1.text = "";
box_2.text = "";
box_3.text = "";
box_4.text = "";
box_5.text = "";
theName.text = "";
theEmail.text = "";
[/CODE]
THIS SEEMS TO BE WORKING BECAUSE I RECEIVE EMAIL BUT IT IS EMPTY (without info)
HERES THE PHP CODE
[PHP]
<?php
//Shows where to send the email.
//Shows what the subject will be in the email.
$sendTo = "[email protected]";
$subject = "Flash Reply";
//Headers to show the information sent.
$headers = " 1: " . $POST[box_1] .
$headers = " 2: " . $POST[box_2] .
$headers = " 3: " . $POST[box_3] .
$headers = " 4: " . $POST[box_4] .
$headers = " 5: " . $POST[box_5] .
$headers = " Name: " . $POST[theName] .
$headers = " Email: " . $POST[theEmail] .
// once the variables have been defined, they can be included
// in the mail function call which will send you an email
mail($sendTo, $subject, $headers);
?>
[/PHP]
WHAT AM I DOING WRONG??Hi,
to create a message, you could use
$message = "Mail from {$_POST['name']}
Email: {$_POST['email']}
1: {$_POST{'box_1'}
2: {$_POST{'box_2'}
note: you use theEmail and email in your actions. Your php will see "email" (the one used with the URLVariables)
Please avoid putting user-supplied info (such as email) into mail headers without filtering - someone could use your server to Bcc spam messages -
Php database.php help!!
heya everyone im making a empire building game in php for now just to see how it go's etc
anyway ive got basics sorted kind of
but now im getting ALOT of errors in my database.php file ALOT
here is the the errors i get on homepage of game site,.
"Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 380
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 381
Warning: mysql_close(): supplied argument is not a valid MySQL-Link resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 383
Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 402
Warning: mysql_numrows(): supplied argument is not a valid MySQL result resource in /www/zzl.org/s/p/o/spoonynicks/htdocs/include/database.php on line 404
as you can tell this anit so good for me
in my databse file this is the first error line
" /* Calculate number of users at site */
$q = "SELECT * FROM ".TBL_ACTIVE_USERS;
$result = mysql_query($sql,$con);
echo mysql_num_rows($result);
im stuck i have changed everything i can think of ive got new codes etc
HERE IS THE DOWNLOAD LINK FOR DATABASE.PHP
please download file and please if you can help please please do so.
THANK YOU SO MUCH!!!!
http://www.2shared.com/file/9HjFaj2p/database.htmlLooks to me like TBL_ACTIVE_USERS is a MySQL table name? If so you need to make it part of the string.
$q = "SELECT * FROM TBL_ACTIVE_USERS";
If TBL_ACTIVE_USERS is a variable, then it needs the '$'.. $TBL_ACTIVE_USERS
Am I not understanding the definition of TBL_ACTIVE_USERS ??
Good luck. -
I need someone to help me with this.The form information does
not come into my email. Server accepts PHP files so it has to be
something in the scripting, either Actionscript or PHP.
Might be best if you email me so I can send you samples. It
would be easier to understand. My email is [email protected]
(adelphia merged with comcast). I really need to solve this. An
experienced actionscript/php developer should be able to solve the
problem. Hope I hear from you soon. Put in subject line: HELP PHP
Actionscript or something like that so I can recognize the message.
Mary Alice
[email protected]I attached the code to the submit button and on publish it
returned the following error:
**Error** Scene=Scene 1, layer=Layer 3, frame=1:Line 1:
Statement must appear within on handler
submitBtn.onPress=function(){
So it says it must appear within an "on handler" so I put all
your code within an on(Release) handler and republished. It
returned no errors. However, when tested, I entered the data and
pressed submit and nothing happened.
Thank you for your help so far, hopefully we can get this
figured out.
I'm using Flash 8, not CS3 if that makes a difference.
Maybe you are looking for
-
I'd like to speak to the organ grinder please...
Hi everyone I've been an Infinity customer for nearly 2 months now and on the whole, i'm a happy customer. I did have an issue resolved a few weeks back where it turned out that my DSLAM/CAB port was faulty and i was cutover to a spare/new port and e
-
Any way to work with multiple layers once map is mapped to a sphere?
I'm working on a history documentary about World War II and I have a map of the world divided into colonial empires. Each empire is a separate layer. I know how to take the world map and apply it to a sphere in Photoshop CS4 Extended. The problem is
-
BEA and WebGain Accelerate Time-to-Market for E-Commerce Solutions with Integrated E-Commerce Development Environment for BEA WebLogic BEA Resells New WebGain Studio to Enable Customers to Speed Development of Java and Web-Based Applications SAN JOSE
-
iweb on a new computer I bought a new iMac and I want iweb datas transferred from the old Mac Pro to the new Mac. Where and what I need to copy iWeb datas? Can someone help me. thank you very much Peter
-
Hello all, Just today my iPod Touch is not being recognized by my macbook pro - OSX Mountain Lion. Literally was working yesterday. I have tried all the suggestions and trouble shooting and have scoured these community pages for an answer trying ev