php-windows Digest 30 Jul 2004 21:46:26 -0000 Issue 2339

Topics (messages 24286 through 24298):

Re: Compiling php 5.0.0 Errors
        24286 by: Mikey

Splitting results
        24287 by: Schalk Neethling
        24290 by: Mikey
        24296 by: Mikey

Strange Timeout
        24288 by: Odd Egil H. Selnes
        24289 by: Mikey

Unable to unsubscrive // Please help
        24291 by: Shahed, Raja

Re: form to php
        24292 by: Al Jones

Image display problem
        24293 by: Schalk Neethling

Run system command from PHP
        24294 by: Gerardo Rojas
        24295 by: Mikey

Re: Posting Again
        24297 by: Schalk Neethling

Confused
        24298 by: Schalk Neethling

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
"Anthony Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am trying to compile a custom/streamline php dist using Visual Studio's
> nmake.  I downloaded the stable source and have built all my dependent
libs
> (hopefully).  But I keep getting an error looking for a "winres.h" file
for
> template.rc.  The exact error is as follows...
>
>         rc /fo Release_TS\php5ts.dll.res /d FILE_DESCRIPTION="\"PHP Script
> Interpreter\""  /d FILE_NAME="\"php5ts.dll\"" /d PRODUCT_NAME="\"PHP
Script
> Interpreter\""  win32\build\template.rc
> win32\build\template.rc(8) : fatal error RC1015: cannot open include file
> 'winres.h'.
> NMAKE : fatal error U1077: 'rc' : return code '0x1'
> Stop.
>
> I can't find that file anywhere in the php sources.  Does anyone have any
> ideas because I'm all out?

winres.h is a Windows library header and should be in your standard include
path unless you have a non-standard installation.

I tried a google before replying to your mail, it would have been nice if
you had tried to do the same:

http://www.realityfactory.ca/docs/g3d/programmersreference/Winres_8h-source.html

Mikey

--- End Message ---
--- Begin Message --- I am trying to split the results from a database query into specific number of columns per row. I know how to create a repeat region but the problem is this either creates a bunch of columns next to each other or a bunch of rows below each other. What I want to be able to do for example is have the results displayed in a format of three columns per row.

Any ideas?

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.co.za

This message contains information that is considered to be sensitive or confidential and may not be forwarded or disclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you.
--- End Message ---
--- Begin Message ---
> I am trying to split the results from a database query into specific
> number of columns per row. I know how to create a repeat region but the
> problem is this either creates a bunch of columns next to each other or
> a bunch of rows below each other. What I want to be able to do for
> example is have the results displayed in a format of three columns per
row.
>
> Any ideas?

Try writing some code is this short answer.

Seriously, it can't take much thinking to work out that you need some kind
of nested loop to write your columns, taking care to close each open <td> &
<tr> as you go.

e.g.

for ($i = 0; $i < count ($rows); $i++)
{
    echo "<tr>";
    for ($j = 0; $j < 3; $j++)    // Three columns
    {
        echo "<td>";
        echo (isset ($rows[$i + $j])) ? $rows[$i+$j] : "&nbsp;";
        echo "</td>";
    }
    echo "</tr>";
}

But surely you could have worked this out for yourself?  This is a list for
people with problems coding in PHP *other than* not being bothered to write
code for themselves.

Mikey

--- End Message ---
--- Begin Message ---
----- Original Message ----- 
From: "Schalk Neethling" <[EMAIL PROTECTED]>
To: "Mikey" <[EMAIL PROTECTED]>
Sent: Friday, July 30, 2004 3:21 PM
Subject: Re: [PHP-WIN] Re: Splitting results


> So this list is also not for people new to PHP right?

