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
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
?>

Link to comment
Share on other sites

There is a link in my signature to a book (Hudzilla), that book has an entire chapter on using databases with PHP. I suggest you start there, were not really here to write tutorials, especially considering there is already allot of information on the net.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

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 />";
    }
  }
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.