Jump to content

Php $page problem


jason360

Recommended Posts

Hey guys,

 

This is probably simple but I can't figure out what I am doing wrong. I am trying to get this $page to redirect to a dynamic page using the id.  This code I am using for $page ='../shop/product.php?pid='.$id.''; is coming up blank for the id.

 

Any help is appreciated.  Thanks

 

JK

 


define('INCLUDE_CHECK',true);

require('../config.inc.php');
require('../functions.php');



// initialization

$result_array = array();

$counter = 0;

$pid = ($_GET['pid']);

// Full Size View of Photo

if( $pid )

{

	$result = mysql_query( "SELECT * FROM products WHERE id='".addslashes($pid)."'" );

	list($id, $name, $description, $snippet, $link, $price, $shipping, $quantity, $anchor) = mysql_fetch_array( $result );

	$nr = mysql_num_rows( $result );

	mysql_free_result( $result );	

}

// cart php
$page ='../shop/product.php?pid='.$id.'';

require('../shop/cart.php');

Link to comment
Share on other sites

A couple of immediate things i would do is echo your $pid variable to ensure you're even getting the id (variable) you seeking from $_GET.

Then I would echo the SQL statement and $results to ensure it's valid structure - no syntax issue.

 

Lastly, double check your path - I see you have '../' so that's taking out one step back from current file location.

Could be any one of those issues preventing the correct page from displaying - but this is a high level answer as well without seeing the actual scripts together.

 

Hope this helps! :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.