urtrivedi 276 Nearly a Posting Virtuoso

I agree with paulraj

urtrivedi 276 Nearly a Posting Virtuoso

What i have given you will show http://i1.mysite.com/showimage.php?imgid=i3rft to user. But user will never able to know actual server address where image is stored.

Showimage.php will silently show image from remote server without revealing remote server address

If you want to show like http://i1.mysite.com/upload/image.png and want to get image from remote then I am not sure how to do that

Khav commented: Thanks for the interest +0
urtrivedi 276 Nearly a Posting Virtuoso

showimage.php

<?php
    $form_no = $_GET['imgid'];


    if($_GET['type']==1)
        $file="p{$form_no}_photo.jpg";
    elseif($_GET['type']==2)
        $file="p{$form_no}_sign.jpg";
    $instr = fopen("http://92.43.223.43/upload/{$file}","rb");//here you can give url of your ftp server
    $bytes = fread($instr,filesize("http://92.43.223.43/upload/{$file}"));
    header("Content-type: image/jpeg");
    print $bytes;
    exit ();

?>

html

<img src ='showimage.php?imgid=i3rft'>
urtrivedi 276 Nearly a Posting Virtuoso

you just keep link as http://67.57.183.23/upload/i3rft.png
No need to wirte i1.mysite.com/...

urtrivedi 276 Nearly a Posting Virtuoso

not here man you need to do in first page

print "<a href='$page_name?start=$next&id={$_GET[id]}'><font face='Verdana' size='2'>NEXT</font></a>";

where ever you set $start everywhere you have to add $_GET[id]

urtrivedi 276 Nearly a Posting Virtuoso

you must also pass id with start

start=$i&id={$_GET[id]}'

urtrivedi 276 Nearly a Posting Virtuoso

whtas on screen now

urtrivedi 276 Nearly a Posting Virtuoso

Yes
I guess you will save i3frt.png name in database somewhere,
then when user uploads it copy that file to ftp server at location server/upload

if you show link in your file like server/upload/image.png
then it will also work fine

urtrivedi 276 Nearly a Posting Virtuoso

add this 3 lines in the beginging of your page

error_reporting(0);
ini_set("display_errors",0);
if ($_GET['start']=="")
    $_GET['start']=1;
urtrivedi 276 Nearly a Posting Virtuoso

I usually keep things on same server as I never had big number of files. Huge sites may be keeping file separate server.
I dont think bad performance if you keep files on same server, in case of medium sites

urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

you have to open mysql connection, you have to write query and you have to keep link in loop

urtrivedi 276 Nearly a Posting Virtuoso

write code here, not error

urtrivedi 276 Nearly a Posting Virtuoso

select username,id from members

<a href='members_profile.php?id=<?php echo $row[id];?> >' > <?php echo $row[username];?> </A>
urtrivedi 276 Nearly a Posting Virtuoso

no as i said only two page

like you see daniweb
it has web develpment topics, you can seee list of around 20 topics then on next page next 20.

If you lick on title of topic this page loaded
so basically there are only 2 pages, one for listing another for vieewing

you just pass userid to the second page and in ur query, u filter records on the base of passed userid

first page

<a href='mem_profile.php?uid=1> Memeber 1<a>
<a href='mem_profile.php?uid=2> Memeber 2<a>
<a href='mem_profile.php?uid=3> Memeber 3<a>
<a href='mem_profile.php?uid=4> Memeber 4<a>

second page (mem_profile.php)

select * from table where userid='{$_GET['uid']}'

display record of uid clicked

urtrivedi 276 Nearly a Posting Virtuoso

following line

update-server.php?server=$server_id

it should be like this when u click in address bar

update-server.php?server=12

it must be some number or value and not variable name

mmcdonald commented: What i've done works fine but thanks for the reply.... +0
urtrivedi 276 Nearly a Posting Virtuoso

You can create 2 pages.
1) list all members with pagination, with id link to there profile page
2) profile view page (same as you profielpage u did for modifying, but only text no html elements)

urtrivedi 276 Nearly a Posting Virtuoso

what u did so far?

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about performance.
1) you have to upload file using script to same server where script is available.
2) copy that file to another server using ftp funciton of php
3) delete file from script server

Khav commented: From Khav +2
urtrivedi 276 Nearly a Posting Virtuoso

The form select name is 'select' in your form, and in code you are looking for 'help' name.

so change your name to 'help'

change following line in your contact.htm

<select name='select'>

