Add to Google

I think I am one of the best PHP programers here - ... and that's why I will help you

Pages: 1, 2, 3, 4
free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

I think I am one of the best PHP programers here - ... and that's why I will help you

Roly
With single quotes you can make a new line by just pressing enter,
CODE
echo 'line 1
line 2
another line omg';

With double quotes you can press enter or use \n,
CODE
echo "line 1\nline2
another line omg";

And sure ask more questions that's what I'm here for smile.gif

Reply

CodeName_88
I don't have anything about the scripts themselves, but why do the PHP scripts in my forums keep crashing? Can I do anything to prevent it?

Reply

Roly
What forum are you using?

Reply

CodeName_88
I'm using IPB.

Reply

ddwyer
Ok here is my next project.

I will have a tabe in db2 called 'clients'. On the left side of my page, there is a list of clients. When you click on that client, I want it to pull values from db2 (clients) and fill in the body of the page. Is there a way to do this, again, without seeming to leave index.php? Below is some sample data:

ClientName: Client XYZ
PasswordReset: No, we cannot reset this clients passwords.
RemoteAccess: To remote access this client , go to xxx.yyy.zzz.bbb IP Address.

So on and so forth. But heres the catch: There is a lot of client specific data that will not fit in other clients categories, so I Was thinking of having some values called CS1 (client-specific 1) through CS10. But, another proble I am thinking of is this: All the other values will have data that I KNOW whats in there, like ClientName. I know for sure that this field will contain the client name, so in the Header before this i can put "Client Name:" and then follow with the data. With the client-specific fields, I won't know what data is about to follow so I dont know how to format my page to read the data and name the field. I dont want to have a section called "CS1:", I'd rather have a way to read in the first word or two and have this be the name of the field (is possible).

Any help would be appreciated. Sorry for the lengthy post.

Dennis

 

 

 


Reply

Roly
You should add an id to each client and link on the left side of the screen. The link should be something like "index.php?id=1". Then the code should be like,
CODE
<?php
if(isset($_GET['id']))
{
 $result = mysql_query('SELECT * FROM clients WHERE id = \''.$_GET['id'].'\'');
 if(mysql_num_rows($result) > 0)
 {
   $row = mysql_fetch_assoc($result);
   echo '<b>ClientName:</b> '.$row['ClientName'].'<br /><b>PasswordReset:</b>'.$row['PasswordReset'].'<br /><b>RemoteAccess:</b>'.$row['RemoteAddress'];
 } else
   echo 'Invalid Client ID';
}

I hope that helps, I didn't really udnerstand what you want to do >_>

Reply

ddwyer
Cool, that may work. Let me try to explain what I am trying to do a little better. I am trying to design a new Intranet page for my company. We offer tech support to different companies, and as you could imagine every company infrastructure is different. We have a lot of information on each client like what their server names are, how to connect to them, their document management system, etc.

As it sits now, along the left hand side of my page is a toolbar. In this toolbar I have a link to every one of our clients (Approx 30 of them). When you click on a particular company, I want all of their data to come up.

What I was thinking may be the best thing to do is create a new table for each client. Since these different companies have such unique information, trying to make one table in SQL that has room for ALL of EVERY client's information is challenging. We have a wide variety of information for each client so making one general template seems like a daunting task.

So on to what I think may be the best option. With a separate table for each client, when you click on Client XYZ on the toolbar, the page can open table XYZ which has all of that companies info. It can then run some sort of a loop to keep outputting the next field of information for _THAT_ client until it has reached the end of the table. This way I can have very different info for each client and not have to make some sort of general template that can fit every client.

What do you think? Any suggestions?

Dennis

Reply

Roly
I don't think having that many tables is a good idea but if you want to go for it. But if you were to do it with only one table I would recommend you store the information with another field, company. That field would be the same if the company information is the same.

For example, company 1 would be like:

QUOTE
Company: 1
ClientName: Client XYZ
PasswordReset: No, we cannot reset this clients passwords.
RemoteAccess: To remote access this client , go to xxx.yyy.zzz.bbb IP Address.

Company: 1
ClientName: info
PasswordReset: info
RemoteAccess: info


Then run a mysql query that would look like
CODE
mysql_query('SELECT * FROM clients WHERE company = '.$_GET['company']);

Then do a while statement to output all the company information to the page.

Reply

Roly
QUOTE(CodeName_88 @ Aug 8 2004, 05:43 AM)
I'm using IPB.

I'm not sure I never liked any of those boards much because of their speed.

Reply

LuciferStar
cookies are stored in client machine
sessions are stored in sever machine

sessions are safer than cookies.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Pages: 1, 2, 3, 4

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for php, programers

*MORE FROM TRAP17.COM*
advertisement



I think I am one of the best PHP programers here - ... and that's why I will help you



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE