Jump to content

how to run values on page


TheSky

Recommended Posts

Hello

i have little problem i want run page with different values like mypage.php?user=username i tryed with cron job but there cant be special symbols in url and i have like list of values in database what i need run with that page is there some kind php function for that?

 

EDIT: i want only run one page with different values

Link to comment
https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/
Share on other sites

i dont have much

<?php
$name = htmlspecialchars($_GET['nickname']);
if (empty($name))
{
    echo("<font color=red><b>pleas enter username!</b></font><br>");
  } else {
     echo("<font color=green><b></b></font><br>");
// here continues ~130 rows of code what is geting data from another webpage and inserts it to database tables or updates
?>

im back agen

<?
include('connect.php');
$query="SELECT username FROM u_data";
$result=mysql_query($query);
$num=mysql_numrows($result);
mysql_close();
echo "<b><center>Database Output</center></b><br><br>";
$i=0;
while ($i < $num) {
$first=mysql_result($result,$i,"username");
//end select user
$i++;
//continue
$name = htmlspecialchars($first);
if (empty($name))
{
    echo("<font color=red><b>pleas enter username!</b></font><br>");
  } else {
     echo("<font color=green><b></b></font><br>");
//continue code
}
?>

i get only first user updated others are with empty value ($name)

I'm sure that code isn't an example from the resource I linked you to, it's terrible.

 

<?php

include 'connect.php';

$sql = "SELECT username FROM u_data";

if ($results = mysql_query($sql)) {
  if (mysql_num_rows($results)) {
    while ($row = mysql_fetch_assoc($results)) {
      echo $row['username'] . "<br />";
    }
  }
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.