to

<select name='help'>
urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about your query, but If you want distinct row, if you add distinct keyword after select keyword you will distinct result
so if you say

select distinct TrayID, TrayID , EVA_ID from tablename

The you will get following result

TrayID| TrayID | EVA_ID
313 | 313 | NULL
852 | 852 | 456-89
759 | 759 | 654-22

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure how you can add page break in plain text file. I think its dependent on software you use to open file like notepad/wordpad/word etc.

urtrivedi 276 Nearly a Posting Virtuoso

Does this help

$text="\r\n Your text to write \r\n ".date('d')."-".date('m')."-".date('Y')."\r\n";

urtrivedi 276 Nearly a Posting Virtuoso

IN your sql query to load invoice details, you add one more condition to filter records based on login id.

$query="select * from invoice where invoieno='{$_GET[ids]}' and USERID='{$_SESSION['userid']}'";
logicaweb commented: Solved my problem. +0
urtrivedi 276 Nearly a Posting Virtuoso

For such case I have created education master table
edu_id, edu_desc, edu_order,
1, SSC, 1
2, hsc,2
3, PHD, 3

I will create on more table user_eductaion
userid, edu_id (ref to above), marks, percent,year

When you insert userid in your usertable at same time you can insert all multiple records from edu_master to user_education with userid just login, rest columsn will be null.

Now when user clicks on eduction page, he will have list of all 3 education detail
So user will simple modify the record by udpating marsk, percent, year. So your query will update record and not insert when user saves

urtrivedi 276 Nearly a Posting Virtuoso

its done on its own. when you create table when you add coulmn, information scheams is managaged by mysql server. You dont have to worry about it, you just use like the query you are using above

urtrivedi 276 Nearly a Posting Virtuoso

I had same issue, to avoid recursion i stored all paraent level relation in another table called item_level like for
child_id, parent_id, level
4, 4, 0 (self record at level 0)
4, 1, 1 (first parent that is women for wtshrit at level 1)
4, 0, 2 (second parent (grand father) that is dress for wtshrit at level 2)

same you have to add all upper parents for all ids in your main table

so whenver record is inserted in main table you can insert multiple parent records in level table like abvoe

then you can write join query to sum up things main table to level table

urtrivedi 276 Nearly a Posting Virtuoso

change line 34-37 to

$tresult=mysql_query($tquery) or die(mysql_error());
?>
<table>
<?
While($trow=mysql_fetch_assoc($tresult) { ?>

I have added $tresult in paramenter, do not use $result again

urtrivedi 276 Nearly a Posting Virtuoso

1) semicolor at the end is not needed

or

$tquery="SELECT questions.id,questions.date,questions.title,users.user_name,subjects.subject FROM questions INNER JOIN users ON questions.student_id=users.id INNER JOIN topics ON questions.topic_id=topics.id INNER JOIN subjects ON topics.subject_id=subjects.id WHERE subjects.id=".$_SESSION['sub1']." OR subjects.id=".$_SESSION['sub2'].";"; 

echo $tquery;

2)
a you can echo query before mysql_query,

b run script in browser,
c you will find prepared query on browser output
d copy the output query
e open phpmyadmin or any other interface for mysql
f run that copied prepared query and see query give result or not, otherwise make changes accordingly

urtrivedi 276 Nearly a Posting Virtuoso

what error does it return (may be you can see error number also)

Here query runs perfectly

urtrivedi 276 Nearly a Posting Virtuoso

Following way you can refer third record (index=2).

echo "Third person: ".$data[2]['FirstName']." ".$data[2]['LastName']."-".$data[2]['Amount'];
urtrivedi 276 Nearly a Posting Virtuoso
urtrivedi 276 Nearly a Posting Virtuoso

what exactly you want to extract?

urtrivedi 276 Nearly a Posting Virtuoso

curl is another way of doing

urtrivedi 276 Nearly a Posting Virtuoso

very strange

urtrivedi 276 Nearly a Posting Virtuoso

You are missing ON keyword after inner join subjects

SELECT questions.id,questions.date,questions.title,users.user_name,subjects.subject FROM questions INNER JOIN topics ON questions.topic_id=topics.id INNER JOIN subjects ON topics.subject_id=subjects.id INNER JOIN users ON subjects.id=users.sub1 OR subjects.id=users.sub2 WHERE users.id=8;

urtrivedi 276 Nearly a Posting Virtuoso

