• 0

[PHP] Help trying to clear text when clicking on a link


Question

hey, so i'm playing around with PHP just to get used to it.

i was wondering if its possible to make this

page.php

(everything is being done and reported back to page.php btw)

have two options via submit button

Option 1 - Option 2

[submit] [submit]

when the option is clicked for it to clear the current data and show the new data when clicked.

so far i have this

if($opt1)

{

echo "option 1";

}

else

{

echo "option 2";

so $opt1 will clear everything and show the info in that IF statement.

dunno if i explained it clearly :huh:

Recommended Posts

  • 0

It might help to set out a structure for what you're wanting to do. E.g:

register3.php?agent => register3.php?agent&step=1 => register3.php?agent&step2

The current step (e.g. step = 1) needs to have the next step as it's action. For example:

<form method="post" action="register3.php?agent&step=2"></form>

Follow this general pattern and it should make things clearer. ;) Let me know if you need any further clarification.

Steven

  • 0
It might help to set out a structure for what you're wanting to do. E.g:

register3.php?agent => register3.php?agent&step=1 => register3.php?agent&step2

The current step (e.g. step = 1) needs to have the next step as it's action. For example:

<form method="post" action="register3.php?agent&step=2"></form>

Follow this general pattern and it should make things clearer. ;) Let me know if you need any further clarification.

Steven

judy wondering but

if i use only IF statements to create the form will all the data thats inputted in each from step be saved globally?

if not, then will a switch style form work the way i want it to work?

  • 0
judy wondering but

if i use only IF statements to create the form will all the data thats inputted in each from step be saved globally?

if not, then will a switch style form work the way i want it to work?

When you move from step to step, you'll need to re-post all the data to that step (by outputting it in the form like you did previously). You can have it remember data globally by storing it as a session or cookie. A switch statement will work the same as if statements - a switch statement is basically a more compact way of writing if statements. E.g. this set of if statements:

if($test == 4) 
{
echo 'It is 4!';
}
else if($test == 10)
{
echo 'It is 10!';
}
else
{
echo $test;
}

corresponds to this switch statement:

switch($test)
{
case 4:
echo 'It is 4!';
break;
case 10:
echo 'It is 10!';
break;
default:
echo $test;
break;
}

