473,698 Members | 2,445 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to make a FORM (html) apparead in a PHP file than requeired be log-in to be shown

1 New Member
The question is simple

But I'm kinda a newbie so I'm gonna try to tell what's the problem and why i ask this

I'm doing a login system than, for different users showing different services, and until the moment all the login process has successfully ended just fine and works perfectly, BUT

some of this services i wanna add include the use of a form, the forms are HTML, and the "session_start( )" are PHP like all of you must know, so this is the question.

(already try with echo, btw)

Is there any way to add a form (html based) inside a PHP script to actually works depending of if it's working or not the `session_start( )`?

With the "Session_start( )" i mean if he is or not log-in
Have in mind that the service is gonna be used by the person who login

in other words:

Expand|Select|Wrap|Line Numbers
  1.         <?php
  2.     session_start();
  3.     echo $_SESSION['username'];
  4.     echo $_SESSION['name'];
  5.     echo $_SESSION['test'];
  6.     if ($_SESSION['class'] === 7){ 
  7.     } elseif ($_SESSION['class'] === 7 or 2) {
  8.     // here i need a html form like this:
  9.     // <form action="upload.php" method="post" enctype="multipart/form-data"><br />
  10.     // <input type="file" name="info" /><br />
  11.     // <input type="submit" value="Subir" />
  12.     // </form>
  13.     } elseif ($_SESSION['class'] === 7) {
  14.     echo "esto también";
  15.     } elseif ($_SESSION['class'] === 7) {
  16.     echo "esto también";
  17.     }
  18.     ?>
Thanks in advance

PS: Any suggestion to improve the question, or question you have for clarification would be greatly appreciated too, just say it.
May 28 '14 #1
0 1331

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2475
by: jaydog | last post by:
Hello... I'm new to XSL, and I've written a XSLT file that converts a XML file to HTML format. When viewed in a browser, it appears exactly as I would like. However, if I want to look at the HTML as text, which I do, then I have trouble because the XSLT processor (SAXON) outputs everything as one continuous line. How can I make the HTML output from SAXON readable? Is there a command in the XSLT language that forces line breaks? ...
8
1995
by: Mike MacSween | last post by:
There doesn't seem to be a way to do this. The Access security model seems to be based around allowing the users to read/alter design of the form (where reading includes editing the data) I want to allow certain users (well, a member of a certain group) - and I'm talking about mdw users and groups here to be able to edit (or not) data on a form. But still be able to view the data even if they can't edit it, er, them. Is this going to...
0
1355
by: darren | last post by:
When using the html input file (input type=file), is there anyway to NOT have the file loaded on the server? I am only interested in using this control to browse to a file and then get the filename, but when the form posts the file ends up on the server. I am using a popup window with 4 input file controls on it, and just want to return the file names to the parent window when the popup window closes, I don't want the files loaded. Is...
0
1221
by: jimryder | last post by:
I have an HTML button next to a Webcontrol Command button on my aspx page. They don't look the same! I know how to style, I just don't know what style to use to make the HTML button look like the command button. Can anyone help? FYI: the command button does a load of code behind work, where as the cancel button just runs some JS to close the form.
1
1280
by: encoding | last post by:
véúóëÜöéúóëÜöéúóëÜöéúóëÜöéúóëÜö Hi! I read the folowing discussion: http://groups.google.com/group/comp.infosystems.www.authoring.html/browse_thread/thread/e310d85640e54eb3/b50e36acb6d68931?lnk=gst&q=Can+an+HTML+source+file+be+specified+in+unicode+%3F+&rnum=1#b50e36acb6d68931 Wich is about charset encoding and HTML. I am looking for a way to make my online service compatible for any
1
1509
by: czi02 | last post by:
hi there; for example, ive type my name on html frontpage cziarel then ive marquee it. Then ive type under my name cziarel Then I wanted to make my html go to other page when ive click on the cziarel it will shows my pictures. the ive hyperlink the cziarel but I dont know the destiantion of my html. How may I click my name cziarel then it see my pictures. I like to be able to if I click my name czaieral then it will go other pages then...
3
27016
by: =?Utf-8?B?TWlrZQ==?= | last post by:
I have an asp.net 2.0 web application that I have pre-compiled and deployed to a Windows 2003 server. When I try to access the web application I get the following message in my browser: 'The file '/Customer/Login.aspx' has not been pre-compiled, and cannot be requested'. If I rename the folder containing the web app to something other than 'Customer' then it works! I have tried deleting the folder and recreating it but I get the same...
1
1627
by: tariqahmedpak | last post by:
Hi to All I need to ask that i have HTML Input File Server Control on the page (ASP.NET 2.0) when i browse the file and then in the code behind when i try to apply method HasFile it gives false means no file selected but i have selected a file. Please help me in this problem.
1
3586
Fary4u
by: Fary4u | last post by:
Hi Guys i'm trying to upload a file, i've tried 3 different methods but still not work out i don't know how to over come this problem hidden file value, multiple form or popup uploading. 1- <SCRIPT TYPE="text/javascript"> function popupform(myform, windowname)
0
1399
by: SidraHaque | last post by:
Hi, I have made a form that is really big ... its almost 5000 by 4000 ... and its got buttons pannels labels ... Now i need to convert this whole form into pdf file in a way that it doen't lose its resolution.... I have tried the printform comp with pdf creator but when i zoom it in to display the whole form on screen and then print it, the pdf created isn't proper as in when i zoom it in the text and stuff isn't readable... when i don't zoom...
0
8675
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9160
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8862
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.