no
it is cpanel demo
same way when you login to your cpanel account u find same databae section
on left side you can see "server"
then you have to create users for your mysql database, you have to give privilleages to your user to your database. (this username/pwd/database can be used to login to mysql database)

to allow remote access to mysql you need to give remote (your static ip address if you have)

urtrivedi 276 Nearly a Posting Virtuoso

http://x3demob.cpx3demo.com:2082/frontend/x3/index.html?post_login=67057016356023
Here you can see cpanel demo,
In database section click remote mysql

http://x3demob.cpx3demo.com:2082/frontend/x3/sql/managehost.html

Here you can see you can allow IP OF your server to access cpanel mysql db

urtrivedi 276 Nearly a Posting Virtuoso

when you buy any server space, they alwyas provide all 4 parameter like servername , database name, username and password for mysql.

so where is database server, ask them to provide the info. or if u can login to there system. you may find such information somewhere in ur account

urtrivedi 276 Nearly a Posting Virtuoso

to access another server mysql data, you need to have permission to do so in mysql. If you know administrator you can ask him to allow access to the server.

urtrivedi 276 Nearly a Posting Virtuoso

I am adding hidden field for each icode next to check box

<?php

for (..)
{
<input name=prod[] type=checkbox value='$pr' onclick='javascript:setorder(this);'>
<input name='cd-$pr' id='cd-$pr' type=hidden value=''>
}
?>

now I am adding java script at the end of page

<script lang='javascript'>
var chkorder=1;
function setorder(chkbx)
{
   if(chkbx.checked)
   {
      document.getElementById('cd-'+chkbx.value).value=chkorder++;
   }
   else
   {
      document.getElementById('cd-'+chkbx.value).value='';
   }
}
</script>

Now in submit page you can get order of icode by following code

<?php
for ($i=0;$i<count($_POST[prod]);$i++)
{
    echo "icode={$_POST['prod'][$i]}  , chk order=$_POST['cd-'.{$_POST['prod'][$i]]}    ";
}
?>

SYNTAX IS NOT TESTED

urtrivedi 276 Nearly a Posting Virtuoso

submit your code then we may able to help you.

urtrivedi 276 Nearly a Posting Virtuoso

I dont know what problem you have, but your code is working here, you can try following code at your place

<?php

$dataTable= " 
{
'cols':[{'type':'string','label':'Analys'},
{'type':'number','label':'Test 1'},{'type':'number','label':'Test 2'}],
    'rows':[
{'c':[{'v':'Top'},{'v':78},{'v':71}]},
{'c':[{'v':'In'},{'v':88},{'v':91}]},
{'c':[{'v':'Pref'},{'v':60},{'v':72}]},
{'c':[{'v':'Int'},{'v':13},{'v':9}]}]}";

?>
<html>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = new google.visualization.DataTable(<?php echo $dataTable; ?>);  

        var options = {
          title: 'Company Performance',
          hAxis: {title: 'Year',  titleTextStyle: {color: 'red'}}
        };

        var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>

</head>
<body>
<div id='chart_div'></div>
</body>
</html>
urtrivedi 276 Nearly a Posting Virtuoso

post code of both pages here

urtrivedi 276 Nearly a Posting Virtuoso

You need to write javascript function, which will be called when item is selected in dropdown.
That function will add value/text to DIVs

urtrivedi 276 Nearly a Posting Virtuoso
{'type':'string','label':'Analys'},
{'type':'number','label':'Test 1'},
{'type':'number','label':'Test 2'}

I have changed type of 2 last rows to number from string

urtrivedi 276 Nearly a Posting Virtuoso

I am not sure about how asp.net uses cookies, But in php I used cookies to solve this kind of issues.
I had problem when user presses refresh button, it was inserting same record with new id. So I used cookies to track where record inserted or not.

urtrivedi 276 Nearly a Posting Virtuoso

I dont find any parse error in your code. What message you getting when you run this script.

ONe thing I see in line number 10, is its not $PHP_SELF rather its $_SERVER['PHP_SELF'];

urtrivedi 276 Nearly a Posting Virtuoso

so nothing is passed to your page

urtrivedi 276 Nearly a Posting Virtuoso

there are 2 ways,
1) conventional way,
on changing selection, you can submit page to server,
on server php source will fetch record by parameter passed
display record on page

2) jquery/ajax
You need to learn jquery/ajax
on changing selection, you can pass value to server without submitting whole page
then server will send response(you have to write request handler and u need to send response code)
you can display server response on the page