Steven

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Good. I hope more people sue them for focusing on this worthless junk.
    • How about fire the guy who approved all the bad decisions? The guy who bought these studios in the first place? Oh wait, Satya is safe with his billions while the workers pay the price.
    • This had nothing to do with games. This is all about management wanting to squeeze as much money from Xbox to keep Microsoft's AI ambitions afloat. Someone has to make money to burn on AI.
    • GeekBook X16 Pro Intel Core Ultra 9 thin and light laptop gets a 17% discount by Steven Parker GEEKOM is back with a 17% discount on its top-of-the-range X16 Pro laptop. You may remember that we reviewed the X14 Pro back in February, which marked GEEKOM's debut into the ultrathin laptop segment. You can view the full specs below. GEEKOM X16 Pro Model NX14CM Dimensions 322.58 × 213.36 × 5.8 mm (12.7"L x 8.4"W x 0.23"T) Weight 997 g / 2.2 lbs Material Unibody Magnesium Alloy CPU Intel Ultra 5 125H (14C/18T, 24MB L3, 2.3-5.1 GHz, TDP 20W) Intel Ultra 9 185H (16C/22T, 24MB L3, 2.3-4.5 GHz, TDP 35W) Graphics Intel Arc graphics 8 Xe-cores @ 2350MHz 1024 shading units/stream processors (128 CUs), 8 Raytracing Cores, 64 texture mapping units, and 32 ROPs NPU Intel AI Boost, 11 TOPS / Up to 33 TOPS (CPU+NPU+GPU) Memory 32GB Dual-channel LPDDR5x 7467 MT/s Micron SODIMM Storage 1 x M.2 2280 PCIe Gen 4x4, Wodposit 1TB, 2 TB Display 16.0" IPS LCD, 2560 × 1600 (16:10) 100% sRGB, 120Hz Refresh Rate Camera 2MP 1080P 1 × Light sensor in camera module 1 × LED indicator in the camera module Windows Hello Support: No Mic 2 x Digital Mics integrated in the camera module Speakers 2 x 3813 (4Ω×2W) built in body Audio Codec: ALC269QN-VC3-GR Certificate: DTS: X Ultra Operating System Windows 11 Pro 25H2 Bluetooth Bluetooth 5.4 Wireless LAN MediaTek MT7922 M.2 Wi-Fi 6E LAN card Left I/O ports 1 x HDMI 2.0 2 x USB4 (40 Gbps) Right I/O ports 1 x USB 3.2 Gen 1 Type-A (5 Gbps) 1 x 3.5 mm Audio jack 1 x Camera Privacy Shutter Keyboard 78Key 1.2±0.2mm / Height 3.5±0.2mm (with backlight) White LED light in Caps Lock and Fn key Language: Default US Touch Pad Dimension: 120 x 71mm Material: Mylar Position: Middle Interface: I2C, Dualpoint button Dock Input port: 1 x Type-C 2 x USB 3.0, 1 x RJ45 1 x PD 1 x HDMI (Bio) Security Fingerprint sensor (in the power button) SD Card slot No Kensington Lock No Battery 77Wh (Input 20V, 3.25A) Power 65W PD GaN Fast Charge, USB-C to USB-C Warranty 2 years (Early Bird 1+1 Years) Deal price $1119.67 The X16 Pro is powered by the Intel Ultra 9 185H, which was released in Q4 2023 and is a 14th Gen Meteor Lake CPU designed for laptop/mobile using the Intel 4 architecture based on a 7nm process. The Ultra 9 185H features 16 cores and 22 threads running at up to 5.1 GHz. It also includes a dedicated NPU utilizing Intel AI Boost at 11 TOPS. On the graphics front, the 185H includes the still fairly capable ARC Graphics (not to be confused with the newer ARC 140T) integrated GPU with a max GPU frequency of 2350 MHz across 8 Xe-cores. It has been said that the iGPU is equivalent to the NVIDIA GeForce 3050 and GTX 1650 in gaming and synthetic benchmarks. Other highlights include an AMOLED display, LPDDR5x memory at 7467 MT/s, WiFi 6E, Bluetooth 5.4, and a fingerprint sensor built into the power button. AI PC? Although the Intel Core Ultra 9 185H includes a dedicated NPU, it's only 11 TOPS; therefore, it does not qualify as a Copilot+ PC. However, it can reach up to 33 TOPS with a combination of NPU, CPU, and GPU. As I said, although we only reviewed the X14 Pro, the unboxing is the same for the X16 Pro, which I noted in my review. The packaging is quite a nice experience. The outer box houses the X16 Pro box with a small compartment that contains the 5-in-1 Dock ($40 value), which appears to be an "Early Bird" inclusion. Upon removing the box cover, the X16 Pro is revealed sitting in a cardboard compartment with two small booklets of documentation. To the left of the X16 Pro are two cardboard compartments containing the 65W charger and Type-C USB cable. What’s In The Box 1 x GEEKOM X16 Pro Ultra-thin Laptop 1 x Type-C to Type-C cable 1.8M 1 x 65W GaN PD Fast Charger 1 x Warranty Card 1 x Thank You Card 1 x User Guide All products sold by GEEKOM receive a 3-year free Warranty from the date you receive the product. If needed, you can RMA or return locally relative to your region (the U.S. has a U.S. warehouse, mainland E.U. has a German warehouse). GEEKOM X16 Pro at GEEKOM U.S. for $1,119.67 was $1,349 (17% off) Use coupon code NWGBX1617 when checking out. This flash deal expires on July 2. Huge Summer Sale As a reminder, yesterday GEEKOM kicked off their Huge Summer Sale, in which there are deep discounts on a range of other GEEKOM products. From June 15 to June 30, the GEEKOM Official Store will be running its Summer Sale, with discounts starting from 15% off across the entire lineup, up to 50%! This is their biggest promotion of the year so far, offering pricing that is even lower than select Prime Day deals. You can check out the discounts at the dedicated Summer Sale landing pages below. GEEKOM U.S. Summer Sale GEEKOM U.K. Summer Sale While the Summer Sale ends on June 30, this deal will remain active until July 2.
  • Recent Achievements

    • One Year In
      Console General earned a badge
      One Year In
    • One Year In
      Twozo Technologies earned a badge
      One Year In
    • One Month Later
      Twozo Technologies earned a badge
      One Month Later
    • Week One Done
      Twozo Technologies earned a badge
      Week One Done
    • Veteran
      branfont went up a rank
      Veteran
  • Popular Contributors

    1. 1
      +primortal
      519
    2. 2
      +Edouard
      199
    3. 3
      PsYcHoKiLLa
      110
    4. 4
      Steven P.
      89
    5. 5
      Nick H.
      71
  • Tell a friend

    Love Neowin? Tell a friend!