Jump to content

Help on: Creating a Simple Url Submission..


0o0o0

Recommended Posts

what im trying to do is make a single button or page url submission, for after I create websites for clients..

 

simply click and she goes.

 

The ones out there now are sending urls to spammers, and emails to spammer companies.. When you do a website for someone and 3 weeks later they say the mail is discusting, repetitive they dont know whats business and whats junk. I just want to make my own private and control the places it submits too. Without giving some third party my clients new url and email address.

 

This works but ONLY on the last entry.. so say 10 in DB.. it only visits the 10th. Ive read some "array" threads but just need a tiny tiny bit of help on what I may be doing wrong.

 

 

thanks!

 


<?php

$sql = mysql_query("SELECT domainonly FROM urlsubmitdb");

while($line = mysql_fetch_assoc($sql)){

$domainonly[] = $line;	
}

foreach($domainonly as $e){		

$d = 'http://www.';
$f = '/blabla=123&blabla=submitexamplelink';

$e = $e['domainonly'];
$g = "$d$e$f";

header('location:'.$g);

usleep(3000000); // 3000000 wait for 3 seconds

?>

 

 

Cant be all that bad code, the lights are still on in Manhatten!

Edited by 0o0o0
Link to comment
Share on other sites

You can't do a header() redirect to multiple locations at once. The browsers will ignore everything up to the last one.

Rethink how you want users to do this. Maybe your script can submit the URLs directly?

 

[edit] Code critique: please don't use one letter variable names for non-trivial variables.

$d = 'http://www.';

What the heck does $d mean?

header('location:'.$g);

What was $g? What does it mean?

 

In your short code sample it's easy to scroll up, but when you do it to code with hundreds of lines (or more) you're only creating grief for those who have to read it. Including yourself in the future.

Edited by requinix
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.