php-windows Digest 4 Jul 2010 20:38:55 -0000 Issue 3837
Topics (messages 30204 through 30212):
Re: [PHP-DB] Need help with HTML form errors
30204 by: Kesavan Rengarajan
Re: Need help with HTML form errors
30205 by: Sascha Meyer
30206 by: nagendra prasad
Re: [phpXperts] Need help with HTML form errors
30207 by: Nurul Abser
30209 by: Phansys Corp
Image linking help in PHP
30208 by: nagendra prasad
Re: [PHP-DB] Image linking help in PHP
30210 by: nagendra prasad
30211 by: Vinay Kannan
30212 by: Karl DeSaulniers
Administrivia:
To subscribe to the digest, e-mail:
php-windows-digest-subscr...@lists.php.net
To unsubscribe from the digest, e-mail:
php-windows-digest-unsubscr...@lists.php.net
To post to the list, e-mail:
php-wind...@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
Hi,
Those are notices not warnings(meaning they can be ignored sometimes,
search for error_reporting in the PHP manual).
In your example, if you do not wish ignore the notices, then
initialize the different variables to some value.
Sent from my iPhone
On 04/07/2010, at 6:30 PM, nagendra prasad <nagendra802...@gmail.com>
wrote:
Hi All,
I have this php form that I have inserted in the result page.
***
***
***
***
***
***
***
***
***
*********************************************************************
<form action="index.php" method="post">
<table class="bd" border="0" cellspacing="1" cellpadding="4">
<tr>
<td><b></
b>&
nbsp;
</
td>
<td><input type="text" name="filter" value="<?php echo $filter ?>"></
td>
<td><input type="submit" name="action" value="Search"></td>
<td><select name="filter_field" style="width:100px;">
<option value="">All Fields</option>
<option value="<?php echo "Type" ?>"<?php if ($filterfield ==
"type") { echo
"selected"; } ?>><?php echo htmlspecialchars("Type") ?></option>
<option value="<?php echo "Name" ?>"<?php if ($filterfield ==
"name") { echo
"selected"; } ?>><?php echo htmlspecialchars("Name") ?></option>
<option value="<?php echo "Date" ?>"<?php if ($filterfield ==
"date") { echo
"selected"; } ?>><?php echo htmlspecialchars("Date") ?></option>
<option value="<?php echo "Size" ?>"<?php if ($filterfield ==
"size") { echo
"selected"; } ?>><?php echo htmlspecialchars("Size") ?></option>
</select></td>
</tr>
</table>
<hr size="1" noshade>
***
***
*********************************************************************
The above code is giving me the following errors:
<br /> <b>Notice</b>: Undefined variable: filter in
<b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br />
Notice: Undifined Variable: filterfield in c:\wamp\www\5_final
\index.php on
line 233 > Type
Notice: Undifined Variable: filterfield in c:\wamp\www\5_final
\index.php on
line 234 > Name
Notice: Undifined Variable: filterfield in c:\wamp\www\5_final
\index.php on
line 235 > Date
Notice: Undifined Variable: filterfield in c:\wamp\www\5_final
\index.php on
line 236 > Size
*Please help me with these errors.*
--- End Message ---
--- Begin Message ---
Good morning Nagendra,
Nagendra wrote:
> ...
> The above code is giving me the following errors:
> <br /> <b>Notice</b>: Undefined variable: filter in
> <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br />
> Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php
on
> line 233 > Type
> ...
The error occurs because you did not initialize the $filter and $filterfield
variables before using them; this does not indicate an error because these
variables will most likely not be set when the form is displayed initially.
You have multiple options to avoid this error:
1) Change the error_reporting setting in your php.ini or set
"error_reporting (E_ALL & ~(E_STRICT|E_NOTICE));" inside your php script.
>> This disables PHP notices but could make debugging a bit more
complicated.
2) Initialize the variables before using them:
[CODE]
// I assume the variables will be passed by the form, that's why they are in
the
// superglobal $_POST array; if the variable has been passed (isset(...),
use it,
// otherwise initialize with false
$filter = isset($_POST["filter"]) ? $_POST["filter"] : false;
$filterfield = isset($_POST["filterfield"]) ? $_POST["filterfield"] : false;
[/CODE]
HTH!
Regards,
Sascha
--- End Message ---
--- Begin Message ---
Hi Everyone,
Sorry, I haven't mentioned in my earlier mail that the variables $filter and
$filterfield are global variables which I already defined.
Best,
Guru.
--- End Message ---
--- Begin Message ---
Dear coder,
New version of php give php Notice if the script contain any variable which
has not value. Please debug your script by printing the varible and confirm
that the varible got value.
Thanks
Abser
On Sun, Jul 4, 2010 at 4:30 PM, nagendra prasad <nagendra802...@gmail.com>wrote:
>
>
> Hi All,
>
> I have this php form that I have inserted in the result page.
>
>
> ************************************************************************************************
> <form action="index.php" method="post">
> <table class="bd" border="0" cellspacing="1" cellpadding="4">
> <tr>
>
> <td><b></b> </td>
> <td><input type="text" name="filter" value="<?php echo $filter ?>"></td>
> <td><input type="submit" name="action" value="Search"></td>
>
> <td><select name="filter_field" style="width:100px;">
> <option value="">All Fields</option>
> <option value="<?php echo "Type" ?>"<?php if ($filterfield == "type") {
> echo "selected"; } ?>><?php echo htmlspecialchars("Type") ?></option>
> <option value="<?php echo "Name" ?>"<?php if ($filterfield == "name") {
> echo "selected"; } ?>><?php echo htmlspecialchars("Name") ?></option>
> <option value="<?php echo "Date" ?>"<?php if ($filterfield == "date") {
> echo "selected"; } ?>><?php echo htmlspecialchars("Date") ?></option>
> <option value="<?php echo "Size" ?>"<?php if ($filterfield == "size") {
> echo "selected"; } ?>><?php echo htmlspecialchars("Size") ?></option>
>
> </select></td>
>
> </tr>
>
>
> </table>
>
> <hr size="1" noshade>
>
> ***************************************************************************
>
> The above code is giving me the following errors:
>
> <br /> <b>Notice</b>: Undefined variable: filter in
> <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br />
>
> Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on
> line 233 > Type
> Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on
> line 234 > Name
> Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on
> line 235 > Date
> Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php on
> line 236 > Size
>
>
>
> *Please help me with these errors.*
> __._,_.___
> Reply to
> sender<nagendra802...@gmail.com?subject=need+help+with+html+form+errors>|
> Reply
> to group<phpexpe...@yahoogroups.com?subject=need+help+with+html+form+errors>|
> Reply
> via web
> post<http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJyYW9jcGFoBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawNycGx5BHN0aW1lAzEyNzgyNTI4MzY-?act=reply&messageNum=13698>|
> Start
> a New
> Topic<http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJmY244YjNjBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyNzgyNTI4MzY->
> Messages in this
> topic<http://groups.yahoo.com/group/phpexperts/message/13698;_ylc=X3oDMTM3cDJldWR0BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzEyNzgyNTI4MzYEdHBjSWQDMTM2OTg->(
> 1)
> Recent Activity:
>
> - New
> Members<http://groups.yahoo.com/group/phpexperts/members;_ylc=X3oDMTJnbG4yOTNwBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxMjc4MjUyODM2?o=6>
> 5
>
> Visit Your
> Group<http://groups.yahoo.com/group/phpexperts;_ylc=X3oDMTJmYzRidjg5BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyNzgyNTI4MzY->
> Visit phpXperts website at www.phpxperts.net
> [image: Yahoo!
> Groups]<http://groups.yahoo.com/;_ylc=X3oDMTJlcGZrN2RuBF9TAzk3NDc2NTkwBGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTI3ODI1MjgzNw-->
> Switch to:
> Text-Only<phpexperts-traditio...@yahoogroups.com?subject=change+delivery+format:+Traditional>,
> Daily
> Digest<phpexperts-dig...@yahoogroups.com?subject=email+delivery:+Digest>•
> Unsubscribe <phpexperts-unsubscr...@yahoogroups.com?subject=unsubscribe> •
> Terms of Use <http://docs.yahoo.com/info/terms/>
> .
>
> __,_._,___
>
--- End Message ---
--- Begin Message ---
Try the next verification to see what's the var
<?php if (isset($_POST['filter']) && !empty($_POST['filter'])) {
var_dump($_POST['filter']);
} ?>
Best regards.
2010/7/4 Nurul Abser <abser...@gmail.com>
> Dear coder,
>
> New version of php give php Notice if the script contain any variable which
> has not value. Please debug your script by printing the varible and confirm
> that the varible got value.
>
> Thanks
>
> Abser
>
> On Sun, Jul 4, 2010 at 4:30 PM, nagendra prasad <nagendra802...@gmail.com
> >wrote:
>
> >
> >
> > Hi All,
> >
> > I have this php form that I have inserted in the result page.
> >
> >
> >
> ************************************************************************************************
> > <form action="index.php" method="post">
> > <table class="bd" border="0" cellspacing="1" cellpadding="4">
> > <tr>
> >
> >
> <td><b></b> </td>
> > <td><input type="text" name="filter" value="<?php echo $filter ?>"></td>
> > <td><input type="submit" name="action" value="Search"></td>
> >
> > <td><select name="filter_field" style="width:100px;">
> > <option value="">All Fields</option>
> > <option value="<?php echo "Type" ?>"<?php if ($filterfield == "type") {
> > echo "selected"; } ?>><?php echo htmlspecialchars("Type") ?></option>
> > <option value="<?php echo "Name" ?>"<?php if ($filterfield == "name") {
> > echo "selected"; } ?>><?php echo htmlspecialchars("Name") ?></option>
> > <option value="<?php echo "Date" ?>"<?php if ($filterfield == "date") {
> > echo "selected"; } ?>><?php echo htmlspecialchars("Date") ?></option>
> > <option value="<?php echo "Size" ?>"<?php if ($filterfield == "size") {
> > echo "selected"; } ?>><?php echo htmlspecialchars("Size") ?></option>
> >
> > </select></td>
> >
> > </tr>
> >
> >
> > </table>
> >
> > <hr size="1" noshade>
> >
> >
> ***************************************************************************
> >
> > The above code is giving me the following errors:
> >
> > <br /> <b>Notice</b>: Undefined variable: filter in
> > <b>C:\wamp\www\5_Final\index.php</b> on line <b>228</b><br />
> >
> > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php
> on
> > line 233 > Type
> > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php
> on
> > line 234 > Name
> > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php
> on
> > line 235 > Date
> > Notice: Undifined Variable: filterfield in c:\wamp\www\5_final\index.php
> on
> > line 236 > Size
> >
> >
> >
> > *Please help me with these errors.*
> > __._,_.___
> > Reply to sender<
> nagendra802...@gmail.com?subject=need+help+with+html+form+errors>| Reply
> > to group<
> phpexpe...@yahoogroups.com?subject=need+help+with+html+form+errors>| Reply
> > via web post<
> http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJyYW9jcGFoBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawNycGx5BHN0aW1lAzEyNzgyNTI4MzY-?act=reply&messageNum=13698>|
> Start
> > a New Topic<
> http://groups.yahoo.com/group/phpexperts/post;_ylc=X3oDMTJmY244YjNjBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNudHBjBHN0aW1lAzEyNzgyNTI4MzY-
> >
> > Messages in this topic<
> http://groups.yahoo.com/group/phpexperts/message/13698;_ylc=X3oDMTM3cDJldWR0BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARtc2dJZAMxMzY5OARzZWMDZnRyBHNsawN2dHBjBHN0aW1lAzEyNzgyNTI4MzYEdHBjSWQDMTM2OTg-
> >(
> > 1)
> > Recent Activity:
> >
> > - New Members<
> http://groups.yahoo.com/group/phpexperts/members;_ylc=X3oDMTJnbG4yOTNwBF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2bWJycwRzdGltZQMxMjc4MjUyODM2?o=6
> >
> > 5
> >
> > Visit Your Group<
> http://groups.yahoo.com/group/phpexperts;_ylc=X3oDMTJmYzRidjg5BF9TAzk3MzU5NzE0BGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDdnRsBHNsawN2Z2hwBHN0aW1lAzEyNzgyNTI4MzY-
> >
> > Visit phpXperts website at www.phpxperts.net
> > [image: Yahoo! Groups]<
> http://groups.yahoo.com/;_ylc=X3oDMTJlcGZrN2RuBF9TAzk3NDc2NTkwBGdycElkAzEzODc3MTg3BGdycHNwSWQDMTcwNTAwNjc2NARzZWMDZnRyBHNsawNnZnAEc3RpbWUDMTI3ODI1MjgzNw--
> >
> > Switch to: Text-Only<
> phpexperts-traditio...@yahoogroups.com?subject=change+delivery+format:+Traditional
> >,
> > Daily Digest<
> phpexperts-dig...@yahoogroups.com?subject=email+delivery:+Digest>•
> > Unsubscribe <phpexperts-unsubscr...@yahoogroups.com?subject=unsubscribe>
> •
> > Terms of Use <http://docs.yahoo.com/info/terms/>
> > .
> >
> > __,_._,___
> >
>
--- End Message ---
--- Begin Message ---
Hi All,
I have a database of MP3 and I want to link the download tab with an image
so that when user clicks on the image the download should start. I have full
path of MP3 in my database, I just want to link the same image with every
song. I don't want to upload the image to mysql database. I hope I am clear
with my issue. Please do let me know if I am not clear.
Best,
Guru.
--- End Message ---
--- Begin Message ---
Thanks Jason, However will this work if each time let say a variable called
$mp_url will change. I hope you know what I meant. The MP3 link will not be
constant, but the image file link could be constant.
I already linked the MP3 link with its own name (Text ) and its working but
now I want to replace the MP3 name (Text) with an image because the song
name will be the heading of the page so no need to echo out twice right.
Best,
Guru.
--- End Message ---
--- Begin Message ---
So basically you want to be able to associate an image with an Mp3, and the
path to the mp3 is stored in the DB, right ?
If above is the case, why dont you upload the image to an image folder, and
save the path to the image in the DB too along with mp3 path details, I
think this should work !
Thanks,
Vinay
On Sun, Jul 4, 2010 at 10:50 PM, nagendra prasad
<nagendra802...@gmail.com>wrote:
> Thanks Jason, However will this work if each time let say a variable called
> $mp_url will change. I hope you know what I meant. The MP3 link will not be
> constant, but the image file link could be constant.
>
> I already linked the MP3 link with its own name (Text ) and its working but
> now I want to replace the MP3 name (Text) with an image because the song
> name will be the heading of the page so no need to echo out twice right.
>
> Best,
> Guru.
>
--- End Message ---
--- Begin Message ---
+1
This is the way to do it IMO. Has worked for me.
Karl
On Jul 4, 2010, at 1:26 PM, Vinay Kannan wrote:
So basically you want to be able to associate an image with an Mp3,
and the
path to the mp3 is stored in the DB, right ?
If above is the case, why dont you upload the image to an image
folder, and
save the path to the image in the DB too along with mp3 path
details, I
think this should work !
Thanks,
Vinay
On Sun, Jul 4, 2010 at 10:50 PM, nagendra prasad
<nagendra802...@gmail.com>wrote:
Thanks Jason, However will this work if each time let say a
variable called
$mp_url will change. I hope you know what I meant. The MP3 link
will not be
constant, but the image file link could be constant.
I already linked the MP3 link with its own name (Text ) and its
working but
now I want to replace the MP3 name (Text) with an image because
the song
name will be the heading of the page so no need to echo out twice
right.
Best,
Guru.
Karl DeSaulniers
Design Drumm
http://designdrumm.com
--- End Message ---