First of all, reply to the list and not to my work email.  This is the first
rule of mailing lists.  Luckily I am at my work machine, otherwise your mail
would have ended up straight in my killfile.  I include a link to a
mailing-list netiquette FAQ as you are obviously new to these as well
(http://linux.sgms-centre.com/misc/netiquette.php).

Secondly, whether you are new to PHP or not, this list is for general PHP
related queries ("Are there any workarounds for this bug?", "Why doesn't the
code I have written work?"), not for questions like "I need code that does
this, any ideas?".  If you have written some code and it doesn't work, post
that to the group and I am sure someone will tell you where you are going
wrong or if you should be doing it differently - including myself.

And finally, I did offer you a solution to your problem - did it help you at
all?

Mikey

--- End Message ---
--- Begin Message ---
Hi!
I usually work with Apache webserver
but now Im working with a php project that uses ms sql server 2000
This webserver is running IIS6 and I get som strange errors.
As i said earlier i get a strange CGI error when I use the header("Location:
".$_SERVER["PHP_SELF"]."?page=something");
I just upgraded to php 4.3.8 and that problem seems to have been solved. But
now I have encountered another strange one.
On some of my pages i insert alot of data into the sql server, and if that
is successful I send the user to another page.
But this times out...
all the data goes into the database without any problems, but as soon as the
script reaches the header(); it dies...
and after a while i get a execution timeout error. I know that its not the
sql queries who kills the server, becouse if i Replace the header with i.e
print("IT ALL WENT WELL! "); it prints and all data gets stored.

Have anyone else encountered this problem? or do anyone have a clue about
what to do ?

.odde



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.732 / Virus Database: 486 - Release Date: 29.07.2004

--- End Message ---
--- Begin Message ---
> On some of my pages i insert alot of data into the sql server, and if that
> is successful I send the user to another page.
> But this times out...
> all the data goes into the database without any problems, but as soon as
the
> script reaches the header(); it dies...
> and after a while i get a execution timeout error. I know that its not the
> sql queries who kills the server, becouse if i Replace the header with i.e
> print("IT ALL WENT WELL! "); it prints and all data gets stored.
>
> Have anyone else encountered this problem? or do anyone have a clue about
> what to do ?
>
> .odde

I seem to remember that if you are sending a Location: header then you need
to put "\n\n" at the end of the header - I could be wrong, I could be
right...

Mikey

--- End Message ---
--- Begin Message ---
Please help

>-----Urspr�ngliche Nachricht-----
>Von: Odd Egil H. Selnes [mailto:[EMAIL PROTECTED] 
>Gesendet: Freitag, 30. Juli 2004 15:01
>An: 
>Betreff: [PHP-WIN] Strange Timeout
>
>
>Hi!
>I usually work with Apache webserver
>but now Im working with a php project that uses ms sql server 2000
>This webserver is running IIS6 and I get som strange errors.
>As i said earlier i get a strange CGI error when I use the 
>header("Location:
>".$_SERVER["PHP_SELF"]."?page=something");
>I just upgraded to php 4.3.8 and that problem seems to have 
>been solved. But
>now I have encountered another strange one.
>On some of my pages i insert alot of data into the sql server, 
>and if that
>is successful I send the user to another page.
>But this times out...
>all the data goes into the database without any problems, but 
>as soon as the
>script reaches the header(); it dies...
>and after a while i get a execution timeout error. I know that 
>its not the
>sql queries who kills the server, becouse if i Replace the 
>header with i.e
>print("IT ALL WENT WELL! "); it prints and all data gets stored.
>
>Have anyone else encountered this problem? or do anyone have a 
>clue about
>what to do ?
>
>.odde
>
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.732 / Virus Database: 486 - Release Date: 29.07.2004
>
>-- 
>PHP Windows Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
Very nice answer Mark,  some of us newbies get lost in the fray here so *I*
really appreciate when someone takes the time to show how and explain the
workings.  I'm tackling a form and database, and as a new php person it's a
bit intimidating!

"Mark Collin" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> You haven't closed your form tag which is causing it to all go wrong.
>
> Here is some working code for you:
>
> <form action="action.php" method="post">
> <p>Your name: <input type="text" name="name"></p>
> <p>Your age: <input type="text" name="age"></p>
> <p><input type="submit" /></p>
> </form>
> action.php:
> <?php
> //Check to see if user has clicked submit
> if (isset($_POST['name']) && isset($_POST['age']))
> {
> //Check to see if user has entered data in both fields
> if (!empty($_POST['name']) && !empty($_POST['age']))
> {
> //User has entered data in both fields so display result
> ?>
> Hi <?php echo $_POST['name']; ?> .You are <?php echo $_POST['age'];
> }
> else
> {
> //User has not populated both fields so send a warning to user telling
> them what to do
> ?>
> <script language="javascript" type="text/javascript">
> window.alert('You must complete both fields');
> </script>
> <?php
> }
> }
> ?>
>
> You would probably find it easier to read if you format your HTML a
> little, a little formatting goes a long way when it comes to debugging
> HTML, especially if your using the devils own tables :P
>
> "Php mysql" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]:
> > hi list,
> >
> >   i have managed to successfully install php and i am now going through
> >   the manual and trying a few of the examples given there. The examples
i have
> >   tried till now are all working except for one. The example about
inputting
> >   in the form and then displaying it through php is not working for me.
But
> >   when i run it i get the entire code in action.php instead.
> > The example i am referring to is:
> >
> > form action="action.php" method="post"> <p>Your name: <input type="text"
> > name="name" /></p> <p>Your age: <input type="text" name="age" /></p>
> > <p><input type="submit" /></p></form
> >
> > action.php:
> >
> > Hi <?php echo $_POST['name']; ?>.You are <?php echo $_POST['age']; ?>
> >
> >
> >
> > Please tell me whts wrong....
> >
> > thanks in advance
> >
> > penjo
> >
> > Yahoo! India Matrimony: Find your life partneronline.

--- End Message ---
--- Begin Message --- Can someone see why the following is happening? I have the following code in my PHP page:

<?php do { ?>
<td> <a href="view_ad.php?id=<?php echo $row_ads['id']; ?>"><img src="<?php echo $row_ads['full_img']; ?>" width="87" height="120" hspace="5" vspace="5" border="1" /></a>
<?php echo $row_ads['full_img']; ?><br /><?php echo $row_ads['campaign']; ?>
</td>
<?php } while (($row_ads = mysql_fetch_assoc($ads)) && ($row_ads['id'] <= 3)); ?>


After rendering the page in a browser the code produced by this block is as follows:

<td> ../media/ads/001.jpg<br />Spring 2004 </td> <td> ../media/ads/002.jpg<br />Spring 2004 </td> <td> ../media/ads/003.jpg<br />Spring 2004 </td>

From this it looks like it is completely ignoring this line:
<a href="view_ad.php?id=<?php echo $row_ads['id']; ?>"><img src="<?php echo 
$row_ads['full_img']; ?>"
width="87" height="120" hspace="5" vspace="5" border="1" /></a>

Any ideas why this is happening? Thanks!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.co.za

This message contains information that is considered to be sensitive or confidential and may not be forwarded or disclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you.
--- End Message ---
--- Begin Message ---
I am trying to modify the registry by running a *.reg dynamically created by PHP.  I 
am having trouble gettting the file to execute from within PHP.  I actually create a 
*.reg file and save it.  I then try to run it from PHP.  I've tried using exec, 
system, shell_exec() and none seem to actually work.  I don't get an error message 
either.

When I run the *.reg file from a cmd window, it works fine.  I also noticed that it 
prompts the user once and then confirms the change using some alert box mechanism 
(windows builtin).

Is there anyway to do this?

--
Gerardo S. Rojas
mailto: [EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
>I am trying to modify the registry by running a *.reg dynamically created
by PHP.  I am having trouble gettting the file to
>execute from within PHP.  I actually create a *.reg file and save it.  I
then try to run it from PHP.  I've tried using exec,
>system, shell_exec() and none seem to actually work.  I don't get an error
message either.

This is correct, as the web-server does not have a valid hWnd to send any
error prompts to.

>When I run the *.reg file from a cmd window, it works fine.  I also noticed
that it prompts the user once and then
>confirms the change using some alert box mechanism (windows builtin).

>Is there anyway to do this?

Depends on how much programming you know... you would either use the
Win32API extension and link directly into the system calls for creating
regsitry keys (prolly difficult), or you could make/buy/find for free a COM
object that simplifies this process (a lot simpler).

Mikey

--- End Message ---
--- Begin Message ---
This did not seem to make the list the first time.

Can someone see why the following is happening? I have the following code in my PHP page:

<?php do { ?>
<td> <a href="view_ad.php?id=<?php echo $row_ads['id']; ?>"><img src="<?php echo $row_ads['full_img']; ?>" width="87" height="120" hspace="5" vspace="5" border="1" /></a>
<?php echo $row_ads['full_img']; ?><br /><?php echo $row_ads['campaign']; ?>
</td>
<?php } while (($row_ads = mysql_fetch_assoc($ads)) && ($row_ads['id'] <= 3)); ?>


After rendering the page in a browser the code produced by this block is as follows:

<td> ../media/ads/001.jpg<br />Spring 2004 </td> <td> ../media/ads/002.jpg<br />Spring 2004 </td> <td> ../media/ads/003.jpg<br />Spring 2004 </td>

From this it looks like it is completely ignoring this line:

<a href="view_ad.php?id=<?php echo $row_ads['id']; ?>"><img src="<?php echo $row_ads['full_img']; ?>"
width="87" height="120" hspace="5" vspace="5" border="1" /></a>


Any ideas why this is happening? Thanks!

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.co.za

This message contains information that is considered to be sensitive or confidential and may not be forwarded or disclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you.
--- End Message ---
--- Begin Message ---
Why would the following line not be parsed in a PHP page?

<img src="<?php echo $row_ads['full_img']; ?>" width="87" height="120" />

--
Kind Regards
Schalk Neethling
Web Developer.Designer.Programmer.President
Volume4.Development.Multimedia.Branding
emotionalize.conceptualize.visualize.realize
Tel: +27125468436
Fax: +27125468436
email:[EMAIL PROTECTED]
web: www.volume4.co.za

This message contains information that is considered to be sensitive or confidential and may not be forwarded or disclosed to any other party without the permission of the sender. If you received this message in error, please notify me immediately so that I can correct and delete the original email. Thank you.
--- End Message ---

Reply via email to