Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Calling For Data To Be Displayed Using The URL


I'm having a problem getting my code to pull the appropriate information when I call for it via URL. (example: http://..../.php?id=2). For some reason I can't get it to pull the information for ID #2 (or any ID over 1) and input that information into my dynamic page. No matter what ID i type, or even if I neglect to type in an ID to begin with, it displays the same information.

What am I doing wrong? The entire code for my page is pasted below. If anyone could help I would be grateful. I know there's something simple i'm over looking, but I can't figure out what. 

It connects and downloads the information for ID #1 if I remove $_GET and replace it w/ $row_StaffDirectory, but this is where it only pulls information for ID #1 and no other, no matter which ID I call it from in the URL. Any ideas? Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Calling Dropdown Data From Db
I want to call data from the db and display it in a dropdown and make the selected option match the value of the record called. It thats clear? Code:

Calling Data From 2 Tables
how would i go about calling the data from 2 different tables within a database to display on one form?

Calling Data From MySQL To Echo Images
I've been trying to use data from a database to echo images. I thought that if I used the PHP page to connect to the database I could then do something like the below

if ($user == "user") {echo "<img src="http://www.whatever/images/whatever.gif">"; }

Want Only 100 Words Displayed
I want to display data collected from mysql in a table-cell but I want no more than 100 words to be displayed, there will be a link to the full story in the cell.

Incorrect Id Value Being Displayed
Can anyone tell me why the $list_id variable is passing the last value in the DB and not the list_id associated with that row?

When $featured == 'true' the list_id displays correctly but when i try to submit it it displays the last $last_id in the DB. PHP Code:

Page Cannot Be Displayed
Im using php.exe on win2k. When I visit a php page i get page cannot be
displayed. Other pages work fine. Any ideas? the php dll wont work at all,
it refuses to read the ini file at all.

Really anonying, cant figure this out.

Everything After ' Character Is Not Displayed
I have been getting strange behaviour when using ' in by textboxes.

eg inputting the following
this is some test text ' and so is this

is saved to the mysql database ok as

this is some test text /' and so is this (with add slashes)
or
this is some test text ' and so is this (without add slashes)

mysql field is VARCHAR(255)

but when I retreive the data and display in textboxes on my web page, text
area type (below) is ok
<textarea class='BodyText' style='WIDTH: 85%' name="textarea"><?php echo
$opta; ?></textarea>

but input type (below) cuts everything off after the ' character. However
this does not happen with other characters such as " or /
<input type='text' class='BodyText' style='WIDTH: 85%' name='test'
value='<?php echo $opta; ?>'>

can anyone explain this behaviour and have a solution so that text with any
' characters in it is fully displayed?

No PHP Displayed In Browser?
I am new to setting up servers and am tring to set up a server to test my websites so I do not have to rent web space anymore.

I have Apache 2.0.55 running on my machine now. I used the windows install version because I do not know how to build it from the source. I have configured PHP 5.1.1 like the install files explained. the service starts without any errors that I can see.

My problem is when I try to test a simple PHP script I get nothing in my browser. The browser will display regular html though. If from a command prompt window I type php -i I get the list of settings I am suppost to see in my php script with phpinfo(); .

Can anyone tell me what I missed or something to try and help?

PhpMyAdmin - Page Cannot Be Displayed
I programmed my config.inc.php file with the codes below. But i cant go to the website.. It shows an error msg, "page cannot be displayed"

What haf i done wrong.. N i m actually not sure about my local host.. Cos i m using my school wireless network..

$cfg['PmaAbsoluteUri'] = 'http://www.example.com/phpMyAdmin-2.5.7-pl1/'

$i = 0;

$cfg['Servers'][$i]['host'] = 'example.com' // MySQL hostname

$cfg['Servers'][$i]['port'] = ''

$cfg['Servers'][$i]['socket'] = ''

$cfg['Servers'][$i]['connect_type'] = 'tcp'

$cfg['Servers'][$i]['controluser'] = ''

$cfg['Servers'][$i]['controlpass'] = ''

$cfg['Servers'][$i]['auth_type'] = 'config' // Authentication method (config, http or cookie based)?
$cfg['Servers'][$i]['user'] = 'username' // MySQL user
$cfg['Servers'][$i]['password'] = 'my_pass' // MySQL password (only needed
// with 'config' auth_type)

Decimal Spaces Displayed...
Could someone please tell me how you can limit the number of decimal spaces shown when displaying a variable... i.e.

<?php

$Pie = 22 / 7;
echo("<p> $Pie </p>");
?>

I want to be able to print 3.14, not 3.14154534576.

Linebreaks In My Mail Not Displayed
Linebreaks in my mail message won't be displayed. They are there when I view the source in Thunderbird but not Thunderbird nor Gmail displays them. What could cause it?

The Image Cannot Be Displayed, Because It Contains Errors
On running the following code :

<?
/* initialize a session. */
session_start();
/*header*/
Header("Content-Type: image/png");

/*We'll set this variable later.*/
$new_string;

/*register the session variable. */
session_register('new_string');
include ('mysql.php');
echo "<html>
<head>
<title> Forgot Username </title>
<link type="text/css" rel="stylesheet" href="css.css">
</head>
<body>
<form name="form1" action="" method="POST">
<fieldset>
<legend>Information</legend>
<label class="left">E-mail Address :<br>
<font size="-2"> This is the address you provided during registration </font></label>
<label class="right">
<input type="text" name="email">
</label>
<label class="left">Enter the code as you see in the box :<br>
<font size="-2"> Case Sensitive </font></label>
<label class="right">
<input type="text" name="image"> <img src="verify.png">
</label>
";
/* set up image, the first number is the width and the second is the height*/
$im = ImageCreate(200, 40);

/*creates two variables to store color*/
$white = ImageColorAllocate($im, 255, 255, 255);
$black = ImageColorAllocate($im, 0, 0, 0);

/*random string generator.*/
/*The seed for the random number*/
srand((double)microtime()*1000000);

/*Runs the string through the md5 function*/
$string = md5(rand(0,9999));

/*creates the new string. */
$new_string = substr($string, 17, 5);

/*fill image with black*/
ImageFill($im, 0, 0, $black);

/*writes string */
ImageString($im, 4, 96, 19, $new_string, $white);

/* output to browser*/
ImagePNG($im, "verify.png");
ImageDestroy($im);
?>

It outputs :

The image “http://vsenepal/account_settings.php” cannot be displayed, because it contains errors.

Number Of Rows--displayed
Is there a way to call a function that would display the number of rows in a table?
I'd like to have a count on the page that allows people to query the database to demonstrate that the database is growing and constantly changing.

Checkboxes Displayed In Table
I have a query with 40ish results I want to display in a 5 row table with checkboxes but am stumped as to how. PHP Code:

Limit Results Displayed
I have tried a few different tutorials etc on this but I cant get it to work properly with my code. What i need is the page to display 10 results per page and to automatically create a "Prev | 1 | 2 | 3 ..etc | Next" navigation that runs the results of the query.
PHP Code:

Formatting Displayed Txt CSS And Wordwrap
I am using the follwing to display the contents of try.txt. It displays fine but I cannot alter the font via CSS, any ideas? Also I need the displayed txt to wordwrap within its DIV but i cannot figure it out!

<?php  $lines = file("try.txt");

 echo '';

 foreach($lines as $line)
  echo str_replace("<", "&lt;", $line)."";

 echo ''; ?>

Image Cannot Be Displayed, Because It Contains Error ...
the script that show image is:

<?php
include('dbinfo.inc.php');

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT file,filesize,filetype FROM user WHERE id=1;";
$result=mysql_query($query);
mysql_close();

$file=mysql_result($result,0,"file");
$filesize=mysql_result($result,0,"filesize");
$filetype=mysql_result($result,0,"filetype");

header('Content-Type: '.$filetype);
header("Content-Disposition: attachement
");
print $file;
?>

it's work fine execpt it show the image as a attachement (Save as... window), so Apache, mysql, php seem to work fine. the problem is only on http header of image i think.
i want the image directly so, i use this:

<?php
include('dbinfo.inc.php');

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT file,filesize,filetype FROM user WHERE id=1;";
$result=mysql_query($query);
mysql_close();

$file=mysql_result($result,0,"file");
$filesize=mysql_result($result,0,"filesize");
$filetype=mysql_result($result,0,"filetype");

header('Content-Type: '.$filetype);
print $file;
?>

it's don't work, firefox gave me "The image http://ip:8080/viewimage.php cannot be displayed, because it contains error." IE show me nothing at all.

any one have a idea ?

----------------------------------------------------
Windows NT 5.1 build 2600 (XP Professional English)
Apache 2.0.54, running as a server
PHP Version 5.0.4 running as module
MySQL 4.1.7 (a dll from php)
Firefox english 1.0.4
Internet Explorer 6

Image Created With Gd Are Downloaded Non Displayed!!!
I use a gd function for create png image for show graphs, but some user told that is unable to see the graph but the PC ask for download the image.

Limit Amount Displayed In Array
I need to limit the amount displayed in an array. if the array is 100 I need to limit it to the first ten. I tried to do range but I can't seem to get it to work. here is how I am showing the array.

<?
$results = array_unique($results);
foreach($results as $resultsindex =>$goto)
{
?>
<a href="index.php?mode=2&url=<? echo $url.$goto;?>"><? echo $goto;?></a><br>
<?
}

Limit # Chars Displayed On Echo?
I have a database w/ several text fields. I want to be able to echo only the first, say, 100 characters of the field only, instead of the whole thing. Is this possible?

Load Time Displayed Question
I was looking at a couple of pages yesterday that were coded in PHP, and at the bottom was a "Page loaded in ______" blurb at the bottom. Good example is at www.digitaljedi.com. How could I go about creating a script that would initialize that function. Could it be as simple as doing something like this PHP Code:

Different Graphic Displayed Depending On Host
I know that you can display the host name in PHP using <? echo $HTTP_HOST; ?>, but how can you display a different text and a different image depending on the host the page is called from?

PHP Nuke 8: Security Code Not Being Displayed
I've got PHP Nuke 8 installed and running but I've run into one problem. First of all, everything installed fine without any errors. After Nuke was installed I added the following modules: Shout Box, Leaderboards, Gallery, and Sentinel. Prior to installing ANY modules with just PHP Nuke installed the Security Code was readily viewable on the login page (both for users login and admin login pages). Without remembering exactly when the security code image disappeared, all I can say is it's not viewable now.

Hiding Hyperlinks For Page Displayed
Can anyone point me in a direction to find a tutorial on writing a script that will hide, (not show) The text link for the home page if my vistor is on the home page. i have read a book and they have on th4ere but it only deals with changing the type of image not disabling it and hiding it from veiw.

Randomizing Amounts Of Html Displayed
I have a HTML table with 5 rows of data. I would like to randomly display 3 of the 5 rows when the page is accessed. PHP Code:

How To Limit The Number Of Picture Displayed
I have a fully working photo gallery. A database stores the image locations and then returns the location within the <img src=> tag. What i need to do is limit the number of picture displayed on one page.

Lets say if more than 50 pictures are displayed then a next button is generated. Once clicked the page refreshes displaying the next lot of pictures.

As i am a low leveled PHP guy im not sure how to go about this. Any ideas?

Reduce Displayed Text Length
I am currently displaying people's names on the screen, but some people's names are longer than others. How do I display only 6 characters of a person's name, then display three dots (...) at the end.

$result = mysql_query("SELECT * FROM person");

while($row = mysql_fetch_array($result))
{
  echo $row['name'];
}

Sign '+' Is Not Being Displayed From A Mysql Database
Why  this sign '+' is not being displayed when i fetch it from a mysql database  ?

Special Character Is Not Displayed Both PHP And In Javascript
I have some problem while displaying the content with special characters like other language especially from Belgium Dutch characters, I meant the exact database table content [Belgium Dutch characters] not displayed in respective pages but only shows the other symbol like? [Question mark], please help me to avoid this problem.

Returned Values Displayed Differently?
I've got a function in PHP that calls values from a MYSQL DB, and it returns numbers. (eg. - Woolyg - 14)

Is there a way in PHP to substitute these numbers for worded values? So say if the function returned values 1-10 it displays the word 'Useless'... 10-20 displays 'Average'... and 20-30 displays 'Awesome'..?

Problems With Paging. Limit The Numbers Displayed
I'm having a problem with paging. I can do the paging but I want to limit the numbering. So if I had pages 1 to 30 I want 1 to 10 displayed and a next button beside the 10.

Here's what I got.

I Can't Get Info.php Working On PWS Win98 The Page Cannot Be Displayed
Can someone help me?
I have tried php-4.3.4-installer
I have tried php-4.3.4-Win32
If someone has PWS running PHP4 on windows 98
I would appreciate any help. thank-you

How To Limit Number Of Lines Displayed On The Page?
I just wrote this script to read information from a TXT file that contains list of JPEG files, and the list is rather huge. So I want to limit the number of displayed files to like 20 per page (with NEXT/PREVIOUS links to the next or previous 20), but I have no clue how to do it. Code:

PHP & Frames; Why Is The Full PHP Code Displayed In Frame?
Having completed a whole stack of PHP files, tested them (worked fine), I now have to let these pages be displayed in my client's website.
But said client has done his website in frames.

When I put in code like:

<frame name="main" src="myphpfile.php" >

what get's displayed in that frame is the full php code

Example: echo $name
instead of the actual name

so the browser is not sending the code to PHP first, it seems. How do I fix this?

I presume it's not a matter of, you can't have frames in a PHP/MySQL site.

Random Order Help Request - Prevent Previously Displayed Objects
I have a query that is showing new items in a store based upon their
inventory date. The problem with my Random order sort is that when the
"next" link is pressed, the random function is called again and I may see
the image previously displayed rather than go through the entire new
inventory.

SELECT *
FROM `Catalog`
WHERE (`Catalog`.thumbnail LIKE '%-04.%' or `Catalog`.thumbnail LIKE
'%-05.%' or`Catalog`.thumbnail LIKE '%-03.%' ) and `Catalog`.img_status =
&#391;' and `Catalog`.views != &#390;' ORDER BY RAND()

Date Is Not Being Pulled From MYSQL Database, Instead Current Date Is Displayed!
I am having trouble pulling a date from a database using PHP at the <a
href="http://www.mytuneslive.com/ameshkin69/"> following page.</a>

Here is the code. As you can see, it is just making the date the
current time. The values in the database are UNIX timestamp, and the
DATE() function is used to convert from UNIX to readable date. Can

<td width="55%" align="left" valign="top"><?php
$row_comment['timestamp'] = date("n d Y g:i A");.....

PHP Pages Getting 404 Error, "Page Cannot Be Displayed"...
I tried putting this into the PHP Installation forum but don't get any answers or suggestions there so I'm going to try it here and hope it doesn't get moved.

I'm on a Windows 2003/PHP 5.22 setup.  I'm TRYING to upgrade from PHP 5.02 which did work on my server and quite well.  I followed the upgrading and installation instructions layed out on the PHP.net set -- I still can't get it to work.

The install dumped all the PHP related files under "c:program filesphp".  I've ensured that path is in my windows PATH statement for my env vars.  I've also verified that "c:program filesphpphp-cgi.exe" is in my Web Service Extensions listing in IIS and the status is set to "Allowed". 

From the command-line, I can execute my "test.php" file that has the phpinfo(); info function in it and it works fine.  It's only when I try to use my web browser to access the php file that I get the 404 error, "page cannot be displayed".  I know that IIS in general is working ok because I can point it to the default http://servername/iisstart.htm and it resolves to that page just fine.  It's only when I change it to http://servername/test.php (which has my phpinfo()) function in it when I get the 404 error.

My web server just doesn't seem to be interpretting PHP files anymore and I can't figure out why.

No PHP Error. Just "Page Cannot Be Displayed"
I was wondering if someone could explain why I'm receiving this error. It's
like a 404 error but I think it might be something else.

Basically, I have a page where a user inputs his email address. The system
is supposed to look up the email address and send the associated password to
that email address. It worked up until a few months ago. Note that the
validation works. So, if the user tries to submit a blank text box, it
returns an error. If the email address is not found, it returns an error
"Email not found." But if the email is valid, it just dies. This code
worked a few months ago when I initially wrote it....

Calling Url.
Is it possible, with php, to figure out what the "calling url" is ?

Let's say I have a track.html (with some php code) and if someone
clicks on a link to track.html I want to see the url where that visitor
came from.

Calling CVS In PHP
Howdy does have any PHP fuctions that allow me to run CVS?
Here's what I've tried so far:

<?php
system('cvs
-d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/izicontents login;
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/izicontents
co -P iziContents1 .');

Calling PHP Within PHP
I have a script that is on serveral sites. It changes constantly, so updating 10 sites is a hassle. What I wanted to know if there is a way to call PHP within PHP, using php itself, or javascript, etc. Simply because I'll place the file that is going to be called on a seperate location where all sites can call from it.

Can it be called in a .js file? Using <?php at start ?> at end? or is there a easier way?

Calling Perl From Php?
I have a site all in PHP, for login, auth, session management, etc. I have to interface it with a banks perl scripts to do credit card transactions. Their wrapper perl script expects a few arguments, including a hash with all the data.

What would be easiest way to get the data entered into my adduser.php form to the perl script?

Calling Cgi As SSI Inside PHP??
Hello, i wanted to know if it is possible to execute perl scripts from inside PHP-scripted pages...

i have tried adding php to the SSI section of my apache server config file... SSI will work fine once i do that... however that will prevent any of the PHP from functioning inside the page.

Is there any way i can go about having both execute, and work in the same file?

Currently the page has around 2 small PHP scripts, and a cgi poll with the SSI inserted in it. I have tried changing to a PHP include, but that only works for PHP produced files... can i include a cgi file from PHP in a different format, and have it execute?

Calling Functions
Could someone out there give me information on how to call a function from a click event? Is it possible to do in PHP or do I need to write it in javaScript? What I would like to do is click the next record button and have all of the fields in my form change to hold the data of the next record in the table.

Name Of The Calling Method
I'd like to get the name of the calling method. I can't find the solution.
For example :

function MyFct()
{
return TheOtherFct();
}

function TheOtherFct()
{
echo "Hi, the calling method is ...";
return true ;
}

MyFct();

How To Calling Php Script From <img Src=>
I want to call a php scrip from <img Html tag. As the script should have to output any picture , But i don;t want to out put any picture. so how to out put a balnk picture so that the tag will work properly. Please give me a complete code.

Calling TCL Function From PHP 4.3
I'm just picking up PHP, and am really appreciating the transition, however,
I'm running into somewhat of a loggerhead. I'm trying to find a way to
utilize our existing code infrastructure (primarily written in TCL), while
providing an outlet for new technology (aka PHP). It seems that Tcl isn't
really well suited for integration with HTML pages (Rivet is fine, but not
as fleshed out as PHP seems to be). I was wondering if there is any
mechanism in which I can make embedded calls from PHP to TCL libraries? My
first priority would be for these processes to be somewhat embedded (ie:
avoid using a cgi-approach to invoke a new instance of Tcl each time the
particular page is requested via Apache).

Calling Functions
Can I call function like they are called in JavaScript, in events like Onclick and so on.
for examle like this: <input type='submit' value='remove' onclick='remove($current)'>

Get The Url Of The Calling Page?
Is there a function similar to php_self that gives me the actual page that will give me the url of the calling page?


Copyright © 2005-08 www.BigResource.com, All rights reserved