|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Programming/Scripting Questions about programming, bash scripts, perl, php, cron jobs, ruby, python, etc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Try:
Quote:
__________________
Happily using Linux since 1998 Share & Enjoy |
|
||||
|
Left it too long to edit
![]() This is neater (using a function): Quote:
__________________
Happily using Linux since 1998 Share & Enjoy |
|
||||
|
Thank you so very much.....I'm not at my machine now, but will try tonight and post results. Same for second solution, which is more elegant IMHO.
Thanks again, Gertjan
__________________
- AMD Athlon X2 6.0 GHz, 8 GB DDR2-800, 30 GB SSD, 1.5 TB, EVGA 9800GT, openSUSE 11.2 KDE4 4.3.3 - ASUS K70IO laptop, GT120M-1GB, 4 GB, 64 GB SSD, opensuse Factory, KDE4 4.3.3 R.E.S.T.E.C.P. |
|
||||
|
The first one:
Code:
<select class="inputbox" id="product_id" name="product_id" onchange="window.location='<?php echo $_SERVER['PHP_SELF'] ?>?option=XXXXXXX&page=XXXXXXX&order_id=<?php echo $order_id; ?>&user_id=<?php echo $user_id; ?>&product_id='+document.getElementById('product_i d').options[selectedIndex].value; ">
Thanks anyway
__________________
- AMD Athlon X2 6.0 GHz, 8 GB DDR2-800, 30 GB SSD, 1.5 TB, EVGA 9800GT, openSUSE 11.2 KDE4 4.3.3 - ASUS K70IO laptop, GT120M-1GB, 4 GB, 64 GB SSD, opensuse Factory, KDE4 4.3.3 R.E.S.T.E.C.P. |
|
||||
|
Cheers again !!! Got it solved. Both didn't work, there's definitely something wrong in the single or double quotes. This does the job:
Code:
<?php
$url = $_SERVER['PHP_SELF']."?option=XXXXXXX&page=XXXXXXX&order_id=". $order_id . "&user_id=" . $user_id ;
?>
<select class="inputbox" id="product_id" name="product_id" onchange="window.location='<?php echo $url ?>&product_id='+document.getElementById('product_id').options[selectedIndex].value; ">
__________________
- AMD Athlon X2 6.0 GHz, 8 GB DDR2-800, 30 GB SSD, 1.5 TB, EVGA 9800GT, openSUSE 11.2 KDE4 4.3.3 - ASUS K70IO laptop, GT120M-1GB, 4 GB, 64 GB SSD, opensuse Factory, KDE4 4.3.3 R.E.S.T.E.C.P. |
|
||||
|
Glad you got it fixed
![]() I think the quotes problem might be because I didn't check actually echo'ing out the values - missed a trick there... I like the web developer toolbar for firefox. It's got a nice javascript debugger in it which helps with things like that. Worth getting that & firebug if you're doing much web work.
__________________
Happily using Linux since 1998 Share & Enjoy |
|
||||
|
Thanks. I'll have a look at those. And
Quote:
This one counts the lines for all modules on my project: find /srv/www/htdocs -iname '*.*_*.*' | xargs -n 1 wc -l | cut -d' ' -f1 | (SUM=0; while read NUM; do SUM=$(($SUM+$NUM)); done; echo $SUM) It outputs: 843658 Considering the trouble the post was about: I forgot a very important guideline some php programmer gave me before I started the project: "In case of confusion caused by mixture of php-, html- and javascript statements and their use of quotes, pack them all into to single php-statements and glue those together". In the end, that's what I did.
__________________
- AMD Athlon X2 6.0 GHz, 8 GB DDR2-800, 30 GB SSD, 1.5 TB, EVGA 9800GT, openSUSE 11.2 KDE4 4.3.3 - ASUS K70IO laptop, GT120M-1GB, 4 GB, 64 GB SSD, opensuse Factory, KDE4 4.3.3 R.E.S.T.E.C.P. |
|
||||
|
Man alive.
That's a lot of code I do smallish websites for fun and occasionally profit.I will bow down to your greater linecount though
__________________
Happily using Linux since 1998 Share & Enjoy |
|
|||
|
Hi Knurpht,
I liked your counting command and I wanted to improve it a bit as I didn't like the loop and there is one less filtering now. I think it will be a bit faster(only you can verify that) find /srv/www/htdocs -iname '*.*_*.*' | xargs -n 1 wc -l | awk '{SUM=SUM+$1} END {print SUM}' |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|