pixeltrace Posted August 18, 2006 Share Posted August 18, 2006 guys, i need help on this.please check my products pagehttp://www.sinagtala.net/try clicking the product button or services button on the right panelnotice that it will redirect you to the default page of my iframe which is prodall.phptry clicking the product button and on the select category (all products, paintings, cds, books)notice that it will also redirect you to the default page of my iframethis was working before before my webhosting migrate my site to another server.no changes in the php version and sql.hope you guys can help me on this.thanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/ Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 products pagehttp://www.sinagtala.net/products.php+++++how can i attached my products page?its giving me a page error"page cannot be displayed"whenever i am attaching my scripts here.+++++ Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76788 Share on other sites More sharing options...
HeyRay2 Posted August 18, 2006 Share Posted August 18, 2006 Perhaps posting the code from your [b]products.php[/b] will get us on the right track to helping you figure out your issue... ;) Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76790 Share on other sites More sharing options...
foreverhex Posted August 18, 2006 Share Posted August 18, 2006 So I think its something wrong with your SQL query. If this is in fact how you do your page. Also I noticed your Order now links are bad. They say something like (porder.php?$product_name=Pasig, River of Life) and that all seems wierd to me, you need to get rid of the $ in your product_name. Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76793 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 sorry for the hassle.my products page can be downloaded herehttp://www.sinagtala.net/eric/hope you guys can help me with thisi just need to fix it asapthanks in advance! Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76795 Share on other sites More sharing options...
HeyRay2 Posted August 18, 2006 Share Posted August 18, 2006 [url=http://www.sinagtala.net/eric/]http://www.sinagtala.net/eric/[/url] gives out a pre-parsed copy of [b]products.php[/b].Make a copy of your [b]products.php[/b] in the same folder mentioned above, but with a [b].phps[/b] extension, or just paste the code from your [b]products.php[/b] file here and we'll take a look at it. Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76797 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 i've made a copy of my products.php inhttp://www.sinagtala.net/eric/please checkthanks! Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76799 Share on other sites More sharing options...
onlyican Posted August 18, 2006 Share Posted August 18, 2006 We need to see some codeuse http://pastebin.com/ and tell use the link Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76803 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 here is my products.php scriptshttp://www.sinagtala.net/eric/products.phps Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76808 Share on other sites More sharing options...
HeyRay2 Posted August 18, 2006 Share Posted August 18, 2006 Allright, I'm seeing the use of variables that are only assigned if RegisterGlobals is turned on in your php.ini file. Your new web host may not have this option enabled by default.Create and run the following script:[b]info.php[/b][code]<?php// Show all PHP informationphpinfo();?>[/code]Look for entries regarding Register Globals, if they are set to "1", your problem lies elsewhere. If they are set to "0", then you need to make some changes to your variables.Let us know what you find out... ;) Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76812 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 hi,http://www.sinagtala.net/info.phpfrom here its telling me that the register global is "off"what will i do with this? Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76825 Share on other sites More sharing options...
Cell0518 Posted August 18, 2006 Share Posted August 18, 2006 Register Globals is off.1. you need to place $varname = $_GET["varname"] for php to look for the variable passed in the url. *( place the code before the variable is used )*Example: $product = $_GET["product"];echo $product;2. Check this line -> [code]<td width="520" rowspan="3" bgcolor="#E7E7DD" valign="top"><iframe id="productmain" src="<?=$url;?>".....[/code]replace <?=$url;?> with either <? echo $url; ?> or <? print $url; ?> Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76829 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 hey,the echo or print workedbut for the $_GET, i dont have an idea how to use it.could you give me an example on my page?thanks! Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76871 Share on other sites More sharing options...
HeyRay2 Posted August 18, 2006 Share Posted August 18, 2006 Any variables that you pass through the URL (example: http://www.yoursite.com/yourpage.php?var1=foo&var2=bar), you will access from the $_GET array:[code]<?php$var1 = $_GET['var1']; // $var1 equals "foo"$var2 = $_GET['var2']; // $var2 equals "bar"?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76892 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 hey,it worked for my right panelbut for my iframe its still not workinghere is the php script from my first line-----------<? if (!isset($url)) { $url='news/upcoming.php';} ?>-----------the script of my iframe----------- <iframe id="newsmain" name="newsmain" src="<?=$url;?>" width=499 height=425 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=yes></iframe> </td>-----------the script of my $_GET----------- <? $id = $_GET['id']; { $side = 'news/upcomingside.php'; if ($id == '1') {$side = 'news/upcomingside.php';} if ($id == '1') {$url = 'news/upcoming.php';} if ($id == '2') {$side = 'news/eventside.php';} if ($id == '2') {$url = 'news/events.php';} if ($id == '3') {$side = 'news/recommendside.php';} if ($id == '3') {$url = 'news/recommends.php';} if ($id == '4') {$side = 'news/upcomingside.php';} if ($id == '4') {$url = 'news/hot.php';} if ($id == '5') {$side = 'news/eventside.php';} if ($id == '5') {$url = 'news/pastevents.php';} if ($id == '6') {$side = 'news/eventside.php';} if ($id == '6') {$url = 'news/privateevents.php';} if ($id == '7') {$side = 'news/eventside.php';} if ($id == '7') {$url = 'news/tourevents.php';} if ($id == '8') {$side = 'news/eventside.php';} if ($id == '8') {$url = 'news/sponsoredevents.php';} if ($id == '9') {$side = 'news/eventside.php';} if ($id == '9') {$url = 'news/corporateevents.php';} if ($id == '10') {$url = 'news/newsinq.php';} } ?> <? include ($side); ?>-----------whats wrong with my script? Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76916 Share on other sites More sharing options...
ToonMariner Posted August 18, 2006 Share Posted August 18, 2006 its a mess ;)use switch....also use <?php echo $url; ?> instead just incase....is that script from what should be in the iframe? Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76931 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 by the way, that script is for my news pagehttp://www.sinagtala.net/news.phpfor products pageeverything is working fine.except for the select category section.if you click any of the catergories (all products, painting, cds, books)it will just point you to the allproducst page which is prodall.php--------also, here is the script of my select category section--------<form method="POST" style="margin:0" name="form" action="products/prodall.php"><table width="135" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="2" align="left"><img src="images/productcategory.gif" width="206" height="24"></td> </tr> <tr> <td width="30" rowspan="3" align="left"><img src="images/productbar3.gif" width="30" height="75"></td> <td width="176" valign="top"><img src="images/spacer.gif" width="10" height="10"/></td> </tr> <tr> <td align="right" valign="top"> <span class="bodytext1">select category</span> <select class="sorteventlist" name="list" onFocus="selectedIndex = 0" onChange="if( options[selectedIndex].value != '') document.location = 'products.php?url='+form.list.value"> <option value="javascript:;">------------</option> <option value="products/prodall.php">ALL PRODUCTS</option> <option value="products/cd.php">AUDIO CDS</option> <option value="products/painting.php">PAINTINGS</option> <option value="products/book.php">BOOKS</option> </select></td> </tr> <tr> <td> </td> </tr> </table></form>-------- Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76933 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 sorry about the mess,im just really not good at this yet.this is the script by the way of my news page--------http://www.sinagtala.net/eric/news.phps Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76940 Share on other sites More sharing options...
HeyRay2 Posted August 18, 2006 Share Posted August 18, 2006 [code]<? if (!isset($url)) { $url='products/prodall.php';} ?>[/code]Again, with Register Globals off, you [b]must[/b] pull all of your variables from the URL by way of the $_GET array. Change the above line to read:[code]<?php if (!isset($_GET['url'])){ $url='products/prodall.php'; } else { $url = $_GET['url']; }?>[/code]... or to save space ...[code]<?php$url = (!isset($_GET['url'])) ? $_GET['url'] : "products/prodall.php";?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-76950 Share on other sites More sharing options...
pixeltrace Posted August 18, 2006 Author Share Posted August 18, 2006 thank bro!it worked! Quote Link to comment https://forums.phpfreaks.com/topic/17953-need-help-on-my-php-scripts/#findComment-77048 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.